==================================================================
BUG: KASAN: slab-use-after-free in __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:155 [inline]
BUG: KASAN: slab-use-after-free in _raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:181
Read of size 1 at addr ffff8880352fe818 by task udevd/5146
CPU: 3 UID: 0 PID: 5146 Comm: udevd Not tainted syzkaller #0 PREEMPT(full)
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
Call Trace:
__dump_stack lib/dump_stack.c:94 [inline]
dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120
print_address_description mm/kasan/report.c:378 [inline]
print_report+0x13d/0x4b0 mm/kasan/report.c:482
kasan_report+0xdf/0x1c0 mm/kasan/report.c:595
__kasan_check_byte+0x36/0x50 mm/kasan/common.c:574
kasan_check_byte include/linux/kasan.h:402 [inline]
lock_acquire kernel/locking/lockdep.c:5916 [inline]
lock_acquire+0x132/0x380 kernel/locking/lockdep.c:5899
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:155 [inline]
_raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:181
p9_tag_remove net/9p/client.c:274 [inline]
p9_req_put net/9p/client.c:282 [inline]
p9_req_put+0xaf/0x250 net/9p/client.c:279
req_done+0x1dc/0x2e0 net/9p/trans_virtio.c:147
vring_interrupt+0x2ef/0x660 drivers/virtio/virtio_ring.c:3305
__handle_irq_event_percpu+0x232/0x880 kernel/irq/handle.c:209
handle_irq_event_percpu kernel/irq/handle.c:246 [inline]
handle_irq_event+0xab/0x1e0 kernel/irq/handle.c:263
handle_edge_irq+0x34c/0x950 kernel/irq/chip.c:859
generic_handle_irq_desc include/linux/irqdesc.h:188 [inline]
handle_irq arch/x86/kernel/irq.c:209 [inline]
call_irq_handler arch/x86/kernel/irq.c:265 [inline]
__common_interrupt+0xd8/0x2f0 arch/x86/kernel/irq.c:280
common_interrupt+0xb9/0xe0 arch/x86/kernel/irq.c:273
asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:665
RIP: 0010:memcpy+0xe/0x30 arch/x86/lib/memcpy_64.S:39
Code: 1f 84 00 00 00 00 00 0f 1f 44 00 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 f3 0f 1e fa 66 90 48 89 f8 48 89 d1 f3 a4 cc cc cc cc 66 66 2e 0f 1f 84 00 00 00 00 00 66 90 90 90 90 90
RSP: 0018:ffffc9000737fc48 EFLAGS: 00000202
RAX: ffffc9000737fcc8 RBX: 0000000000000002 RCX: 0000000000000000
RDX: 0000000000000014 RSI: ffff88802a4ddc50 RDI: ffffc9000737fcdc
RBP: 000000000000000a R08: 0000000000000001 R09: fffff52000e6ff9b
R10: 0000000000000003 R11: 0000000000000000 R12: 0000000001fdffff
R13: 0000000000000046 R14: 000000000000001e R15: ffffc9000737fcc8
avc_has_perm_noaudit+0xe9/0x3b0 security/selinux/avc.c:1163
avc_has_perm+0xbd/0x1e0 security/selinux/avc.c:1194
inode_has_perm security/selinux/hooks.c:1694 [inline]
dentry_has_perm security/selinux/hooks.c:1713 [inline]
selinux_inode_readlink+0x2dd/0x400 security/selinux/hooks.c:3122
security_inode_readlink+0xf3/0x260 security/security.c:1802
do_readlinkat+0x1b3/0x370 fs/stat.c:580
__do_sys_readlink fs/stat.c:605 [inline]
__se_sys_readlink fs/stat.c:602 [inline]
__x64_sys_readlink+0x78/0xc0 fs/stat.c:602
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x123/0x790 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f1e343153a7
Code: 00 00 90 48 83 ec 10 48 63 ff 45 31 c9 45 31 c0 6a 00 31 c9 e8 8a 20 f9 ff 48 83 c4 18 c3 0f 1f 44 00 00 b8 59 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 8b 15 21 ba 0d 00 f7 d8 64 89 02 48
RSP: 002b:00007fff1340c458 EFLAGS: 00000202 ORIG_RAX: 0000000000000059
RAX: ffffffffffffffda RBX: 00007fff1340c660 RCX: 00007f1e343153a7
RDX: 0000000000000200 RSI: 00007fff1340c460 RDI: 00007fff1340c660
RBP: 000055e3cf79c2c0 R08: 0000000000000064 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000202 R12: 00007fff1340c460
R13: 000055e3b7bb1100 R14: 0000000000000001 R15: 00007fff1340cc80
Allocated by task 6374:
kasan_save_stack+0x30/0x50 mm/kasan/common.c:57
kasan_save_track+0x14/0x30 mm/kasan/common.c:78
poison_kmalloc_redzone mm/kasan/common.c:398 [inline]
__kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:415
kasan_kmalloc include/linux/kasan.h:263 [inline]
__kmalloc_cache_noprof+0x2f8/0x6d0 mm/slub.c:5563
_kmalloc_noprof include/linux/slab.h:991 [inline]
p9_client_create+0xaf/0xd40 net/9p/client.c:864
v9fs_session_init+0x3c/0xdd0 fs/9p/v9fs.c:471
v9fs_get_tree+0xb8/0xb50 fs/9p/vfs_super.c:97
vfs_get_tree+0x92/0x320 fs/super.c:1947
fc_mount fs/namespace.c:1198 [inline]
do_new_mount_fc fs/namespace.c:3772 [inline]
do_new_mount fs/namespace.c:3848 [inline]
path_mount+0x7d0/0x24c0 fs/namespace.c:4168
do_mount fs/namespace.c:4181 [inline]
__do_sys_mount fs/namespace.c:4397 [inline]
__se_sys_mount fs/namespace.c:4374 [inline]
__x64_sys_mount+0x293/0x310 fs/namespace.c:4374
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x123/0x790 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Freed by task 6374:
kasan_save_stack+0x30/0x50 mm/kasan/common.c:57
kasan_save_track+0x14/0x30 mm/kasan/common.c:78
kasan_save_free_info+0x3b/0x70 mm/kasan/generic.c:584
poison_slab_object mm/kasan/common.c:253 [inline]
__kasan_slab_free+0x5f/0x80 mm/kasan/common.c:285
kasan_slab_free include/linux/kasan.h:235 [inline]
slab_free_hook mm/slub.c:2748 [inline]
slab_free mm/slub.c:6499 [inline]
kfree+0x22b/0x6d0 mm/slub.c:6792
p9_client_create+0x72d/0xd40 net/9p/client.c:943
v9fs_session_init+0x3c/0xdd0 fs/9p/v9fs.c:471
v9fs_get_tree+0xb8/0xb50 fs/9p/vfs_super.c:97
vfs_get_tree+0x92/0x320 fs/super.c:1947
fc_mount fs/namespace.c:1198 [inline]
do_new_mount_fc fs/namespace.c:3772 [inline]
do_new_mount fs/namespace.c:3848 [inline]
path_mount+0x7d0/0x24c0 fs/namespace.c:4168
do_mount fs/namespace.c:4181 [inline]
__do_sys_mount fs/namespace.c:4397 [inline]
__se_sys_mount fs/namespace.c:4374 [inline]
__x64_sys_mount+0x293/0x310 fs/namespace.c:4374
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x123/0x790 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x77/0x7f
The buggy address belongs to the object at ffff8880352fe800
which belongs to the cache kmalloc-512 of size 512
The buggy address is located 24 bytes inside of
freed 512-byte region [ffff8880352fe800, ffff8880352fea00)
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff8880352ff400 pfn:0x352fc
head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0xfff00000000240(workingset|head|node=0|zone=1|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 00fff00000000240 ffff88801c042c80 ffff88801c0407c8 ffffea0000adec10
raw: ffff8880352ff400 000000000010000e 00000000f5000000 0000000000000000
head: 00fff00000000240 ffff88801c042c80 ffff88801c0407c8 ffffea0000adec10
head: ffff8880352ff400 000000000010000e 00000000f5000000 0000000000000000
head: 00fff00000000002 ffffffffffffff01 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 5763, tgid 5763 (syz-executor), ts 99313981436
set_page_owner include/linux/page_owner.h:33 [inline]
post_alloc_hook+0xfd/0x120 mm/page_alloc.c:1871
prep_new_page mm/page_alloc.c:1879 [inline]
get_page_from_freelist+0x110d/0x35d0 mm/page_alloc.c:3943
__alloc_frozen_pages_noprof+0x2eb/0x3300 mm/page_alloc.c:5436
alloc_slab_page mm/slub.c:3347 [inline]
allocate_slab mm/slub.c:3462 [inline]
new_slab+0xa9/0x6e0 mm/slub.c:3513
refill_objects+0xe3/0x410 mm/slub.c:7410
refill_sheaf mm/slub.c:2885 [inline]
__pcs_replace_empty_main+0x35e/0x650 mm/slub.c:4774
alloc_from_pcs mm/slub.c:4850 [inline]
slab_alloc_node mm/slub.c:4984 [inline]
__do_kmalloc_node mm/slub.c:5413 [inline]
__kmalloc_noprof+0x67c/0x840 mm/slub.c:5439
_kmalloc_noprof include/linux/slab.h:995 [inline]
_kzalloc_noprof include/linux/slab.h:1312 [inline]
fib6_info_alloc+0x40/0x160 net/ipv6/ip6_fib.c:155
ip6_route_info_create+0x14c/0xad0 net/ipv6/route.c:3833
addrconf_f6i_alloc+0x2d9/0x670 net/ipv6/route.c:4714
ipv6_add_addr+0x580/0x1fb0 net/ipv6/addrconf.c:1132
inet6_addr_add+0x26f/0x9a0 net/ipv6/addrconf.c:3074
inet6_rtm_newaddr+0x147a/0x1bb0 net/ipv6/addrconf.c:5095
rtnetlink_rcv_msg+0x95e/0xe90 net/core/rtnetlink.c:7132
netlink_rcv_skb+0x159/0x420 net/netlink/af_netlink.c:2556
netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline]
netlink_unicast+0x585/0x850 net/netlink/af_netlink.c:1345
page last free pid 5752 tgid 5752 ts 99201067407 stack trace:
reset_page_owner include/linux/page_owner.h:26 [inline]
__free_pages_prepare mm/page_alloc.c:1418 [inline]
__free_frozen_pages+0x79f/0x10f0 mm/page_alloc.c:2962
qlink_free mm/kasan/quarantine.c:163 [inline]
qlist_free_all+0x47/0xf0 mm/kasan/quarantine.c:179
kasan_quarantine_reduce+0x1a0/0x1f0 mm/kasan/quarantine.c:286
__kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:350
kasan_slab_alloc include/linux/kasan.h:253 [inline]
slab_post_alloc_hook mm/slub.c:4683 [inline]
slab_alloc_node mm/slub.c:4996 [inline]
__do_kmalloc_node mm/slub.c:5413 [inline]
__kmalloc_node_noprof+0x2df/0x880 mm/slub.c:5426
_kmalloc_node_noprof include/linux/slab.h:1200 [inline]
qdisc_alloc+0xbb/0xb30 net/sched/sch_generic.c:998
qdisc_create_dflt+0x93/0x490 net/sched/sch_generic.c:1053
attach_one_default_qdisc net/sched/sch_generic.c:1219 [inline]
netdev_for_each_tx_queue include/linux/netdevice.h:2749 [inline]
attach_default_qdiscs net/sched/sch_generic.c:1237 [inline]
dev_activate+0x64f/0xce0 net/sched/sch_generic.c:1296
__dev_open+0x490/0x8f0 net/core/dev.c:1733
__dev_change_flags+0x596/0x850 net/core/dev.c:9812
netif_change_flags+0x8d/0x160 net/core/dev.c:9877
do_setlink.isra.0+0x1ac4/0x3e60 net/core/rtnetlink.c:3266
rtnl_changelink net/core/rtnetlink.c:3905 [inline]
__rtnl_newlink net/core/rtnetlink.c:4076 [inline]
rtnl_newlink+0x13c1/0x2620 net/core/rtnetlink.c:4215
rtnetlink_rcv_msg+0x95e/0xe90 net/core/rtnetlink.c:7132
netlink_rcv_skb+0x159/0x420 net/netlink/af_netlink.c:2556
netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline]
netlink_unicast+0x585/0x850 net/netlink/af_netlink.c:1345
Memory state around the buggy address:
ffff8880352fe700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff8880352fe780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff8880352fe800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8880352fe880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8880352fe900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess), 1 bytes skipped:
0: 84 00 test %al,(%rax)
2: 00 00 add %al,(%rax)
4: 00 00 add %al,(%rax)
6: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1)
b: 90 nop
c: 90 nop
d: 90 nop
e: 90 nop
f: 90 nop
10: 90 nop
11: 90 nop
12: 90 nop
13: 90 nop
14: 90 nop
15: 90 nop
16: 90 nop
17: 90 nop
18: 90 nop
19: 90 nop
1a: 90 nop
1b: f3 0f 1e fa endbr64
1f: 66 90 xchg %ax,%ax
21: 48 89 f8 mov %rdi,%rax
24: 48 89 d1 mov %rdx,%rcx
27: f3 a4 rep movsb %ds:(%rsi),%es:(%rdi)
* 29: c3 ret <-- trapping instruction
2a: cc int3
2b: cc int3
2c: cc int3
2d: cc int3
2e: 66 66 2e 0f 1f 84 00 data16 cs nopw 0x0(%rax,%rax,1)
35: 00 00 00 00
39: 66 90 xchg %ax,%ax
3b: 90 nop
3c: 90 nop
3d: 90 nop
3e: 90 nop