bisecting fixing commit since 0adb32858b0bddf4ada5f364a84ed60b196dbcda building syzkaller on dc88925771c47ef787f6f3a7b6756b8f0ce40af5 testing commit 0adb32858b0bddf4ada5f364a84ed60b196dbcda with gcc (GCC) 8.1.0 kernel signature: c122f5ff0d60f951734f19d2aceacf6aa3a903708c6fa1eaddff307c5cb6c8aa run #0: crashed: KASAN: use-after-free Read in ntfs_attr_find run #1: crashed: KASAN: slab-out-of-bounds Read in ntfs_attr_find run #2: crashed: KASAN: slab-out-of-bounds Read in ntfs_attr_find run #3: crashed: KASAN: use-after-free Read in ntfs_attr_find run #4: crashed: KASAN: slab-out-of-bounds Read in ntfs_attr_find run #5: crashed: KASAN: use-after-free Read in ntfs_attr_find run #6: crashed: KASAN: use-after-free Read in ntfs_attr_find run #7: crashed: KASAN: out-of-bounds Read in ntfs_attr_find run #8: crashed: KASAN: slab-out-of-bounds Read in ntfs_attr_find run #9: crashed: KASAN: use-after-free Read in ntfs_attr_find testing current HEAD 12bf0b632ed090358cbf03e323e5342212d0b2e4 testing commit 12bf0b632ed090358cbf03e323e5342212d0b2e4 with gcc (GCC) 8.1.0 kernel signature: 8f7bf0de40edb2a01bac1041a85095058226c80ee7fe497d1a301985b644bb8b run #0: crashed: KASAN: use-after-free Read in ntfs_attr_find run #1: crashed: KASAN: out-of-bounds Read in ntfs_attr_find run #2: crashed: KASAN: use-after-free Read in ntfs_attr_find run #3: crashed: KASAN: use-after-free Read in ntfs_attr_find run #4: crashed: KASAN: slab-out-of-bounds Read in ntfs_attr_find run #5: crashed: KASAN: use-after-free Read in ntfs_attr_find run #6: crashed: KASAN: slab-out-of-bounds Read in ntfs_attr_find run #7: crashed: KASAN: out-of-bounds Read in ntfs_attr_find run #8: crashed: KASAN: slab-out-of-bounds Read in ntfs_attr_find run #9: crashed: KASAN: use-after-free Read in ntfs_attr_find revisions tested: 2, total time: 15m54.043731053s (build: 9m1.64743683s, test: 6m7.082533806s) the crash still happens on HEAD commit msg: Merge tag 'nfs-for-5.7-5' of git://git.linux-nfs.org/projects/trondmy/linux-nfs crash: KASAN: use-after-free Read in ntfs_attr_find IPVS: ftp: loaded support on port[0] = 21 IPVS: ftp: loaded support on port[0] = 21 IPVS: ftp: loaded support on port[0] = 21 ntfs: (device loop4): is_boot_sector_ntfs(): Invalid end of sector marker. ================================================================== BUG: KASAN: use-after-free in ntfs_attr_find+0x9db/0xb00 fs/ntfs/attrib.c:599 Read of size 4 at addr ffff8881c8970d35 by task syz-executor4/3940 CPU: 0 PID: 3940 Comm: syz-executor4 Not tainted 5.7.0-rc5-syzkaller #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+0x12f/0x187 lib/dump_stack.c:118 ntfs: (device loop3): is_boot_sector_ntfs(): Invalid end of sector marker. print_address_description.constprop.8+0x3f/0x60 mm/kasan/report.c:382 __kasan_report.cold.11+0x23/0x3a mm/kasan/report.c:511 kasan_report+0x38/0x50 mm/kasan/common.c:625 __asan_report_load_n_noabort+0xf/0x20 mm/kasan/generic_report.c:156 ntfs_attr_find+0x9db/0xb00 fs/ntfs/attrib.c:599 ntfs_external_attr_find fs/ntfs/attrib.c:1093 [inline] ntfs_attr_lookup+0x10c9/0x23c0 fs/ntfs/attrib.c:1191 ntfs_read_inode_mount+0x6c2/0x21b0 fs/ntfs/inode.c:1832 ntfs_fill_super+0x1217/0x2d40 fs/ntfs/super.c:2857 mount_bdev+0x27b/0x340 fs/super.c:1417 ntfs_mount+0x10/0x20 fs/ntfs/super.c:3051 legacy_get_tree+0x103/0x1f0 fs/fs_context.c:622 vfs_get_tree+0x8b/0x2d0 fs/super.c:1547 do_new_mount fs/namespace.c:2816 [inline] do_mount+0x1287/0x1c30 fs/namespace.c:3141 __do_sys_mount fs/namespace.c:3350 [inline] __se_sys_mount fs/namespace.c:3327 [inline] __x64_sys_mount+0x169/0x1c0 fs/namespace.c:3327 do_syscall_64+0xd0/0x630 arch/x86/entry/common.c:295 entry_SYSCALL_64_after_hwframe+0x49/0xb3 RIP: 0033:0x457dea Code: b8 a6 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 dd 8f fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 0f 83 ba 8f fb ff c3 66 0f 1f 84 00 00 00 00 00 RSP: 002b:00007f98b5d67bb8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 0000000020000000 RCX: 0000000000457dea RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007f98b5d67c00 RBP: 0000000000000002 R08: 000000002007e200 R09: 0000000020000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000003 R13: 000000000000066c R14: 00000000006fbac0 R15: 0000000000000000 Allocated by task 3823: save_stack+0x21/0x50 mm/kasan/common.c:49 set_track mm/kasan/common.c:57 [inline] __kasan_kmalloc.constprop.7+0xc1/0xd0 mm/kasan/common.c:495 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:509 kmem_cache_alloc_trace+0x15b/0x770 mm/slab.c:3551 kmalloc include/linux/slab.h:555 [inline] kzalloc include/linux/slab.h:669 [inline] kobject_uevent_env+0x1c5/0xea0 lib/kobject_uevent.c:523 kobject_uevent+0xb/0x10 lib/kobject_uevent.c:641 device_add+0xad3/0x1ba0 drivers/base/core.c:2508 netdev_register_kobject+0x16a/0x360 net/core/net-sysfs.c:1857 register_netdevice+0x95f/0x1060 net/core/dev.c:9394 register_netdev+0x19/0x30 net/core/dev.c:9518 ip6_tnl_init_net+0x42c/0x6b0 net/ipv6/ip6_tunnel.c:2273 ops_init+0x98/0x380 net/core/net_namespace.c:151 setup_net+0x2e7/0x7e0 net/core/net_namespace.c:341 copy_net_ns+0x25b/0x4a0 net/core/net_namespace.c:482 create_new_namespaces+0x494/0x950 kernel/nsproxy.c:108 unshare_nsproxy_namespaces+0x87/0x1a0 kernel/nsproxy.c:229 ksys_unshare+0x324/0x6f0 kernel/fork.c:2970 __do_sys_unshare kernel/fork.c:3038 [inline] __se_sys_unshare kernel/fork.c:3036 [inline] __x64_sys_unshare+0x2c/0x40 kernel/fork.c:3036 do_syscall_64+0xd0/0x630 arch/x86/entry/common.c:295 entry_SYSCALL_64_after_hwframe+0x49/0xb3 Freed by task 3823: save_stack+0x21/0x50 mm/kasan/common.c:49 set_track mm/kasan/common.c:57 [inline] kasan_set_free_info mm/kasan/common.c:317 [inline] __kasan_slab_free+0x11a/0x170 mm/kasan/common.c:456 kasan_slab_free+0xe/0x10 mm/kasan/common.c:465 __cache_free mm/slab.c:3426 [inline] kfree+0xfa/0x290 mm/slab.c:3757 kobject_uevent_env+0x23a/0xea0 lib/kobject_uevent.c:625 kobject_uevent+0xb/0x10 lib/kobject_uevent.c:641 device_add+0xad3/0x1ba0 drivers/base/core.c:2508 netdev_register_kobject+0x16a/0x360 net/core/net-sysfs.c:1857 register_netdevice+0x95f/0x1060 net/core/dev.c:9394 register_netdev+0x19/0x30 net/core/dev.c:9518 ip6_tnl_init_net+0x42c/0x6b0 net/ipv6/ip6_tunnel.c:2273 ops_init+0x98/0x380 net/core/net_namespace.c:151 setup_net+0x2e7/0x7e0 net/core/net_namespace.c:341 copy_net_ns+0x25b/0x4a0 net/core/net_namespace.c:482 create_new_namespaces+0x494/0x950 kernel/nsproxy.c:108 unshare_nsproxy_namespaces+0x87/0x1a0 kernel/nsproxy.c:229 ksys_unshare+0x324/0x6f0 kernel/fork.c:2970 __do_sys_unshare kernel/fork.c:3038 [inline] __se_sys_unshare kernel/fork.c:3036 [inline] __x64_sys_unshare+0x2c/0x40 kernel/fork.c:3036 do_syscall_64+0xd0/0x630 arch/x86/entry/common.c:295 entry_SYSCALL_64_after_hwframe+0x49/0xb3 The buggy address belongs to the object at ffff8881c8970000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 3381 bytes inside of 4096-byte region [ffff8881c8970000, ffff8881c8971000) The buggy address belongs to the page: page:ffffea0007225c00 refcount:1 mapcount:0 mapping:00000000eaee01d3 index:0x0 head:ffffea0007225c00 order:1 compound_mapcount:0 flags: 0x2fffc0000010200(slab|head) raw: 02fffc0000010200 ffffea0007223a08 ffffea000726db08 ffff8881da002000 raw: 0000000000000000 ffff8881c8970000 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881c8970c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881c8970c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8881c8970d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881c8970d80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881c8970e00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================