================================================================== BUG: KASAN: slab-use-after-free in instrument_atomic_read_write include/linux/instrumented.h:96 [inline] BUG: KASAN: slab-use-after-free in test_and_set_bit include/asm-generic/bitops/instrumented-atomic.h:71 [inline] BUG: KASAN: slab-use-after-free in __fscache_relinquish_cookie+0x2a/0x650 fs/netfs/fscache_cookie.c:977 Write of size 8 at addr ffff88802b8d60f0 by task syz-executor.2/5639 CPU: 1 PID: 5639 Comm: syz-executor.2 Not tainted 6.8.0-syzkaller-11567-gb3603fcb79b1 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114 print_address_description mm/kasan/report.c:377 [inline] print_report+0xc3/0x620 mm/kasan/report.c:488 kasan_report+0xd9/0x110 mm/kasan/report.c:601 check_region_inline mm/kasan/generic.c:183 [inline] kasan_check_range+0xef/0x1a0 mm/kasan/generic.c:189 instrument_atomic_read_write include/linux/instrumented.h:96 [inline] test_and_set_bit include/asm-generic/bitops/instrumented-atomic.h:71 [inline] __fscache_relinquish_cookie+0x2a/0x650 fs/netfs/fscache_cookie.c:977 fscache_relinquish_cookie include/linux/fscache.h:308 [inline] v9fs_evict_inode+0x102/0x150 fs/9p/vfs_inode.c:356 evict+0x2ed/0x6c0 fs/inode.c:667 iput_final fs/inode.c:1741 [inline] iput.part.0+0x5a8/0x7f0 fs/inode.c:1767 iput+0x5c/0x80 fs/inode.c:1757 v9fs_fid_iget+0x1e8/0x3c0 fs/9p/vfs_inode.c:399 v9fs_get_inode_from_fid fs/9p/v9fs.h:232 [inline] v9fs_mount+0x7ac/0xa90 fs/9p/vfs_super.c:142 legacy_get_tree+0x109/0x220 fs/fs_context.c:662 vfs_get_tree+0x8f/0x380 fs/super.c:1797 do_new_mount fs/namespace.c:3352 [inline] path_mount+0x14e6/0x1f20 fs/namespace.c:3679 do_mount fs/namespace.c:3692 [inline] __do_sys_mount fs/namespace.c:3898 [inline] __se_sys_mount fs/namespace.c:3875 [inline] __x64_sys_mount+0x297/0x320 fs/namespace.c:3875 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xd2/0x260 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x6d/0x75 RIP: 0033:0x7fb11b47dda9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 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 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fb11c28a0c8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007fb11b5abf80 RCX: 00007fb11b47dda9 RDX: 00000000200000c0 RSI: 0000000020000000 RDI: 0000000000000000 RBP: 00007fb11b4ca47a R08: 0000000020000180 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007fb11b5abf80 R15: 00007ffc84295828 Allocated by task 5373: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:312 [inline] __kasan_slab_alloc+0x89/0x90 mm/kasan/common.c:338 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3798 [inline] slab_alloc_node mm/slub.c:3845 [inline] kmem_cache_alloc+0x136/0x320 mm/slub.c:3852 kmem_cache_zalloc include/linux/slab.h:739 [inline] fscache_alloc_cookie fs/netfs/fscache_cookie.c:335 [inline] __fscache_acquire_cookie+0xb6/0x14b0 fs/netfs/fscache_cookie.c:470 fscache_acquire_cookie include/linux/fscache.h:253 [inline] v9fs_cache_inode_get_cookie+0x21d/0x3a0 fs/9p/cache.c:66 v9fs_fid_iget+0x32e/0x3c0 fs/9p/vfs_inode.c:395 v9fs_get_inode_from_fid fs/9p/v9fs.h:232 [inline] v9fs_vfs_lookup+0x3dc/0x550 fs/9p/vfs_inode.c:679 __lookup_slow+0x24f/0x460 fs/namei.c:1692 lookup_slow fs/namei.c:1709 [inline] walk_component+0x350/0x5b0 fs/namei.c:2004 link_path_walk.part.0.constprop.0+0x77f/0xcd0 fs/namei.c:2331 link_path_walk fs/namei.c:2255 [inline] path_lookupat+0x93/0x770 fs/namei.c:2484 filename_lookup+0x1e5/0x5b0 fs/namei.c:2514 user_path_at_empty+0x42/0x60 fs/namei.c:2921 user_path_at include/linux/namei.h:57 [inline] __do_sys_pivot_root+0x178/0x1660 fs/namespace.c:4190 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xd2/0x260 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x6d/0x75 Freed by task 5227: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:579 poison_slab_object mm/kasan/common.c:240 [inline] __kasan_slab_free+0x11d/0x1a0 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2106 [inline] slab_free mm/slub.c:4280 [inline] kmem_cache_free+0x12e/0x380 mm/slub.c:4344 fscache_free_cookie+0x26a/0x510 fs/netfs/fscache_cookie.c:79 fscache_put_cookie+0xf5/0x150 fs/netfs/fscache_cookie.c:1014 __fscache_relinquish_cookie+0x260/0x650 fs/netfs/fscache_cookie.c:996 fscache_relinquish_cookie include/linux/fscache.h:308 [inline] v9fs_evict_inode+0x102/0x150 fs/9p/vfs_inode.c:356 evict+0x2ed/0x6c0 fs/inode.c:667 dispose_list+0x117/0x1e0 fs/inode.c:700 evict_inodes+0x34e/0x450 fs/inode.c:750 generic_shutdown_super+0xb5/0x3d0 fs/super.c:626 kill_anon_super+0x3a/0x60 fs/super.c:1225 v9fs_kill_super+0x3d/0xa0 fs/9p/vfs_super.c:193 deactivate_locked_super+0xbe/0x1a0 fs/super.c:472 deactivate_super+0xde/0x100 fs/super.c:505 cleanup_mnt+0x222/0x450 fs/namespace.c:1267 task_work_run+0x14e/0x250 kernel/task_work.c:180 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] exit_to_user_mode_loop kernel/entry/common.c:108 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:201 [inline] syscall_exit_to_user_mode+0x275/0x2a0 kernel/entry/common.c:212 do_syscall_64+0xe2/0x260 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x6d/0x75 The buggy address belongs to the object at ffff88802b8d6000 which belongs to the cache fscache_cookie_jar of size 280 The buggy address is located 240 bytes inside of freed 280-byte region [ffff88802b8d6000, ffff88802b8d6118) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2b8d6 head: order:1 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff80000000840(slab|head|node=0|zone=1|lastcpupid=0xfff) page_type: 0xffffffff() raw: 00fff80000000840 ffff88801aa92a00 dead000000000122 0000000000000000 raw: 0000000000000000 0000000080170017 00000001ffffffff 0000000000000000 head: 00fff80000000840 ffff88801aa92a00 dead000000000122 0000000000000000 head: 0000000000000000 0000000080170017 00000001ffffffff 0000000000000000 head: 00fff80000000001 ffffea0000ae3581 dead000000000122 00000000ffffffff head: 0000000200000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 1, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 5373, tgid 5371 (syz-executor.3), ts 117507115735, free_ts 115616531152 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d4/0x350 mm/page_alloc.c:1534 prep_new_page mm/page_alloc.c:1541 [inline] get_page_from_freelist+0xa28/0x3780 mm/page_alloc.c:3317 __alloc_pages+0x22b/0x2460 mm/page_alloc.c:4575 __alloc_pages_node include/linux/gfp.h:238 [inline] alloc_pages_node include/linux/gfp.h:261 [inline] alloc_slab_page mm/slub.c:2175 [inline] allocate_slab mm/slub.c:2338 [inline] new_slab+0xcc/0x3a0 mm/slub.c:2391 ___slab_alloc+0x66d/0x1790 mm/slub.c:3525 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3610 __slab_alloc_node mm/slub.c:3663 [inline] slab_alloc_node mm/slub.c:3835 [inline] kmem_cache_alloc+0x2e9/0x320 mm/slub.c:3852 kmem_cache_zalloc include/linux/slab.h:739 [inline] fscache_alloc_cookie fs/netfs/fscache_cookie.c:335 [inline] __fscache_acquire_cookie+0xb6/0x14b0 fs/netfs/fscache_cookie.c:470 fscache_acquire_cookie include/linux/fscache.h:253 [inline] v9fs_cache_inode_get_cookie+0x21d/0x3a0 fs/9p/cache.c:66 v9fs_fid_iget+0x32e/0x3c0 fs/9p/vfs_inode.c:395 v9fs_get_inode_from_fid fs/9p/v9fs.h:232 [inline] v9fs_vfs_lookup+0x3dc/0x550 fs/9p/vfs_inode.c:679 __lookup_slow+0x24f/0x460 fs/namei.c:1692 lookup_slow fs/namei.c:1709 [inline] walk_component+0x350/0x5b0 fs/namei.c:2004 link_path_walk.part.0.constprop.0+0x77f/0xcd0 fs/namei.c:2331 link_path_walk fs/namei.c:2255 [inline] path_lookupat+0x93/0x770 fs/namei.c:2484 filename_lookup+0x1e5/0x5b0 fs/namei.c:2514 page last free pid 5225 tgid 5225 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1141 [inline] free_unref_page_prepare+0x527/0xb10 mm/page_alloc.c:2347 free_unref_page+0x33/0x3c0 mm/page_alloc.c:2487 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4e/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:322 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3798 [inline] slab_alloc_node mm/slub.c:3845 [inline] __do_kmalloc_node mm/slub.c:3965 [inline] __kmalloc_node+0x1e9/0x480 mm/slub.c:3973 kmalloc_node include/linux/slab.h:648 [inline] kzalloc_node include/linux/slab.h:760 [inline] qdisc_alloc+0xb3/0xa90 net/sched/sch_generic.c:941 qdisc_create_dflt+0x73/0x440 net/sched/sch_generic.c:999 attach_one_default_qdisc net/sched/sch_generic.c:1164 [inline] netdev_for_each_tx_queue include/linux/netdevice.h:2500 [inline] attach_default_qdiscs net/sched/sch_generic.c:1182 [inline] dev_activate+0x667/0x1310 net/sched/sch_generic.c:1241 __dev_open+0x396/0x4e0 net/core/dev.c:1439 __dev_change_flags+0x561/0x720 net/core/dev.c:8683 dev_change_flags+0x8f/0x160 net/core/dev.c:8755 do_setlink+0x1a3b/0x3fe0 net/core/rtnetlink.c:2884 __rtnl_newlink+0xc35/0x1960 net/core/rtnetlink.c:3680 rtnl_newlink+0x67/0xa0 net/core/rtnetlink.c:3727 rtnetlink_rcv_msg+0x3c7/0xe60 net/core/rtnetlink.c:6595 Memory state around the buggy address: ffff88802b8d5f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88802b8d6000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88802b8d6080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88802b8d6100: fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88802b8d6180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================