bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Sven Schnelle <svens@linux.ibm.com>
Cc: Andy Lutomirski <luto@amacapital.net>,
	Will Drewry <wad@chromium.org>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Martin KaFai Lau <kafai@fb.com>, Song Liu <songliubraving@fb.com>,
	Yonghong Song <yhs@fb.com>, Andrii Nakryiko <andriin@fb.com>,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	bpf@vger.kernel.org
Subject: Re: [PATCH] seccomp: add compat_ioctl for seccomp notify
Date: Wed, 11 Mar 2020 13:06:33 -0700	[thread overview]
Message-ID: <202003111305.87B2A84A@keescook> (raw)
In-Reply-To: <20200310123332.42255-1-svens@linux.ibm.com>

On Tue, Mar 10, 2020 at 01:33:32PM +0100, Sven Schnelle wrote:
> Hi,
> 
> executing the seccomp_bpf testsuite with 32 bit userland (both s390 and x86)
> doesn't work because there's no compat_ioctl handler defined. Is that something
> that is supposed to work? Disclaimer: I don't know enough about seccomp to judge
> whether there would be some adjustments required in the compat ioctl handler.
> Just setting it to seccomp_notify_ioctl() makes the testsuite pass, but i'm not
> sure whether that's correct.
> 
> Signed-off-by: Sven Schnelle <svens@linux.ibm.com>

Whoops! Yes, running a mixed environment (64-bit kernel and 32-bit
userspace) shows this as broken. I'll tweak the commit log a bit and
apply it. Thanks!

-Kees

> ---
>  kernel/seccomp.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/kernel/seccomp.c b/kernel/seccomp.c
> index b6ea3dcb57bf..683c81e4861e 100644
> --- a/kernel/seccomp.c
> +++ b/kernel/seccomp.c
> @@ -1221,6 +1221,7 @@ static const struct file_operations seccomp_notify_ops = {
>  	.poll = seccomp_notify_poll,
>  	.release = seccomp_notify_release,
>  	.unlocked_ioctl = seccomp_notify_ioctl,
> +	.compat_ioctl = seccomp_notify_ioctl,
>  };
>  
>  static struct file *init_listener(struct seccomp_filter *filter)
> -- 
> 2.17.1
> 

-- 
Kees Cook

      reply	other threads:[~2020-03-11 20:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-10 12:33 [PATCH] seccomp: add compat_ioctl for seccomp notify Sven Schnelle
2020-03-11 20:06 ` Kees Cook [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=202003111305.87B2A84A@keescook \
    --to=keescook@chromium.org \
    --cc=andriin@fb.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kafai@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=netdev@vger.kernel.org \
    --cc=songliubraving@fb.com \
    --cc=svens@linux.ibm.com \
    --cc=wad@chromium.org \
    --cc=yhs@fb.com \
    /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).