From d646e21ff436cd2a40b23314436cd53f21ae9500 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sun, 5 Jan 2020 12:44:49 +0100 Subject: prog: fix tests for string enforcement String value enforcement broke a number of tests where we use different values. Be more string as to what string values we use in tests. Required to add tmpfs descriptions to test syz_mount_image. Also special-casing AF_ALG algorithms as these are auto-generated. --- sys/linux/test/binder | 4 ++-- sys/linux/test/nonexec0 | 8 -------- sys/linux/test/nonexec1 | 7 ------- sys/linux/test/syz_mount_image | 4 ++-- 4 files changed, 4 insertions(+), 19 deletions(-) delete mode 100644 sys/linux/test/nonexec0 delete mode 100644 sys/linux/test/nonexec1 (limited to 'sys/linux/test') diff --git a/sys/linux/test/binder b/sys/linux/test/binder index 18f1aece7..8805d2deb 100644 --- a/sys/linux/test/binder +++ b/sys/linux/test/binder @@ -1,6 +1,6 @@ -r0 = syz_open_dev$binder(&AUTO='/dev/binder#\x00', 0x0, 0x2) +r0 = syz_open_dev$binderN(&AUTO='/dev/binder#\x00', 0x0, 0x2) ioctl$BINDER_SET_CONTEXT_MGR_EXT(r0, AUTO, &AUTO={AUTO, 0x100, 0x0, 0x0}) mmap$binder(&(0x7f00000a0000), 0x2000, 0x1, 0x11, r0, 0x0) -r1 = syz_open_dev$binder(&AUTO='/dev/binder#\x00', 0x0, 0x2) +r1 = syz_open_dev$binderN(&AUTO='/dev/binder#\x00', 0x0, 0x2) mmap$binder(&(0x7f00000c0000), 0x2000, 0x1, 0x11, r1, 0x0) ioctl$BINDER_WRITE_READ(r1, AUTO, &AUTO={AUTO, AUTO, &AUTO=[@transaction_sg={AUTO, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, AUTO, AUTO, &AUTO={@flat=@binder={AUTO, 0x0, 0x0, 0x0}, @fd={AUTO, AUTO, r0, AUTO, 0x0}, @ptr={AUTO, 0x0, &AUTO=""/10, AUTO, 0x0, 0x0}}, &AUTO={AUTO, AUTO, AUTO}}, 0x10}], AUTO, AUTO, &AUTO}) diff --git a/sys/linux/test/nonexec0 b/sys/linux/test/nonexec0 deleted file mode 100644 index d4ce3ba4f..000000000 --- a/sys/linux/test/nonexec0 +++ /dev/null @@ -1,8 +0,0 @@ -# This makes syz-executor non-executable. -# Does not work with repeat because on the second iteration the executor is still non-executable. -# setuid does not have permissions to set extended acl. -# FS_IOC_FSSETXATTR fails with EOPNOTSUPP, but it still changes the attrs. -# requires: -repeat -sandbox=setuid - -r0 = syz_open_procfs(0x0, &AUTO='exe\x00') -fsetxattr$system_posix_acl(r0, &AUTO='system.posix_acl_access\x00', &AUTO={{AUTO}, {0x1, 0x2, AUTO}, [{AUTO, 0x0, 0x0}, {0x2, 0x4, 0x0}], {AUTO, 0x0, AUTO}, [], {0x10, 0x2, AUTO}, {AUTO, 0x0, AUTO}}, 0x34, 0x0) # EOPNOTSUPP diff --git a/sys/linux/test/nonexec1 b/sys/linux/test/nonexec1 deleted file mode 100644 index 324e704b5..000000000 --- a/sys/linux/test/nonexec1 +++ /dev/null @@ -1,7 +0,0 @@ -# This makes syz-executor non-executable. -# sandbox=namespace does not have permissions for FS_IOC_FSSETXATTR. -# requires: -repeat -sandbox=namespace -sandbox=setuid - -r0 = syz_open_procfs(0x0, &AUTO='exe\x00') -fsetxattr$system_posix_acl(r0, &AUTO='system.posix_acl_access\x00', &AUTO={{AUTO}, {0x1, 0x2, AUTO}, [{AUTO, 0x0, 0x0}, {0x2, 0x4, 0x0}], {AUTO, 0x0, AUTO}, [], {0x10, 0x2, AUTO}, {AUTO, 0x0, AUTO}}, 0x34, 0x0) # EOPNOTSUPP -ioctl$FS_IOC_FSSETXATTR(r0, 0x40086602, &AUTO={0x17e, 0x0, 0x0, 0x0, 0x0, [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0]}) # ENOTTY diff --git a/sys/linux/test/syz_mount_image b/sys/linux/test/syz_mount_image index 53f40022b..e4afeb00f 100644 --- a/sys/linux/test/syz_mount_image +++ b/sys/linux/test/syz_mount_image @@ -1,2 +1,2 @@ -syz_mount_image$ext4(&(0x7f0000000000)='tmpfs\x00', &(0x7f0000000100)='./file0\x00', 0x0, 0x0, 0x0, 0x0, 0x0) -syz_mount_image$ext4(&(0x7f0000000000)='tmpfs\x00', &(0x7f0000000100)='./file0\x00', 0x0, 0x1, 0x0, 0x0, 0x0) +syz_mount_image$tmpfs(&(0x7f0000000000)='tmpfs\x00', &(0x7f0000000100)='./file0\x00', 0x0, 0x0, 0x0, 0x0, 0x0) +syz_mount_image$tmpfs(&(0x7f0000000000)='tmpfs\x00', &(0x7f0000000100)='./file0\x00', 0x0, 0x1, 0x0, 0x0, 0x0) -- cgit mrf-deployment