Skip to contentSkip to conversation

seccomp: add compat_ioctl for seccomp notify

PATCH In review Sven Schnelle 2 participants 2 messages Mar 10, 2020 – Mar 11, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 seccomp: add compat_ioctl for seccomp notify

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.

---
 kernel/seccomp.c | 1 +
 1 file changed, 1 insertion(+)
kernel/seccomp.c +1 -0
index b6ea3dcb57bf..683c81e4861e 100644
@@ -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)
Signature · 1 line
2.17.1
#1 lore raw
Quoted 10 lines · Sven Schnelle

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.

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

Quoted 19 lines
---
 kernel/seccomp.c | 1 +
 1 file changed, 1 insertion(+)
kernel/seccomp.c +1 -0
index b6ea3dcb57bf..683c81e4861e 100644
@@ -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)
Signature · 1 line
2.17.1
Signature · 1 line
Kees Cook