bisecting cause commit starting from 283ea345934d277e30c841c577e0e2142b4bfcae building syzkaller on 8c88c9c1c99c8cd8dabc951164c820b9c9f25114 testing commit 283ea345934d277e30c841c577e0e2142b4bfcae with gcc (GCC) 8.1.0 all runs: crashed: KASAN: use-after-free Read in fuse_request_end testing release v5.3 testing commit 4d856f72c10ecb060868ed10ff1b1453943fc6c8 with gcc (GCC) 8.1.0 all runs: OK # git bisect start 283ea345934d277e30c841c577e0e2142b4bfcae v5.3 Bisecting: 6646 revisions left to test after this (roughly 13 steps) [81160dda9a7aad13c04e78bb2cfd3c4630e3afab] Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next testing commit 81160dda9a7aad13c04e78bb2cfd3c4630e3afab with gcc (GCC) 8.1.0 all runs: OK # git bisect good 81160dda9a7aad13c04e78bb2cfd3c4630e3afab Bisecting: 3305 revisions left to test after this (roughly 12 steps) [a703d279c57e1bfe2b6536c3a17c1c498b416d24] Merge tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux testing commit a703d279c57e1bfe2b6536c3a17c1c498b416d24 with gcc (GCC) 8.1.0 all runs: OK # git bisect good a703d279c57e1bfe2b6536c3a17c1c498b416d24 Bisecting: 1652 revisions left to test after this (roughly 11 steps) [cc22c800e15b03c87f0e97400f75eba998e75c6a] ntfs: remove (un)?likely() from IS_ERR() conditions testing commit cc22c800e15b03c87f0e97400f75eba998e75c6a with gcc (GCC) 8.1.0 all runs: OK # git bisect good cc22c800e15b03c87f0e97400f75eba998e75c6a Bisecting: 826 revisions left to test after this (roughly 10 steps) [8c7138b33e5c690c308b2a7085f6313fdcb3f616] net: Unpublish sk from sk_reuseport_cb before call_rcu testing commit 8c7138b33e5c690c308b2a7085f6313fdcb3f616 with gcc (GCC) 8.1.0 all runs: crashed: KASAN: use-after-free Read in fuse_request_end # git bisect bad 8c7138b33e5c690c308b2a7085f6313fdcb3f616 Bisecting: 416 revisions left to test after this (roughly 9 steps) [7bccb9f10c8f36ee791769b531ed4d28f6379aae] Merge tag 'linux-watchdog-5.4-rc1' of git://www.linux-watchdog.org/linux-watchdog testing commit 7bccb9f10c8f36ee791769b531ed4d28f6379aae with gcc (GCC) 8.1.0 all runs: crashed: KASAN: use-after-free Read in fuse_request_end # git bisect bad 7bccb9f10c8f36ee791769b531ed4d28f6379aae Bisecting: 210 revisions left to test after this (roughly 8 steps) [7897c04ad09f815aea1f2dbb05825887d4494a74] Merge tag 'trace-v5.4-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace testing commit 7897c04ad09f815aea1f2dbb05825887d4494a74 with gcc (GCC) 8.1.0 all runs: crashed: KASAN: use-after-free Read in fuse_request_end # git bisect bad 7897c04ad09f815aea1f2dbb05825887d4494a74 Bisecting: 89 revisions left to test after this (roughly 7 steps) [f41def397161053eb0d3ed6861ef65985efbf293] Merge tag 'ceph-for-5.4-rc1' of git://github.com/ceph/ceph-client testing commit f41def397161053eb0d3ed6861ef65985efbf293 with gcc (GCC) 8.1.0 all runs: crashed: KASAN: use-after-free Read in fuse_request_end # git bisect bad f41def397161053eb0d3ed6861ef65985efbf293 Bisecting: 53 revisions left to test after this (roughly 6 steps) [e5854b1cdf6cb48a20e01e3bdad0476a4c60a077] fuse: fix beyond-end-of-page access in fuse_parse_cache() testing commit e5854b1cdf6cb48a20e01e3bdad0476a4c60a077 with gcc (GCC) 8.1.0 all runs: crashed: KASAN: use-after-free Read in fuse_request_end # git bisect bad e5854b1cdf6cb48a20e01e3bdad0476a4c60a077 Bisecting: 26 revisions left to test after this (roughly 5 steps) [33826ebbbe4b45ccecf2f5a08b3457f5d59c6282] fuse: convert writepages to simple api testing commit 33826ebbbe4b45ccecf2f5a08b3457f5d59c6282 with gcc (GCC) 8.1.0 all runs: OK # git bisect good 33826ebbbe4b45ccecf2f5a08b3457f5d59c6282 Bisecting: 13 revisions left to test after this (roughly 4 steps) [95a84cdb11c26315a6d34664846f82c438c961a1] fuse: export fuse_send_init_request() testing commit 95a84cdb11c26315a6d34664846f82c438c961a1 with gcc (GCC) 8.1.0 all runs: crashed: KASAN: use-after-free Read in fuse_request_end # git bisect bad 95a84cdb11c26315a6d34664846f82c438c961a1 Bisecting: 6 revisions left to test after this (roughly 3 steps) [7213394c4e184b002d8011c13d916e7ac6d17520] fuse: simplify request allocation testing commit 7213394c4e184b002d8011c13d916e7ac6d17520 with gcc (GCC) 8.1.0 all runs: OK # git bisect good 7213394c4e184b002d8011c13d916e7ac6d17520 Bisecting: 3 revisions left to test after this (roughly 2 steps) [05ea48cc2b098c533193bb058b82aa016a8361bc] fuse: stop copying pages to fuse_req testing commit 05ea48cc2b098c533193bb058b82aa016a8361bc with gcc (GCC) 8.1.0 all runs: crashed: KASAN: use-after-free Read in request_end # git bisect bad 05ea48cc2b098c533193bb058b82aa016a8361bc Bisecting: 0 revisions left to test after this (roughly 1 step) [d49937749fef2597f6bcaf2a0ed67e88e347b7fb] fuse: stop copying args to fuse_req testing commit d49937749fef2597f6bcaf2a0ed67e88e347b7fb with gcc (GCC) 8.1.0 all runs: crashed: KASAN: use-after-free Read in request_end # git bisect bad d49937749fef2597f6bcaf2a0ed67e88e347b7fb Bisecting: 0 revisions left to test after this (roughly 0 steps) [145b673bd208af97b2f98572f286111ab8e7bc59] fuse: clean up fuse_req testing commit 145b673bd208af97b2f98572f286111ab8e7bc59 with gcc (GCC) 8.1.0 all runs: OK # git bisect good 145b673bd208af97b2f98572f286111ab8e7bc59 d49937749fef2597f6bcaf2a0ed67e88e347b7fb is the first bad commit commit d49937749fef2597f6bcaf2a0ed67e88e347b7fb Author: Miklos Szeredi Date: Tue Sep 10 15:04:11 2019 +0200 fuse: stop copying args to fuse_req No need to duplicate the argument arrays in fuse_req, so just dereference req->args instead of copying to the fuse_req internal ones. This allows further cleanup of the fuse_req structure. Signed-off-by: Miklos Szeredi :040000 040000 67bc47ea7133fd2860baa403f55f46fe5156f6be 4a67bebc5795c933e1499a9fd469e1e32315f255 M fs revisions tested: 16, total time: 3h31m25.864636336s (build: 1h33m10.398195678s, test: 1h53m6.708744217s) first bad commit: d49937749fef2597f6bcaf2a0ed67e88e347b7fb fuse: stop copying args to fuse_req cc: ["linux-fsdevel@vger.kernel.org" "linux-kernel@vger.kernel.org" "miklos@szeredi.hu" "mszeredi@redhat.com"] crash: KASAN: use-after-free Read in request_end ================================================================== BUG: KASAN: use-after-free in request_end+0x72a/0x910 fs/fuse/dev.c:261 Read of size 8 at addr ffff8880a08d1068 by task syz-executor.2/22404 CPU: 1 PID: 22404 Comm: syz-executor.2 Not tainted 5.3.0-rc6+ #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x113/0x167 lib/dump_stack.c:113 print_address_description.cold.8+0x9/0x318 mm/kasan/report.c:351 __kasan_report.cold.9+0x1b/0x3f mm/kasan/report.c:482 kasan_report+0x12/0x17 mm/kasan/common.c:618 __asan_report_load8_noabort+0x14/0x20 mm/kasan/generic_report.c:132 request_end+0x72a/0x910 fs/fuse/dev.c:261 fuse_dev_do_read.isra.27+0xf20/0x1c40 fs/fuse/dev.c:1284 fuse_dev_read+0x138/0x1c0 fs/fuse/dev.c:1317 call_read_iter include/linux/fs.h:1864 [inline] new_sync_read+0x3fa/0x7d0 fs/read_write.c:414 __vfs_read+0x94/0x110 fs/read_write.c:427 vfs_read+0x12e/0x330 fs/read_write.c:461 ksys_read+0x105/0x220 fs/read_write.c:587 __do_sys_read fs/read_write.c:597 [inline] __se_sys_read fs/read_write.c:595 [inline] __x64_sys_read+0x6e/0xb0 fs/read_write.c:595 do_syscall_64+0xd0/0x540 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x459a59 Code: fd b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 cb b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007feddc56dc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000000 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000459a59 RDX: 00000000fffffed0 RSI: 00000000200030c0 RDI: 0000000000000003 RBP: 000000000075bfc8 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007feddc56e6d4 R13: 00000000004c70e6 R14: 00000000004dca70 R15: 00000000ffffffff Allocated by task 22404: save_stack+0x21/0x90 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] __kasan_kmalloc.constprop.9+0xc7/0xd0 mm/kasan/common.c:493 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:507 kmem_cache_alloc_trace+0x15b/0x780 mm/slab.c:3550 kmalloc include/linux/slab.h:552 [inline] kzalloc include/linux/slab.h:748 [inline] fuse_send_init fs/fuse/inode.c:976 [inline] fuse_fill_super+0xeed/0x1720 fs/fuse/inode.c:1221 vfs_get_super+0x10b/0x200 fs/super.c:1183 get_tree_nodev+0x11/0x20 fs/super.c:1202 fuse_get_tree+0x9a/0xd0 fs/fuse/inode.c:1252 vfs_get_tree+0x86/0x2c0 fs/super.c:1517 do_new_mount fs/namespace.c:2789 [inline] do_mount+0x564/0x1ab0 fs/namespace.c:3109 ksys_mount+0xba/0xe0 fs/namespace.c:3318 __do_sys_mount fs/namespace.c:3332 [inline] __se_sys_mount fs/namespace.c:3329 [inline] __x64_sys_mount+0xb9/0x150 fs/namespace.c:3329 do_syscall_64+0xd0/0x540 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 22392: save_stack+0x21/0x90 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:455 kasan_slab_free+0xe/0x10 mm/kasan/common.c:463 __cache_free mm/slab.c:3425 [inline] kfree+0x108/0x2c0 mm/slab.c:3756 process_init_reply+0xc8/0x1560 fs/fuse/inode.c:966 request_end+0x2d6/0x910 fs/fuse/dev.c:308 end_requests+0x13c/0x220 fs/fuse/dev.c:2038 fuse_abort_conn+0x961/0xec0 fs/fuse/dev.c:2133 fuse_sb_destroy+0x7e/0xf0 fs/fuse/inode.c:1293 fuse_kill_sb_anon+0xd/0x20 fs/fuse/inode.c:1304 deactivate_locked_super+0x77/0xd0 fs/super.c:331 deactivate_super+0x136/0x150 fs/super.c:362 cleanup_mnt+0x204/0x440 fs/namespace.c:1102 __cleanup_mnt+0xd/0x10 fs/namespace.c:1109 task_work_run+0x108/0x180 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_usermode_loop+0x24e/0x2e0 arch/x86/entry/common.c:163 prepare_exit_to_usermode arch/x86/entry/common.c:194 [inline] syscall_return_slowpath arch/x86/entry/common.c:274 [inline] do_syscall_64+0x462/0x540 arch/x86/entry/common.c:299 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8880a08d1000 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 104 bytes inside of 192-byte region [ffff8880a08d1000, ffff8880a08d10c0) The buggy address belongs to the page: page:ffffea0002823440 refcount:1 mapcount:0 mapping:ffff8880aa400000 index:0x0 flags: 0x1fffc0000000200(slab) raw: 01fffc0000000200 ffffea000282d6c8 ffffea000282d288 ffff8880aa400000 raw: 0000000000000000 ffff8880a08d1000 0000000100000010 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a08d0f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880a08d0f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880a08d1000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880a08d1080: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff8880a08d1100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================