From: Pavel Begunkov <asml.silence@gmail.com>
To: Ammar Faizi <ammarfaizi2@gmail.com>
Cc: Jens Axboe <axboe@kernel.dk>, io-uring@vger.kernel.org
Subject: Re: [PATCH liburing] tests; skip non-root sendmsg_fs_cve
Date: Sun, 22 Aug 2021 13:46:10 +0100 [thread overview]
Message-ID: <b13f39b5-3629-ae09-74ee-64e48bd68472@gmail.com> (raw)
In-Reply-To: <CAFBCWQKZv=mNPYqx4FQDgNjjH=efaXO+gQ-=U_=rbJCbFJh6Dw@mail.gmail.com>
On 8/22/21 1:43 PM, Ammar Faizi wrote:
> On Sun, Aug 22, 2021 at 7:08 PM Pavel Begunkov <asml.silence@gmail.com> wrote:
>> - if (chroot(tmpdir)) {
>> + r = chroot(tmpdir);
>> + if (r) {
>> + if (r == -EPERM) {
>> + fprintf(stderr, "chroot not allowed, skip\n");
>> + return 0;
>> + }
>
> Hey, it's the userspace API.
>
> chroot, on success, zero is returned. On error, -1 is returned, and errno is
> set appropriately.
That was extremely silly indeed, thanks Ammar.
Curiously, it didn't fail because EPERM == 1
> Did you mean if (errno == EPERM)?
> Should #include <errno.h> as well.
> Sorry for the duplicate, forgot to switch to plain text.
> ---
> Ammar Faizi
>
--
Pavel Begunkov
prev parent reply other threads:[~2021-08-22 12:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-22 12:07 [PATCH liburing] tests; skip non-root sendmsg_fs_cve Pavel Begunkov
2021-08-22 12:43 ` Ammar Faizi
2021-08-22 12:46 ` Pavel Begunkov [this message]
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=b13f39b5-3629-ae09-74ee-64e48bd68472@gmail.com \
--to=asml.silence@gmail.com \
--cc=ammarfaizi2@gmail.com \
--cc=axboe@kernel.dk \
--cc=io-uring@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).