From 7c06bb218a06d171525a00367ecc50069b7163a8 Mon Sep 17 00:00:00 2001 From: Stefano Duo Date: Mon, 10 Aug 2020 13:07:06 +0000 Subject: sys/linux/test: add test performing getdents64() on FUSE dir Add syzkaller program which correctly handles a getdents64() syscall on a FUSE directory. Here the related comment/discussion https://github.com/google/syzkaller/pull/2001#issuecomment-671185292. --- sys/linux/test/fuse_getdents64 | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 sys/linux/test/fuse_getdents64 (limited to 'sys/linux/test') diff --git a/sys/linux/test/fuse_getdents64 b/sys/linux/test/fuse_getdents64 new file mode 100644 index 000000000..3ec2ee164 --- /dev/null +++ b/sys/linux/test/fuse_getdents64 @@ -0,0 +1,9 @@ +mkdirat(0xffffffffffffff9c, &AUTO='./file0\x00', 0x0) +r0 = openat$fuse(0xffffffffffffff9c, &AUTO='/dev/fuse\x00', 0x2, 0x0) +mount$fuse(0x0, &AUTO='./file0\x00', &AUTO='fuse\x00', 0x0, &AUTO={{'fd', 0x3d, r0}, 0x2c, {'rootmode', 0x3d, 0x4000}, 0x2c, {'user_id', 0x3d, 0x0}, 0x2c, {'group_id', 0x3d, 0x0}, 0x2c, {[], [], 0x0}}) +read$FUSE(r0, &AUTO={AUTO, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ""/8192}, AUTO) +write$FUSE_INIT(r0, &AUTO={AUTO, 0x0, r1, {AUTO, AUTO, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0]}}, AUTO) +r2 = openat$dir(0xffffffffffffff9c, &AUTO='./file0\x00', 0x0, 0x0) +syz_fuse_handle_req(r0, &AUTO=""/8192, AUTO, &AUTO={0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, &AUTO={AUTO, 0x0, 0x0, {0x0, 0x8, AUTO}}, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}) +getdents64(r2, &AUTO=""/1024, AUTO) +syz_fuse_handle_req(r0, &AUTO=""/8192, AUTO, &AUTO={0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, &AUTO={AUTO, 0x0, 0x0, [{0x0, 0x0, 0x4, 0x0, '#,,-'}]}, 0x0, 0x0, 0x0}) -- cgit mrf-deployment