[v5.15] KASAN: global-out-of-bounds Read in llc_conn_state_process

0 views
Skip to first unread message

syzbot

unread,
Jan 31, 2024, 9:15:29 AMJan 31
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 6139f2a02fe0 Linux 5.15.148
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=130e9a47e80000
kernel config: https://syzkaller.appspot.com/x/.config?x=c170eb20d8be8542
dashboard link: https://syzkaller.appspot.com/bug?extid=9ac3bf1c7b3a68b4a325
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/528e8fe56997/disk-6139f2a0.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/18abf1e442f9/vmlinux-6139f2a0.xz
kernel image: https://storage.googleapis.com/syzbot-assets/0538a5d3b1f3/bzImage-6139f2a0.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+9ac3bf...@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: global-out-of-bounds in llc_qualify_conn_ev net/llc/llc_conn.c:399 [inline]
BUG: KASAN: global-out-of-bounds in llc_conn_service net/llc/llc_conn.c:365 [inline]
BUG: KASAN: global-out-of-bounds in llc_conn_state_process+0xf9/0x1220 net/llc/llc_conn.c:71
Read of size 8 at addr ffffffff8da09978 by task syz-executor.2/5434

CPU: 0 PID: 5434 Comm: syz-executor.2 Not tainted 5.15.148-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
Call Trace:
<IRQ>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
print_address_description+0x63/0x3b0 mm/kasan/report.c:248
__kasan_report mm/kasan/report.c:434 [inline]
kasan_report+0x16b/0x1c0 mm/kasan/report.c:451
llc_qualify_conn_ev net/llc/llc_conn.c:399 [inline]
llc_conn_service net/llc/llc_conn.c:365 [inline]
llc_conn_state_process+0xf9/0x1220 net/llc/llc_conn.c:71
llc_process_tmr_ev net/llc/llc_c_ac.c:1445 [inline]
llc_conn_tmr_common_cb+0x347/0x8a0 net/llc/llc_c_ac.c:1331
call_timer_fn+0x16d/0x560 kernel/time/timer.c:1421
expire_timers kernel/time/timer.c:1466 [inline]
__run_timers+0x67c/0x890 kernel/time/timer.c:1737
run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1750
__do_softirq+0x3b3/0x93a kernel/softirq.c:558
invoke_softirq kernel/softirq.c:432 [inline]
__irq_exit_rcu+0x155/0x240 kernel/softirq.c:637
irq_exit_rcu+0x5/0x20 kernel/softirq.c:649
sysvec_apic_timer_interrupt+0x91/0xb0 arch/x86/kernel/apic/apic.c:1096
</IRQ>
<TASK>
asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:638
RIP: 0010:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:161 [inline]
RIP: 0010:_raw_spin_unlock_irqrestore+0xd4/0x130 kernel/locking/spinlock.c:194
Code: 9c 8f 44 24 20 42 80 3c 23 00 74 08 4c 89 f7 e8 42 db a3 f7 f6 44 24 21 02 75 4e 41 f7 c7 00 02 00 00 74 01 fb bf 01 00 00 00 <e8> 17 2e 31 f7 65 8b 05 d8 66 dc 75 85 c0 74 3f 48 c7 04 24 0e 36
RSP: 0018:ffffc90002fc75a0 EFLAGS: 00000206
RAX: 6d0dc1d40f75f800 RBX: 1ffff920005f8eb8 RCX: ffffffff8162ee28
RDX: dffffc0000000000 RSI: ffffffff8a8b0f80 RDI: 0000000000000001
RBP: ffffc90002fc7630 R08: dffffc0000000000 R09: fffffbfff1f7a02e
R10: 0000000000000000 R11: dffffc0000000001 R12: dffffc0000000000
R13: 1ffff920005f8eb4 R14: ffffc90002fc75c0 R15: 0000000000000246
spin_unlock_irqrestore include/linux/spinlock.h:418 [inline]
__wake_up_common_lock kernel/sched/wait.c:140 [inline]
__wake_up_sync_key+0x121/0x1c0 kernel/sched/wait.c:205
__unix_dgram_recvmsg+0x5fe/0x1260 net/unix/af_unix.c:2343
____sys_recvmsg+0x286/0x530
___sys_recvmsg+0x1ec/0x690 net/socket.c:2692
do_recvmmsg+0x36f/0x8f0 net/socket.c:2786
__sys_recvmmsg net/socket.c:2865 [inline]
__do_sys_recvmmsg net/socket.c:2888 [inline]
__se_sys_recvmmsg net/socket.c:2881 [inline]
__x64_sys_recvmmsg+0x195/0x240 net/socket.c:2881
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7fab8d81bda9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fab8bd7b0c8 EFLAGS: 00000246 ORIG_RAX: 000000000000012b
RAX: ffffffffffffffda RBX: 00007fab8d94a050 RCX: 00007fab8d81bda9
RDX: 0000000000010106 RSI: 00000000200000c0 RDI: 0000000000000005
RBP: 00007fab8d86847a R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000002 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000006e R14: 00007fab8d94a050 R15: 00007ffdbffcca78
</TASK>

The buggy address belongs to the variable:
llc_temp_state_transitions+0x58/0x60

Memory state around the buggy address:
ffffffff8da09800: 00 00 00 00 00 00 00 00 00 f9 f9 f9 f9 f9 f9 f9
ffffffff8da09880: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f9 f9
>ffffffff8da09900: f9 f9 f9 f9 00 00 00 00 00 00 f9 f9 f9 f9 f9 f9
^
ffffffff8da09980: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffffffff8da09a00: 00 00 00 00 00 00 00 00 f9 f9 f9 f9 00 00 00 00
==================================================================
----------------
Code disassembly (best guess):
0: 9c pushf
1: 8f 44 24 20 pop 0x20(%rsp)
5: 42 80 3c 23 00 cmpb $0x0,(%rbx,%r12,1)
a: 74 08 je 0x14
c: 4c 89 f7 mov %r14,%rdi
f: e8 42 db a3 f7 call 0xf7a3db56
14: f6 44 24 21 02 testb $0x2,0x21(%rsp)
19: 75 4e jne 0x69
1b: 41 f7 c7 00 02 00 00 test $0x200,%r15d
22: 74 01 je 0x25
24: fb sti
25: bf 01 00 00 00 mov $0x1,%edi
* 2a: e8 17 2e 31 f7 call 0xf7312e46 <-- trapping instruction
2f: 65 8b 05 d8 66 dc 75 mov %gs:0x75dc66d8(%rip),%eax # 0x75dc670e
36: 85 c0 test %eax,%eax
38: 74 3f je 0x79
3a: 48 rex.W
3b: c7 .byte 0xc7
3c: 04 24 add $0x24,%al
3e: 0e (bad)
3f: 36 ss


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup
Reply all
Reply to author
Forward
0 new messages