Hello,
syzbot has tested the proposed patch but the reproducer is still triggering an issue:
general protection fault in dst_dev_put
general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
CPU: 1 PID: 160 Comm: udevd Not tainted 5.10.117-syzkaller-986967-g0974b8411a58-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:dst_dev_put+0x26/0x1c0 net/core/dst.c:156
Code: 00 00 00 00 55 48 89 e5 41 57 41 56 41 55 41 54 53 49 89 ff 49 bc 00 00 00 00 00 fc ff df e8 61 2d a6 fd 4d 89 fd 49 c1 ed 03 <43> 80 7c 25 00 00 74 08 4c 89 ff e8 7a 00 e0 fd 4d 8b 37 49 8d 7f
RSP: 0018:ffffc90000160b78 EFLAGS: 00010246
RAX: ffffffff83c684ef RBX: 0000000000000001 RCX: ffff88810ca7bb40
RDX: 0000000000000100 RSI: 0000000000000001 RDI: 0000000000000001
RBP: ffffc90000160ba0 R08: ffffffff840df71d R09: ffffed102194f769
R10: ffffed102194f769 R11: 1ffff1102194f768 R12: dffffc0000000000
R13: 0000000000000000 R14: 0000607e08a3d548 R15: 0000000000000001
FS: 00007f52a6fee840(0000) GS:ffff8881f7300000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000001b2db20000 CR3: 000000010c92d000 CR4: 00000000003506a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<IRQ>
rt_fibinfo_free_cpus+0xee/0x1c0 net/ipv4/fib_semantics.c:203
fib_nh_common_release+0x8d/0x240 net/ipv4/fib_semantics.c:216
fib_nh_release net/ipv4/fib_semantics.c:228 [inline]
free_fib_info_rcu+0x98/0x190 net/ipv4/fib_semantics.c:240
rcu_do_batch+0x59e/0xc40 kernel/rcu/tree.c:2485
rcu_core+0x59b/0xe30 kernel/rcu/tree.c:2726
rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2739
__do_softirq+0x27e/0x596 kernel/softirq.c:305
asm_call_irq_on_stack+0xf/0x20
</IRQ>
__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+0x60/0x80 arch/x86/kernel/irq_64.c:77
invoke_softirq kernel/softirq.c:402 [inline]
__irq_exit_rcu+0x128/0x150 kernel/softirq.c:432
irq_exit_rcu+0x9/0x10 kernel/softirq.c:444
sysvec_apic_timer_interrupt+0xbf/0xe0 arch/x86/kernel/apic/apic.c:1095
asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:635
RIP: 0010:preempt_count_add+0x12/0x1a0 kernel/sched/core.c:4440
Code: 80 c9 ee 85 48 89 de e8 ac 58 20 01 e9 1e ff ff ff 0f 1f 80 00 00 00 00 55 48 89 e5 41 57 41 56 53 89 fb 48 c7 c0 80 58 83 86 <48> c1 e8 03 49 bf 00 00 00 00 00 fc ff df 42 8a 04 38 84 c0 0f 85
RSP: 0018:ffffc90000bb78f0 EFLAGS: 00000202
RAX: ffffffff86835880 RBX: 0000000000000001 RCX: dffffc0000000000
RDX: dffffc0000000000 RSI: ffffffff8543d980 RDI: 0000000000000001
RBP: ffffc90000bb7908 R08: ffffc90000bb7a88 R09: 0000000000000009
R10: ffffc90000bb7a90 R11: 1ffff92000176f34 R12: ffff88810ca7bb40
R13: ffffffff815b4ee0 R14: 0000000000000000 R15: 1ffff92000176f3d
is_module_text_address+0x1a/0x140 kernel/module.c:4734
kernel_text_address kernel/extable.c:145 [inline]
__kernel_text_address+0x88/0x110 kernel/extable.c:105
unwind_get_return_address+0x4c/0x90 arch/x86/kernel/unwind_frame.c:19
arch_stack_walk+0xf8/0x140 arch/x86/kernel/stacktrace.c:26
stack_trace_save+0x12d/0x1f0 kernel/stacktrace.c:121
kasan_save_stack+0x36/0x60 mm/kasan/common.c:38
kasan_record_aux_stack+0xca/0xf0 mm/kasan/generic.c:345
task_work_add+0xa7/0x320 kernel/task_work.c:39
fput_many+0xe9/0x1a0 fs/file_table.c:342
fput+0x1a/0x20 fs/file_table.c:358
filp_close+0x105/0x150 fs/open.c:1325
__close_fd+0x224/0x290 fs/file.c:700
__do_sys_close fs/open.c:1338 [inline]
__se_sys_close fs/open.c:1336 [inline]
__x64_sys_close+0x69/0xc0 fs/open.c:1336
do_syscall_64+0x34/0x70 arch/x86/entry/common.c:46
entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x7f52a714a467
Code: 44 00 00 48 8b 15 11 aa 0c 00 f7 d8 64 89 02 b8 ff ff ff ff eb bc 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 b8 03 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 8b 15 e1 a9 0c 00 f7 d8 64 89 02 b8
RSP: 002b:00007ffcc37d1f18 EFLAGS: 00000202 ORIG_RAX: 0000000000000003
RAX: ffffffffffffffda RBX: 00005632104d63c0 RCX: 00007f52a714a467
RDX: 00007f52a7215a60 RSI: 0000000000000000 RDI: 000000000000000d
RBP: 000056321051dae0 R08: 0000000000000000 R09: 00007f52a7215a60
R10: 0000000001000000 R11: 0000000000000202 R12: 00005632104ccbc0
R13: 00000000000000ff R14: 00007ffcc37d1f20 R15: 0000000000000000
Modules linked in:
---[ end trace 89a77c24d03a496b ]---
RIP: 0010:dst_dev_put+0x26/0x1c0 net/core/dst.c:156
Code: 00 00 00 00 55 48 89 e5 41 57 41 56 41 55 41 54 53 49 89 ff 49 bc 00 00 00 00 00 fc ff df e8 61 2d a6 fd 4d 89 fd 49 c1 ed 03 <43> 80 7c 25 00 00 74 08 4c 89 ff e8 7a 00 e0 fd 4d 8b 37 49 8d 7f
RSP: 0018:ffffc90000160b78 EFLAGS: 00010246
RAX: ffffffff83c684ef RBX: 0000000000000001 RCX: ffff88810ca7bb40
RDX: 0000000000000100 RSI: 0000000000000001 RDI: 0000000000000001
RBP: ffffc90000160ba0 R08: ffffffff840df71d R09: ffffed102194f769
R10: ffffed102194f769 R11: 1ffff1102194f768 R12: dffffc0000000000
R13: 0000000000000000 R14: 0000607e08a3d548 R15: 0000000000000001
FS: 00007f52a6fee840(0000) GS:ffff8881f7300000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000001b2db20000 CR3: 000000010c92d000 CR4: 00000000003506a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
0: 00 00 add %al,(%rax)
2: 00 00 add %al,(%rax)
4: 55 push %rbp
5: 48 89 e5 mov %rsp,%rbp
8: 41 57 push %r15
a: 41 56 push %r14
c: 41 55 push %r13
e: 41 54 push %r12
10: 53 push %rbx
11: 49 89 ff mov %rdi,%r15
14: 49 bc 00 00 00 00 00 movabs $0xdffffc0000000000,%r12
1b: fc ff df
1e: e8 61 2d a6 fd callq 0xfda62d84
23: 4d 89 fd mov %r15,%r13
26: 49 c1 ed 03 shr $0x3,%r13
* 2a: 43 80 7c 25 00 00 cmpb $0x0,0x0(%r13,%r12,1) <-- trapping instruction
30: 74 08 je 0x3a
32: 4c 89 ff mov %r15,%rdi
35: e8 7a 00 e0 fd callq 0xfde000b4
3a: 4d 8b 37 mov (%r15),%r14
3d: 49 rex.WB
3e: 8d .byte 0x8d
3f: 7f .byte 0x7f
Tested on:
commit: 0974b841 Merge 5.10.117 into android12-5.10-lts
git tree: android12-5.10-lts
console output:
https://syzkaller.appspot.com/x/log.txt?x=13c9be66f00000
kernel config:
https://syzkaller.appspot.com/x/.config?x=b9b19582654944dd
dashboard link:
https://syzkaller.appspot.com/bug?extid=badfd07a93cffefd7317
compiler: Debian clang version 13.0.1-++20220126092033+75e33f71c2da-1~exp1~20220126212112.63, GNU ld (GNU Binutils for Debian) 2.35.2
patch:
https://syzkaller.appspot.com/x/patch.diff?x=1718b419f00000