aboutsummaryrefslogtreecommitdiffstats
path: root/sys/linux
diff options
context:
space:
mode:
authorMickaël Salaün <mic@linux.microsoft.com>2025-07-08 12:20:25 +0200
committerAleksandr Nogikh <nogikh@google.com>2025-07-09 10:22:52 +0000
commit647091d604f00b9292bdd7fbc96b55bdfa2bcf52 (patch)
tree3f1faa3d87b982fce52bf9560dbd79d9c00492c2 /sys/linux
parent7e392eba1e0e0ec74b66df31e942dd13d4682c78 (diff)
sys/linux/test: fix landlock_fs_ioctl
When running syz-manager with -mode run-tests --tests landlock_fs_ioctl -debug we get this result: #0 [1300ms] -> ioctl(0x4, 0x5460, 0x0) #0 [1300ms] <- ioctl=0xffffffffffffffff errno=14 #0 [1300ms] -> ioctl(0x4, 0x5451, 0x0) #0 [1300ms] <- ioctl=0x0 [...] landlock_fs_ioctl none : FAIL: run 0: wrong call 5 result 14, want 13 The ioctl call returns EFAULT instead of EACCES. Change this test to create a /dev/null device and use a valid device IOCTL. Signed-off-by: Mickaël Salaün <mic@linux.microsoft.com>
Diffstat (limited to 'sys/linux')
-rw-r--r--sys/linux/test/landlock_fs_ioctl8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/linux/test/landlock_fs_ioctl b/sys/linux/test/landlock_fs_ioctl
index 2c2549347..5ac482216 100644
--- a/sys/linux/test/landlock_fs_ioctl
+++ b/sys/linux/test/landlock_fs_ioctl
@@ -1,6 +1,6 @@
-# Makes a regular file.
+# Makes a character device /dev/null
-mknodat(0xffffffffffffff9c, &AUTO='./file0\x00', 0x81c0, 0x0)
+mknodat(0xffffffffffffff9c, &AUTO='./file0\x00', 0x21c0, 0x103)
# Creates a ruleset to restrict most filesystem IOCTLs: LANDLOCK_ACCESS_FS_IOCTL_DEV.
@@ -17,9 +17,9 @@ landlock_restrict_self(r0, 0x0)
r1 = openat$dir(0xffffffffffffff9c, &AUTO='./file0\x00', 0x2, 0x0)
-# Denied FIOQSIZE IOCTL.
+# Denied FIONREAD (not really but same value) IOCTL.
-ioctl(r1, 0x5460, 0x0) # EACCES
+ioctl(r1, 0x541b, 0x0) # EACCES
# Allowed FIOCLEX IOCTL.