RBP: 00007f05c20871d0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000002
R13: 00007ffd5c5037df R14: 00007f05c2087300 R15: 0000000000022000
==================================================================
BUG: KASAN: use-after-free in d_inode include/linux/dcache.h:522 [inline]
BUG: KASAN: use-after-free in relay_switch_subbuf+0x8d5/0x940 kernel/relay.c:761
Read of size 8 at addr ffff8880157b4c28 by task swapper/1/0
CPU: 1 PID: 0 Comm: swapper/1 Not tainted 5.10.207 #1
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x107/0x167 lib/dump_stack.c:118
print_address_description.constprop.0+0x1c/0x220 mm/kasan/report.c:377
__kasan_report mm/kasan/report.c:537 [inline]
kasan_report.cold+0x37/0x7c mm/kasan/report.c:554
d_inode include/linux/dcache.h:522 [inline]
relay_switch_subbuf+0x8d5/0x940 kernel/relay.c:761
relay_reserve include/linux/relay.h:261 [inline]
trace_note.constprop.0+0x42f/0x550 kernel/trace/blktrace.c:95
trace_note_tsk kernel/trace/blktrace.c:126 [inline]
__blk_add_trace.constprop.0+0xa7a/0xbd0 kernel/trace/blktrace.c:266
blk_add_trace_rq.constprop.0+0x3bd/0x4f0 kernel/trace/blktrace.c:844
trace_block_rq_complete include/trace/events/block.h:115 [inline]
blk_update_request+0xa86/0xeb0 block/blk-core.c:1434
scsi_end_request+0x7a/0x8c0 drivers/scsi/scsi_lib.c:570
scsi_io_completion+0x194/0x12c0 drivers/scsi/scsi_lib.c:967
scsi_softirq_done+0x11b/0x490 drivers/scsi/scsi_lib.c:1445
blk_done_softirq+0x22f/0x370 block/blk-mq.c:590
__do_softirq+0x1b8/0x7c9 kernel/softirq.c:298
asm_call_irq_on_stack+0x12/0x20
__run_on_irqstack arch/x86/include/asm/irq_stack.h:26 [inline]
run_on_irqstack_cond arch/x86/include/asm/irq_stack.h:77 [inline]
do_softirq_own_stack+0x80/0xa0 arch/x86/kernel/irq_64.c:77
invoke_softirq kernel/softirq.c:393 [inline]
__irq_exit_rcu kernel/softirq.c:423 [inline]
irq_exit_rcu+0x114/0x1b0 kernel/softirq.c:435
sysvec_call_function_single+0x43/0xa0 arch/x86/kernel/smp.c:243
asm_sysvec_call_function_single+0x12/0x20 arch/x86/include/asm/idtentry.h:643
RIP: 0010:default_idle+0xe/0x20 arch/x86/kernel/process.c:707
Code: 86 fd e9 4b ff ff ff 4c 89 e7 e8 fd 67 86 fd eb 8f 66 66 2e 0f 1f 84 00 00 00 00 00 e9 07 00 00 00 0f 00 2d 44 4a 5c 00 fb f4 fd 4b 3a 00 cc cc cc cc cc cc cc cc cc cc cc cc cc 41 55 41 54
RSP: 0018:ffff888008987e70 EFLAGS: 00000202
RAX: ffffffff83e5f470 RBX: 0000000000000001 RCX: ffffffff83e4752c
RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffffffff83e5fa78
RBP: ffffed100112f000 R08: 0000000000000001 R09: ffff88806cf3c12b
R10: ffffed100d9e7825 R11: 0000000000000001 R12: 0000000000000001
R13: ffffffff85672788 R14: 0000000000000000 R15: dffffc0000000000
default_idle_call+0xbf/0x2c0 kernel/sched/idle.c:112
cpuidle_idle_call kernel/sched/idle.c:194 [inline]
do_idle+0x3ad/0x520 kernel/sched/idle.c:300
cpu_startup_entry+0x14/0x20 kernel/sched/idle.c:396
secondary_startup_64_no_verify+0xc2/0xcb
Allocated by task 13937:
kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48
kasan_set_track mm/kasan/common.c:56 [inline]
__kasan_kmalloc.constprop.0+0xc9/0xd0 mm/kasan/common.c:461
slab_post_alloc_hook mm/slab.h:532 [inline]
slab_alloc_node mm/slub.c:2896 [inline]
slab_alloc mm/slub.c:2904 [inline]
kmem_cache_alloc+0x13b/0x310 mm/slub.c:2909
__d_alloc+0x2a/0x990 fs/dcache.c:1709
d_alloc+0x46/0x1c0 fs/dcache.c:1788
__lookup_hash+0xcc/0x190 fs/namei.c:1453
filename_create+0x186/0x4a0 fs/namei.c:3530
user_path_create fs/namei.c:3587 [inline]
do_symlinkat+0xe0/0x280 fs/namei.c:4041
do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46
entry_SYSCALL_64_after_hwframe+0x62/0xc7
Freed by task 16:
kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48
kasan_set_track+0x1c/0x30 mm/kasan/common.c:56
kasan_set_free_info+0x1b/0x30 mm/kasan/generic.c:355
__kasan_slab_free+0x110/0x160 mm/kasan/common.c:422
slab_free_hook mm/slub.c:1542 [inline]
slab_free_freelist_hook+0xa9/0x180 mm/slub.c:1576
slab_free mm/slub.c:3149 [inline]
kmem_cache_free+0xa7/0x2d0 mm/slub.c:3165
rcu_do_batch kernel/rcu/tree.c:2494 [inline]
rcu_core+0xc61/0x16c0 kernel/rcu/tree.c:2735
__do_softirq+0x1b8/0x7c9 kernel/softirq.c:298
Last call_rcu():
kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48
kasan_record_aux_stack+0xa2/0xb0 mm/kasan/generic.c:346
__call_rcu kernel/rcu/tree.c:2976 [inline]
call_rcu+0x8a/0x9c0 kernel/rcu/tree.c:3050
dentry_free+0xc3/0x160 fs/dcache.c:350
__dentry_kill+0x47d/0x5c0 fs/dcache.c:593
shrink_dentry_list+0x12f/0x500 fs/dcache.c:1141
shrink_dcache_parent+0x205/0x410 fs/dcache.c:1568
vfs_rmdir.part.0+0x1e8/0x470 fs/namei.c:3778
vfs_rmdir fs/namei.c:3760 [inline]
do_rmdir+0x346/0x440 fs/namei.c:3834
do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46
entry_SYSCALL_64_after_hwframe+0x62/0xc7
Second to last call_rcu():
kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48
kasan_record_aux_stack+0xa2/0xb0 mm/kasan/generic.c:346
__call_rcu kernel/rcu/tree.c:2976 [inline]
call_rcu+0x8a/0x9c0 kernel/rcu/tree.c:3050
dentry_free+0x134/0x160 fs/dcache.c:342
__dentry_kill+0x47d/0x5c0 fs/dcache.c:593
dentry_kill fs/dcache.c:717 [inline]
dput+0x6d1/0xc90 fs/dcache.c:878
handle_mounts fs/namei.c:1401 [inline]
step_into+0xe1c/0x1ce0 fs/namei.c:1698
walk_component+0x171/0x6a0 fs/namei.c:1874
link_path_walk.part.0+0x699/0xbf0 fs/namei.c:2191
link_path_walk fs/namei.c:2120 [inline]
path_openat+0x25a/0x26e0 fs/namei.c:3427
do_filp_open+0x190/0x3e0 fs/namei.c:3458
do_sys_openat2+0x171/0x420 fs/open.c:1186
do_sys_open fs/open.c:1202 [inline]
__do_sys_openat fs/open.c:1218 [inline]
__se_sys_openat fs/open.c:1213 [inline]
__x64_sys_openat+0x13f/0x1f0 fs/open.c:1213
do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46
entry_SYSCALL_64_after_hwframe+0x62/0xc7
The buggy address belongs to the object at ffff8880157b4bc0
which belongs to the cache dentry of size 312
The buggy address is located 104 bytes inside of
312-byte region [ffff8880157b4bc0, ffff8880157b4cf8)
The buggy address belongs to the page:
page:00000000234632ca refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x157b4
head:00000000234632ca order:1 compound_mapcount:0
flags: 0x100000000010200(slab|head)
raw: 0100000000010200 dead000000000100 dead000000000122 ffff8880083f9000
raw: 0000000000000000 0000000000150015 00000001ffffffff ffff88800edd4001
page dumped because: kasan: bad access detected
page->mem_cgroup:ffff88800edd4001
Memory state around the buggy address:
ffff8880157b4b00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff8880157b4b80: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb
>ffff8880157b4c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8880157b4c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc
ffff8880157b4d00: fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00 00
==================================================================
general protection fault, probably for non-canonical address 0xdffffc000000000a: 0000 [#1] SMP KASAN NOPTI
KASAN: null-ptr-deref in range [0x0000000000000050-0x0000000000000057]
CPU: 1 PID: 0 Comm: swapper/1 Tainted: G B 5.10.207 #1
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014
RIP: 0010:relay_switch_subbuf+0x216/0x940 kernel/relay.c:761
Code: 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 d3 06 00 00 48 ba 00 00 00 00 00 fc ff df 4c 8b 73 68 49 8d 7e 50 48 89 f9 48 c1 e9 03 <80> 3c 11 00 0f 85 92 06 00 00 49 8b 55 28 49 8b 5e 50 48 b9 00 00
RSP: 0018:ffff88806cf09b80 EFLAGS: 00010016
RAX: 0000000000000001 RBX: ffff8880157b4bc0 RCX: 000000000000000a
RDX: dffffc0000000000 RSI: ffffffff83d8d8fe RDI: 0000000000000050
RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000003
R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000040
R13: ffff888018210400 R14: 0000000000000000 R15: 0000000000000100
FS: 0000000000000000(0000) GS:ffff88806cf00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fff6c78f080 CR3: 0000000037df8000 CR4: 0000000000350ee0
Call Trace:
relay_reserve include/linux/relay.h:261 [inline]
trace_note.constprop.0+0x42f/0x550 kernel/trace/blktrace.c:95
trace_note_tsk kernel/trace/blktrace.c:126 [inline]
__blk_add_trace.constprop.0+0xa7a/0xbd0 kernel/trace/blktrace.c:266
blk_add_trace_rq.constprop.0+0x3bd/0x4f0 kernel/trace/blktrace.c:844
trace_block_rq_complete include/trace/events/block.h:115 [inline]
blk_update_request+0xa86/0xeb0 block/blk-core.c:1434
scsi_end_request+0x7a/0x8c0 drivers/scsi/scsi_lib.c:570
scsi_io_completion+0x194/0x12c0 drivers/scsi/scsi_lib.c:967
scsi_softirq_done+0x11b/0x490 drivers/scsi/scsi_lib.c:1445
blk_done_softirq+0x22f/0x370 block/blk-mq.c:590
__do_softirq+0x1b8/0x7c9 kernel/softirq.c:298
asm_call_irq_on_stack+0x12/0x20
__run_on_irqstack arch/x86/include/asm/irq_stack.h:26 [inline]
run_on_irqstack_cond arch/x86/include/asm/irq_stack.h:77 [inline]
do_softirq_own_stack+0x80/0xa0 arch/x86/kernel/irq_64.c:77
invoke_softirq kernel/softirq.c:393 [inline]
__irq_exit_rcu kernel/softirq.c:423 [inline]
irq_exit_rcu+0x114/0x1b0 kernel/softirq.c:435
sysvec_call_function_single+0x43/0xa0 arch/x86/kernel/smp.c:243
asm_sysvec_call_function_single+0x12/0x20 arch/x86/include/asm/idtentry.h:643
RIP: 0010:default_idle+0xe/0x20 arch/x86/kernel/process.c:707
Code: 86 fd e9 4b ff ff ff 4c 89 e7 e8 fd 67 86 fd eb 8f 66 66 2e 0f 1f 84 00 00 00 00 00 e9 07 00 00 00 0f 00 2d 44 4a 5c 00 fb f4 fd 4b 3a 00 cc cc cc cc cc cc cc cc cc cc cc cc cc 41 55 41 54
RSP: 0018:ffff888008987e70 EFLAGS: 00000202
RAX: ffffffff83e5f470 RBX: 0000000000000001 RCX: ffffffff83e4752c
RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffffffff83e5fa78
RBP: ffffed100112f000 R08: 0000000000000001 R09: ffff88806cf3c12b
R10: ffffed100d9e7825 R11: 0000000000000001 R12: 0000000000000001
R13: ffffffff85672788 R14: 0000000000000000 R15: dffffc0000000000
default_idle_call+0xbf/0x2c0 kernel/sched/idle.c:112
cpuidle_idle_call kernel/sched/idle.c:194 [inline]
do_idle+0x3ad/0x520 kernel/sched/idle.c:300
cpu_startup_entry+0x14/0x20 kernel/sched/idle.c:396
secondary_startup_64_no_verify+0xc2/0xcb
Modules linked in:
---[ end trace f83fdd18d99e19e6 ]---
RIP: 0010:relay_switch_subbuf+0x216/0x940 kernel/relay.c:761
Code: 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 d3 06 00 00 48 ba 00 00 00 00 00 fc ff df 4c 8b 73 68 49 8d 7e 50 48 89 f9 48 c1 e9 03 <80> 3c 11 00 0f 85 92 06 00 00 49 8b 55 28 49 8b 5e 50 48 b9 00 00
RSP: 0018:ffff88806cf09b80 EFLAGS: 00010016
RAX: 0000000000000001 RBX: ffff8880157b4bc0 RCX: 000000000000000a
RDX: dffffc0000000000 RSI: ffffffff83d8d8fe RDI: 0000000000000050
RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000003
R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000040
R13: ffff888018210400 R14: 0000000000000000 R15: 0000000000000100
FS: 0000000000000000(0000) GS:ffff88806cf00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fff6c78f080 CR3: 0000000037df8000 CR4: 0000000000350ee0
----------------
Code disassembly (best guess):
0: 86 fd xchg %bh,%ch
2: e9 4b ff ff ff jmpq 0xffffff52
7: 4c 89 e7 mov %r12,%rdi
a: e8 fd 67 86 fd callq 0xfd86680c
f: eb 8f jmp 0xffffffa0
11: 66 66 2e 0f 1f 84 00 data16 nopw %cs:0x0(%rax,%rax,1)
18: 00 00 00 00
1c: e9 07 00 00 00 jmpq 0x28
21: 0f 00 2d 44 4a 5c 00 verw 0x5c4a44(%rip) # 0x5c4a6c
28: fb sti
29: f4 hlt
* 2a: e9 fd 4b 3a 00 jmpq 0x3a4c2c <-- trapping instruction
2f: cc int3
30: cc int3
31: cc int3
32: cc int3
33: cc int3
34: cc int3
35: cc int3
36: cc int3
37: cc int3
38: cc int3
39: cc int3
3a: cc int3
3b: cc int3
3c: 41 55 push %r13
3e: 41 54 push %r12