================================================================== 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 ffff888046be3418 by task rcu_exp_gp_kthr/18 CPU: 3 UID: 0 PID: 18 Comm: rcu_exp_gp_kthr 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 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:580 kasan_check_byte include/linux/kasan.h:401 [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:2718 [inline] vring_interrupt+0x31e/0x400 drivers/virtio/virtio_ring.c:2693 __handle_irq_event_percpu+0x236/0x920 kernel/irq/handle.c:203 handle_irq_event_percpu kernel/irq/handle.c:240 [inline] handle_irq_event+0xab/0x1e0 kernel/irq/handle.c:257 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+0xd0/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:688 RIP: 0010:csd_lock_wait kernel/smp.c:342 [inline] RIP: 0010:csd_lock kernel/smp.c:357 [inline] RIP: 0010:smp_call_function_single+0x42f/0x6b0 kernel/smp.c:674 Code: 48 b8 00 00 00 00 00 fc ff df 48 8b 4c 24 20 49 89 cf 83 e1 07 49 c1 ef 03 49 01 c7 8d 41 03 88 44 24 38 e8 93 f5 0b 00 f3 90 <41> 0f b6 07 38 44 24 38 7c 08 84 c0 0f 85 d4 01 00 00 8b 43 08 31 RSP: 0018:ffffc90000157ba0 EFLAGS: 00000293 RAX: 0000000000000000 RBX: ffff88806a73b580 RCX: ffffffff81b11623 RDX: ffff88801d6fc900 RSI: ffffffff81b115fd RDI: 0000000000000005 RBP: ffffc90000157cf8 R08: 0000000000000005 R09: 0000000000000000 R10: 0000000000000001 R11: fffffbfff1c79e5e R12: 1ffff9200002af7c R13: 0000000000000002 R14: 0000000000000001 R15: ffffed100d4e76b1 __sync_rcu_exp_select_node_cpus+0x597/0xd50 kernel/rcu/tree_exp.h:420 sync_rcu_exp_select_node_cpus kernel/rcu/tree_exp.h:455 [inline] sync_rcu_exp_select_cpus+0x3cb/0xab0 kernel/rcu/tree_exp.h:522 rcu_exp_sel_wait_wake kernel/rcu/tree_exp.h:718 [inline] wait_rcu_exp_gp+0x2c/0x40 kernel/rcu/tree_exp.h:492 kthread_worker_fn+0x310/0xc50 kernel/kthread.c:1010 kthread+0x3c5/0x780 kernel/kthread.c:463 ret_from_fork+0x675/0x7d0 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Allocated by task 11977: kasan_save_stack+0x33/0x60 mm/kasan/common.c:56 kasan_save_track+0x14/0x30 mm/kasan/common.c:77 poison_kmalloc_redzone mm/kasan/common.c:400 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:417 kmalloc_noprof include/linux/slab.h:957 [inline] p9_client_create+0xc7/0x11d0 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:663 vfs_get_tree+0x8e/0x340 fs/super.c:1751 fc_mount fs/namespace.c:1208 [inline] do_new_mount_fc fs/namespace.c:3651 [inline] do_new_mount fs/namespace.c:3727 [inline] path_mount+0x7b9/0x23a0 fs/namespace.c:4037 do_mount fs/namespace.c:4050 [inline] __do_sys_mount fs/namespace.c:4238 [inline] __se_sys_mount fs/namespace.c:4215 [inline] __x64_sys_mount+0x293/0x310 fs/namespace.c:4215 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 11977: kasan_save_stack+0x33/0x60 mm/kasan/common.c:56 kasan_save_track+0x14/0x30 mm/kasan/common.c:77 __kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:587 kasan_save_free_info mm/kasan/kasan.h:406 [inline] poison_slab_object mm/kasan/common.c:252 [inline] __kasan_slab_free+0x5f/0x80 mm/kasan/common.c:284 kasan_slab_free include/linux/kasan.h:234 [inline] slab_free_hook mm/slub.c:2539 [inline] slab_free mm/slub.c:6630 [inline] kfree+0x2b8/0x6d0 mm/slub.c:6837 p9_client_create+0xa28/0x11d0 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:663 vfs_get_tree+0x8e/0x340 fs/super.c:1751 fc_mount fs/namespace.c:1208 [inline] do_new_mount_fc fs/namespace.c:3651 [inline] do_new_mount fs/namespace.c:3727 [inline] path_mount+0x7b9/0x23a0 fs/namespace.c:4037 do_mount fs/namespace.c:4050 [inline] __do_sys_mount fs/namespace.c:4238 [inline] __se_sys_mount fs/namespace.c:4215 [inline] __x64_sys_mount+0x293/0x310 fs/namespace.c:4215 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888046be3400 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 24 bytes inside of freed 512-byte region [ffff888046be3400, ffff888046be3600) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x46be0 head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 anon flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88801b442c80 0000000000000000 dead000000000001 raw: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88801b442c80 0000000000000000 dead000000000001 head: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 00fff00000000002 ffffea00011af801 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 5958, tgid 5958 (syz-executor), ts 98690225570, free_ts 98558368657 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1c0/0x230 mm/page_alloc.c:1850 prep_new_page mm/page_alloc.c:1858 [inline] get_page_from_freelist+0x10a3/0x3a30 mm/page_alloc.c:3884 __alloc_frozen_pages_noprof+0x25f/0x2470 mm/page_alloc.c:5183 alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2416 alloc_slab_page mm/slub.c:3055 [inline] allocate_slab mm/slub.c:3228 [inline] new_slab+0x24a/0x360 mm/slub.c:3282 ___slab_alloc+0xdae/0x1a60 mm/slub.c:4651 __slab_alloc.constprop.0+0x63/0x110 mm/slub.c:4770 __slab_alloc_node mm/slub.c:4846 [inline] slab_alloc_node mm/slub.c:5268 [inline] __do_kmalloc_node mm/slub.c:5641 [inline] __kmalloc_noprof+0x501/0x880 mm/slub.c:5654 kmalloc_noprof include/linux/slab.h:961 [inline] kzalloc_noprof include/linux/slab.h:1094 [inline] fib6_info_alloc+0x40/0x160 net/ipv6/ip6_fib.c:155 ip6_route_info_create+0x14c/0x870 net/ipv6/route.c:3809 ip6_route_add.part.0+0x22/0x1d0 net/ipv6/route.c:3938 ip6_route_add+0x45/0x60 net/ipv6/route.c:3935 addrconf_prefix_route+0x2fd/0x510 net/ipv6/addrconf.c:2488 inet6_addr_add+0x589/0x960 net/ipv6/addrconf.c:3053 inet6_rtm_newaddr+0x1619/0x1c70 net/ipv6/addrconf.c:5059 rtnetlink_rcv_msg+0x95e/0xe90 net/core/rtnetlink.c:6951 page last free pid 5349 tgid 5349 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1394 [inline] __free_frozen_pages+0x7df/0x1160 mm/page_alloc.c:2906 discard_slab mm/slub.c:3326 [inline] __put_partials+0x130/0x170 mm/slub.c:3872 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4d/0x120 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x195/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:352 kasan_slab_alloc include/linux/kasan.h:252 [inline] slab_post_alloc_hook mm/slub.c:4970 [inline] slab_alloc_node mm/slub.c:5280 [inline] kmem_cache_alloc_node_noprof+0x28a/0x770 mm/slub.c:5332 __alloc_skb+0x2b2/0x380 net/core/skbuff.c:660 alloc_skb include/linux/skbuff.h:1383 [inline] netlink_alloc_large_skb+0x69/0x140 net/netlink/af_netlink.c:1186 netlink_sendmsg+0x698/0xdd0 net/netlink/af_netlink.c:1871 sock_sendmsg_nosec net/socket.c:727 [inline] __sock_sendmsg net/socket.c:742 [inline] ____sys_sendmsg+0xa98/0xc70 net/socket.c:2630 ___sys_sendmsg+0x134/0x1d0 net/socket.c:2684 __sys_sendmsg+0x16d/0x220 net/socket.c:2716 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff888046be3300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888046be3380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888046be3400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888046be3480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888046be3500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax 7: fc ff df a: 48 8b 4c 24 20 mov 0x20(%rsp),%rcx f: 49 89 cf mov %rcx,%r15 12: 83 e1 07 and $0x7,%ecx 15: 49 c1 ef 03 shr $0x3,%r15 19: 49 01 c7 add %rax,%r15 1c: 8d 41 03 lea 0x3(%rcx),%eax 1f: 88 44 24 38 mov %al,0x38(%rsp) 23: e8 93 f5 0b 00 call 0xbf5bb 28: f3 90 pause * 2a: 41 0f b6 07 movzbl (%r15),%eax <-- trapping instruction 2e: 38 44 24 38 cmp %al,0x38(%rsp) 32: 7c 08 jl 0x3c 34: 84 c0 test %al,%al 36: 0f 85 d4 01 00 00 jne 0x210 3c: 8b 43 08 mov 0x8(%rbx),%eax 3f: 31 .byte 0x31