bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] seccomp: add compat_ioctl for seccomp notify
@ 2020-03-10 12:33 Sven Schnelle
  2020-03-11 20:06 ` Kees Cook
  0 siblings, 1 reply; 2+ messages in thread
From: Sven Schnelle @ 2020-03-10 12:33 UTC (permalink / raw)
  To: Kees Cook, Andy Lutomirski, Will Drewry, Alexei Starovoitov,
	Daniel Borkmann, Martin KaFai Lau, Song Liu, Yonghong Song,
	Andrii Nakryiko, linux-kernel, netdev, bpf

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>
---
 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] seccomp: add compat_ioctl for seccomp notify
  2020-03-10 12:33 [PATCH] seccomp: add compat_ioctl for seccomp notify Sven Schnelle
@ 2020-03-11 20:06 ` Kees Cook
  0 siblings, 0 replies; 2+ messages in thread
From: Kees Cook @ 2020-03-11 20:06 UTC (permalink / raw)
  To: Sven Schnelle
  Cc: Andy Lutomirski, Will Drewry, Alexei Starovoitov,
	Daniel Borkmann, Martin KaFai Lau, Song Liu, Yonghong Song,
	Andrii Nakryiko, linux-kernel, netdev, bpf

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-03-11 20:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-10 12:33 [PATCH] seccomp: add compat_ioctl for seccomp notify Sven Schnelle
2020-03-11 20:06 ` Kees Cook

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).