Skip to content

Commit 647091d

Browse files
l0koda-nogikh
authored andcommitted
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>
1 parent 7e392eb commit 647091d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

sys/linux/test/landlock_fs_ioctl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Makes a regular file.
1+
# Makes a character device /dev/null
22

3-
mknodat(0xffffffffffffff9c, &AUTO='./file0\x00', 0x81c0, 0x0)
3+
mknodat(0xffffffffffffff9c, &AUTO='./file0\x00', 0x21c0, 0x103)
44

55
# Creates a ruleset to restrict most filesystem IOCTLs: LANDLOCK_ACCESS_FS_IOCTL_DEV.
66

@@ -17,9 +17,9 @@ landlock_restrict_self(r0, 0x0)
1717

1818
r1 = openat$dir(0xffffffffffffff9c, &AUTO='./file0\x00', 0x2, 0x0)
1919

20-
# Denied FIOQSIZE IOCTL.
20+
# Denied FIONREAD (not really but same value) IOCTL.
2121

22-
ioctl(r1, 0x5460, 0x0) # EACCES
22+
ioctl(r1, 0x541b, 0x0) # EACCES
2323

2424
# Allowed FIOCLEX IOCTL.
2525

0 commit comments

Comments
 (0)