From: Tycho Andersen <tycho@tycho.pizza>
To: Sargun Dhillon <sargun@sargun.me>
Cc: "Kees Cook" <keescook@chromium.org>,
LKML <linux-kernel@vger.kernel.org>,
"Linux Containers" <containers@lists.linux.dev>,
"Andy Lutomirski" <luto@kernel.org>,
"Rodrigo Campos" <rodrigo@kinvolk.io>,
"Mauricio Vásquez Bernal" <mauricio@kinvolk.io>,
"Giuseppe Scrivano" <gscrivan@redhat.com>,
"Christian Brauner" <christian.brauner@ubuntu.com>,
"Mickaël Salaün" <mic@linux.microsoft.com>
Subject: Re: [PATCH 3/4] seccomp: Support atomic "addfd + send reply"
Date: Tue, 11 May 2021 15:50:10 -0600 [thread overview]
Message-ID: <20210511215010.GB1964106@cisco> (raw)
In-Reply-To: <20210502001851.3346-4-sargun@sargun.me>
Hi,
On Sat, May 01, 2021 at 05:18:50PM -0700, Sargun Dhillon wrote:
[snip]
> Other patches in this series add a way to block signals when a syscall
> is put to wait by seccomp.
I guess we can drop this bit from the message if the series is split.
> The struct seccomp_notif_resp, used when doing SECCOMP_IOCTL_NOTIF_SEND
> ioctl() to send a response to the target, has three more fields that we
> don't allow to set when doing the addfd ioctl() to also return. The
> reasons to disallow each field are:
> * val: This will be set to the new allocated fd. No point taking it
> from userspace in this case.
> * error: If this is non-zero, the value is ignored. Therefore,
> it is pointless in this case as we want to return the value.
> * flags: The only flag is to let userspace continue to execute the
> syscall. This seems pointless, as we want the syscall to return the
> allocated fd.
>
> This is why those fields are not possible to set when using this new
> flag.
I don't quite understand this; you don't need a NOTIF_SEND at all
with the way this currently works, right?
> @@ -1113,7 +1136,7 @@ static int seccomp_do_user_notification(int this_syscall,
> struct seccomp_kaddfd, list);
> /* Check if we were woken up by a addfd message */
> if (addfd)
> - seccomp_handle_addfd(addfd);
> + seccomp_handle_addfd(addfd, &n);
>
> } while (n.state != SECCOMP_NOTIFY_REPLIED);
>
This while() bit is introduced in the previous patch, can we fold this
deletion into that somehow?
Thanks,
Tycho
next prev parent reply other threads:[~2021-05-11 21:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-02 0:18 [PATCH 0/4] Atomic addfd send and reply Sargun Dhillon
2021-05-02 0:18 ` [PATCH 1/4] Documentation: seccomp: Fix user notification documentation Sargun Dhillon
2021-05-02 0:18 ` [PATCH 2/4] seccomp: Refactor notification handler to prepare for new semantics Sargun Dhillon
2021-05-02 0:18 ` [PATCH 3/4] seccomp: Support atomic "addfd + send reply" Sargun Dhillon
2021-05-11 21:50 ` Tycho Andersen [this message]
2021-05-17 17:53 ` Sargun Dhillon
2021-05-17 18:10 ` Tycho Andersen
2021-05-02 0:18 ` [PATCH 4/4] selftests/seccomp: Add test for atomic addfd+send Sargun Dhillon
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=20210511215010.GB1964106@cisco \
--to=tycho@tycho.pizza \
--cc=christian.brauner@ubuntu.com \
--cc=containers@lists.linux.dev \
--cc=gscrivan@redhat.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mauricio@kinvolk.io \
--cc=mic@linux.microsoft.com \
--cc=rodrigo@kinvolk.io \
--cc=sargun@sargun.me \
/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