aboutsummaryrefslogtreecommitdiffstats
path: root/sys/linux/test
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2024-09-18 17:38:12 +0200
committerDmitry Vyukov <dvyukov@google.com>2024-09-19 08:37:17 +0000
commit52c1f8045c38bcce0229b2cc3c69b1cbe21eb629 (patch)
tree6795b28e4d5cf644369433d5e1906fbf1bfe7e1b /sys/linux/test
parent6d197301fe4a048a54f3203599963947b6563bd9 (diff)
sys/linux: add syz_create_resource
syz_create_resource allows to turn any value into a resource. Improve binfmt descriptions using syz_create_resource: we need to pass the same file name to write syscalls and execve. Use syz_create_resource to improve binfmt descriptions.
Diffstat (limited to 'sys/linux/test')
-rw-r--r--sys/linux/test/binfmt15
1 files changed, 8 insertions, 7 deletions
diff --git a/sys/linux/test/binfmt b/sys/linux/test/binfmt
index 8998c6226..617d75cfe 100644
--- a/sys/linux/test/binfmt
+++ b/sys/linux/test/binfmt
@@ -1,16 +1,17 @@
# Tests for binfmt_misc.
# Executor setups binfmt_misc with ./file0 interpreter for files with byte 0x01 at offset 0.
-execveat(0xffffffffffffff9c, &AUTO='./file1\x00', &AUTO=[0x0], &AUTO=[0x0], 0x0) # ENOENT
-r0 = openat(0xffffffffffffff9c, &AUTO='./file1\x00', 0x42, 0x1ff)
+r3 = syz_create_resource$binfmt(&AUTO='./file1\x00')
+execveat$binfmt(0xffffffffffffff9c, r3, &AUTO={[], 0x0}, &AUTO={[], 0x0}, 0x0) # ENOENT
+r0 = openat$binfmt(0xffffffffffffff9c, r3, 0x42, 0x1ff)
close(r0)
-execveat(0xffffffffffffff9c, &AUTO='./file1\x00', &AUTO=[0x0], &AUTO=[0x0], 0x0) # ENOEXEC
-r1 = openat(0xffffffffffffff9c, &AUTO='./file1\x00', 0x2, 0x0)
+execveat$binfmt(0xffffffffffffff9c, r3, &AUTO={[], 0x0}, &AUTO={[], 0x0}, 0x0) # ENOEXEC
+r1 = openat$binfmt(0xffffffffffffff9c, r3, 0x2, 0x0)
write(r1, &AUTO="01010101", 0x4)
close(r1)
-execveat(0xffffffffffffff9c, &AUTO='./file1\x00', &AUTO=[0x0], &AUTO=[0x0], 0x0) # ENOENT
+execveat$binfmt(0xffffffffffffff9c, r3, &AUTO={[], 0x0}, &AUTO={[], 0x0}, 0x0) # ENOENT
r2 = openat(0xffffffffffffff9c, &AUTO='./file0\x00', 0x42, 0x0)
close(r2)
-execveat(0xffffffffffffff9c, &AUTO='./file1\x00', &AUTO=[0x0], &AUTO=[0x0], 0x0) # EACCES
+execveat$binfmt(0xffffffffffffff9c, r3, &AUTO={[], 0x0}, &AUTO={[], 0x0}, 0x0) # EACCES
fchmodat(0xffffffffffffff9c, &AUTO='./file0\x00', 0x1ff)
-execveat(0xffffffffffffff9c, &AUTO='./file1\x00', &AUTO=[0x0], &AUTO=[0x0], 0x0) # ENOEXEC
+execveat$binfmt(0xffffffffffffff9c, r3, &AUTO={[], 0x0}, &AUTO={[], 0x0}, 0x0) # ENOEXEC