================================================================== BUG: KASAN: slab-use-after-free in __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] BUG: KASAN: slab-use-after-free in _raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:162 Read of size 1 at addr ffff88805f02b818 by task kworker/0:1/10 CPU: 0 UID: 0 PID: 10 Comm: kworker/0:1 Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Workqueue: mld mld_dad_work Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xcd/0x630 mm/kasan/report.c:482 kasan_report+0xe0/0x110 mm/kasan/report.c:595 __kasan_check_byte+0x36/0x50 mm/kasan/common.c:568 kasan_check_byte include/linux/kasan.h:399 [inline] lock_acquire kernel/locking/lockdep.c:5842 [inline] lock_acquire+0xfc/0x350 kernel/locking/lockdep.c:5825 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:162 p9_tag_remove net/9p/client.c:397 [inline] p9_req_put net/9p/client.c:405 [inline] p9_req_put+0xaf/0x250 net/9p/client.c:402 req_done+0x1dc/0x2e0 net/9p/trans_virtio.c:147 vring_interrupt drivers/virtio/virtio_ring.c:2719 [inline] vring_interrupt+0x31b/0x400 drivers/virtio/virtio_ring.c:2694 __handle_irq_event_percpu+0x22c/0x7d0 kernel/irq/handle.c:158 handle_irq_event_percpu kernel/irq/handle.c:193 [inline] handle_irq_event+0xab/0x1e0 kernel/irq/handle.c:210 handle_edge_irq+0x3ca/0x9e0 kernel/irq/chip.c:855 generic_handle_irq_desc include/linux/irqdesc.h:173 [inline] handle_irq arch/x86/kernel/irq.c:254 [inline] call_irq_handler arch/x86/kernel/irq.c:310 [inline] __common_interrupt+0xcd/0x2f0 arch/x86/kernel/irq.c:325 common_interrupt+0xba/0xe0 arch/x86/kernel/irq.c:318 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:693 RIP: 0010:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline] RIP: 0010:_raw_spin_unlock_irqrestore+0x31/0x80 kernel/locking/spinlock.c:194 Code: f5 53 48 8b 74 24 10 48 89 fb 48 83 c7 18 e8 e6 77 03 f6 48 89 df e8 ce cb 03 f6 f7 c5 00 02 00 00 75 23 9c 58 f6 c4 02 75 37 01 00 00 00 e8 a5 c8 f3 f5 65 8b 05 fe 4b 42 08 85 c0 74 16 5b RSP: 0018:ffffc900001c72f8 EFLAGS: 00000246 RAX: 0000000000000006 RBX: ffffffff9b03e760 RCX: 0000000000000002 RDX: 0000000000000000 RSI: ffffffff8de4eb89 RDI: ffffffff8c163180 RBP: 0000000000000286 R08: 0000000000000001 R09: 0000000000000001 R10: ffffffff90aba297 R11: 0000000000000000 R12: dffffc0000000000 R13: 0000000000000002 R14: 0000000000000002 R15: ffff88806920b000 __debug_check_no_obj_freed lib/debugobjects.c:1108 [inline] debug_check_no_obj_freed+0x31f/0x600 lib/debugobjects.c:1129 slab_free_hook mm/slub.c:2353 [inline] slab_free mm/slub.c:4695 [inline] kfree+0x28f/0x4d0 mm/slub.c:4894 skb_kfree_head net/core/skbuff.c:1047 [inline] skb_free_head+0x114/0x210 net/core/skbuff.c:1059 skb_release_data+0x795/0x9e0 net/core/skbuff.c:1086 skb_release_all net/core/skbuff.c:1151 [inline] __kfree_skb net/core/skbuff.c:1165 [inline] consume_skb net/core/skbuff.c:1397 [inline] consume_skb+0xbf/0x100 net/core/skbuff.c:1391 nsim_start_xmit+0xc2/0xc50 drivers/net/netdevsim/netdev.c:155 __netdev_start_xmit include/linux/netdevice.h:5222 [inline] netdev_start_xmit include/linux/netdevice.h:5231 [inline] xmit_one net/core/dev.c:3839 [inline] dev_hard_start_xmit+0x94/0x740 net/core/dev.c:3855 sch_direct_xmit+0x1b2/0xcf0 net/sched/sch_generic.c:344 __dev_xmit_skb net/core/dev.c:4114 [inline] __dev_queue_xmit+0x144d/0x4490 net/core/dev.c:4691 dev_queue_xmit include/linux/netdevice.h:3361 [inline] neigh_hh_output include/net/neighbour.h:531 [inline] neigh_output include/net/neighbour.h:545 [inline] ip6_finish_output2+0xe98/0x2020 net/ipv6/ip6_output.c:141 __ip6_finish_output+0x3cd/0x1010 net/ipv6/ip6_output.c:215 ip6_finish_output net/ipv6/ip6_output.c:226 [inline] NF_HOOK_COND include/linux/netfilter.h:307 [inline] ip6_output+0x1ca/0x3e0 net/ipv6/ip6_output.c:248 dst_output include/net/dst.h:461 [inline] NF_HOOK include/linux/netfilter.h:318 [inline] NF_HOOK include/linux/netfilter.h:312 [inline] mld_sendpack+0x9ea/0x1270 net/ipv6/mcast.c:1860 mld_send_initial_cr+0x214/0x320 net/ipv6/mcast.c:2276 mld_dad_work+0x32/0x1f0 net/ipv6/mcast.c:2299 process_one_work+0x9cf/0x1b70 kernel/workqueue.c:3236 process_scheduled_works kernel/workqueue.c:3319 [inline] worker_thread+0x6c8/0xf10 kernel/workqueue.c:3400 kthread+0x3c5/0x780 kernel/kthread.c:463 ret_from_fork+0x5d7/0x6f0 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Allocated by task 6081: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:388 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:405 kmalloc_noprof include/linux/slab.h:905 [inline] p9_client_create+0xc7/0x11c0 net/9p/client.c:985 v9fs_session_init+0x1f7/0x1a80 fs/9p/v9fs.c:410 v9fs_mount+0xc5/0xa90 fs/9p/vfs_super.c:122 legacy_get_tree+0x10c/0x220 fs/fs_context.c:666 vfs_get_tree+0x8b/0x340 fs/super.c:1815 do_new_mount fs/namespace.c:3808 [inline] path_mount+0x1513/0x2000 fs/namespace.c:4123 do_mount fs/namespace.c:4136 [inline] __do_sys_mount fs/namespace.c:4347 [inline] __se_sys_mount fs/namespace.c:4324 [inline] __ia32_sys_mount+0x28b/0x310 fs/namespace.c:4324 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0x7c/0x3a0 arch/x86/entry/syscall_32.c:306 do_fast_syscall_32+0x32/0x80 arch/x86/entry/syscall_32.c:331 entry_SYSENTER_compat_after_hwframe+0x84/0x8e Freed by task 6081: 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:576 poison_slab_object mm/kasan/common.c:243 [inline] __kasan_slab_free+0x60/0x70 mm/kasan/common.c:275 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2422 [inline] slab_free mm/slub.c:4695 [inline] kfree+0x2b4/0x4d0 mm/slub.c:4894 p9_client_create+0xa28/0x11c0 net/9p/client.c:1064 v9fs_session_init+0x1f7/0x1a80 fs/9p/v9fs.c:410 v9fs_mount+0xc5/0xa90 fs/9p/vfs_super.c:122 legacy_get_tree+0x10c/0x220 fs/fs_context.c:666 vfs_get_tree+0x8b/0x340 fs/super.c:1815 do_new_mount fs/namespace.c:3808 [inline] path_mount+0x1513/0x2000 fs/namespace.c:4123 do_mount fs/namespace.c:4136 [inline] __do_sys_mount fs/namespace.c:4347 [inline] __se_sys_mount fs/namespace.c:4324 [inline] __ia32_sys_mount+0x28b/0x310 fs/namespace.c:4324 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0x7c/0x3a0 arch/x86/entry/syscall_32.c:306 do_fast_syscall_32+0x32/0x80 arch/x86/entry/syscall_32.c:331 entry_SYSENTER_compat_after_hwframe+0x84/0x8e The buggy address belongs to the object at ffff88805f02b800 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 24 bytes inside of freed 512-byte region [ffff88805f02b800, ffff88805f02ba00) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x5f028 head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x4fff00000000040(head|node=1|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 04fff00000000040 ffff88801b842c80 dead000000000100 dead000000000122 raw: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 04fff00000000040 ffff88801b842c80 dead000000000100 dead000000000122 head: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 04fff00000000002 ffffea00017c0a01 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5977, tgid 5977 (syz-executor), ts 56667758463, free_ts 56656572805 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1c0/0x230 mm/page_alloc.c:1851 prep_new_page mm/page_alloc.c:1859 [inline] get_page_from_freelist+0x132b/0x38e0 mm/page_alloc.c:3858 __alloc_frozen_pages_noprof+0x261/0x23f0 mm/page_alloc.c:5148 alloc_slab_page mm/slub.c:2494 [inline] allocate_slab mm/slub.c:2660 [inline] new_slab+0x94/0x330 mm/slub.c:2714 ___slab_alloc+0xcf2/0x1750 mm/slub.c:3901 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3992 __slab_alloc_node mm/slub.c:4067 [inline] slab_alloc_node mm/slub.c:4228 [inline] __kmalloc_cache_node_noprof+0x100/0x420 mm/slub.c:4415 kmalloc_node_noprof include/linux/slab.h:928 [inline] alloc_fair_sched_group+0x20f/0x440 kernel/sched/fair.c:13287 sched_create_group+0x2d/0x80 kernel/sched/core.c:9139 cpu_cgroup_css_alloc kernel/sched/core.c:9285 [inline] cpu_cgroup_css_alloc+0x15/0x30 kernel/sched/core.c:9275 css_create kernel/cgroup/cgroup.c:5669 [inline] cgroup_apply_control_enable+0x4b0/0xbb0 kernel/cgroup/cgroup.c:3289 cgroup_mkdir+0x5e7/0x11f0 kernel/cgroup/cgroup.c:5893 kernfs_iop_mkdir+0x10e/0x190 fs/kernfs/dir.c:1268 vfs_mkdir+0x590/0x8c0 fs/namei.c:4366 do_mkdirat+0x304/0x3e0 fs/namei.c:4399 __do_sys_mkdirat fs/namei.c:4416 [inline] __se_sys_mkdirat fs/namei.c:4414 [inline] __ia32_sys_mkdirat+0x82/0xb0 fs/namei.c:4414 page last free pid 5977 tgid 5977 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1395 [inline] __free_frozen_pages+0x7d5/0x10f0 mm/page_alloc.c:2895 stack_depot_save_flags+0x352/0x9c0 lib/stackdepot.c:727 kasan_save_stack+0x42/0x60 mm/kasan/common.c:48 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:330 [inline] __kasan_slab_alloc+0x89/0x90 mm/kasan/common.c:356 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4191 [inline] slab_alloc_node mm/slub.c:4240 [inline] kmem_cache_alloc_lru_noprof+0x1d0/0x3b0 mm/slub.c:4259 shmem_alloc_inode+0x25/0x50 mm/shmem.c:5211 alloc_inode+0x61/0x240 fs/inode.c:346 new_inode+0x22/0x1c0 fs/inode.c:1145 __shmem_get_inode mm/shmem.c:3110 [inline] shmem_get_inode+0x19a/0xfb0 mm/shmem.c:3184 shmem_mknod+0x1a8/0x450 mm/shmem.c:3905 shmem_mkdir+0x31/0x80 mm/shmem.c:3971 vfs_mkdir+0x590/0x8c0 fs/namei.c:4366 do_mkdirat+0x304/0x3e0 fs/namei.c:4399 __do_sys_mkdirat fs/namei.c:4416 [inline] __se_sys_mkdirat fs/namei.c:4414 [inline] __ia32_sys_mkdirat+0x82/0xb0 fs/namei.c:4414 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0x7c/0x3a0 arch/x86/entry/syscall_32.c:306 Memory state around the buggy address: ffff88805f02b700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88805f02b780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88805f02b800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88805f02b880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88805f02b900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: f5 cmc 1: 53 push %rbx 2: 48 8b 74 24 10 mov 0x10(%rsp),%rsi 7: 48 89 fb mov %rdi,%rbx a: 48 83 c7 18 add $0x18,%rdi e: e8 e6 77 03 f6 call 0xf60377f9 13: 48 89 df mov %rbx,%rdi 16: e8 ce cb 03 f6 call 0xf603cbe9 1b: f7 c5 00 02 00 00 test $0x200,%ebp 21: 75 23 jne 0x46 23: 9c pushf 24: 58 pop %rax 25: f6 c4 02 test $0x2,%ah 28: 75 37 jne 0x61 * 2a: bf 01 00 00 00 mov $0x1,%edi <-- trapping instruction 2f: e8 a5 c8 f3 f5 call 0xf5f3c8d9 34: 65 8b 05 fe 4b 42 08 mov %gs:0x8424bfe(%rip),%eax # 0x8424c39 3b: 85 c0 test %eax,%eax 3d: 74 16 je 0x55 3f: 5b pop %rbx