From: Pavel Begunkov <[email protected]>
To: Jens Axboe <[email protected]>, [email protected]
Cc: Ammar Faizi <[email protected]>
Subject: [PATCH liburing v2] tests; skip non-root sendmsg_fs_cve
Date: Sun, 22 Aug 2021 13:49:32 +0100 [thread overview]
Message-ID: <1b9f241b5cbb6bc399528c260d136667f3404a5f.1629636462.git.asml.silence@gmail.com> (raw)
Skip sendmsg_fd_cve if we don't have enough privileges to chroot().
Cc: Ammar Faizi <[email protected]>
Signed-off-by: Pavel Begunkov <[email protected]>
---
v2: fix error checking (Ammar Faizi)
test/sendmsg_fs_cve.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/test/sendmsg_fs_cve.c b/test/sendmsg_fs_cve.c
index 8de220a..3866e5d 100644
--- a/test/sendmsg_fs_cve.c
+++ b/test/sendmsg_fs_cve.c
@@ -154,7 +154,13 @@ int main(int argc, char *argv[])
if (!c) {
close(rcv_sock);
- if (chroot(tmpdir)) {
+ r = chroot(tmpdir);
+ if (r) {
+ if (errno == EPERM) {
+ fprintf(stderr, "chroot not allowed, skip\n");
+ return 0;
+ }
+
perror("chroot()");
return 1;
}
--
2.32.0
reply other threads:[~2021-08-22 12:50 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1b9f241b5cbb6bc399528c260d136667f3404a5f.1629636462.git.asml.silence@gmail.com \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox