From 647091d604f00b9292bdd7fbc96b55bdfa2bcf52 Mon Sep 17 00:00:00 2001 From: Mickaël Salaün Date: Tue, 8 Jul 2025 12:20:25 +0200 Subject: sys/linux/test: fix landlock_fs_ioctl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- sys/linux/test/landlock_fs_ioctl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sys/linux/test') 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. -- cgit mrf-deployment