syzbot


KASAN: out-of-bounds Read in i801_isr

Status: fixed on 2021/11/10 00:50
Subsystems: i2c
[Documentation on labels]
Reported-by: syzbot+b4d3fd1dfd53e90afd79@syzkaller.appspotmail.com
Fix commit: e4d8716c3dce i2c: i801: Don't generate an interrupt on bus reset
First crash: 1099d, last: 1012d
Discussions (8)
Title Replies (including bot) Last reply
[PATCH 5.10 000/252] 5.10.42-rc1 review 268 (268) 2021/07/29 07:58
[PATCH 5.12 000/296] 5.12.9-rc1 review 303 (303) 2021/06/02 02:25
[PATCH 5.4 000/177] 5.4.124-rc1 review 185 (185) 2021/06/02 02:24
[PATCH 4.19 000/116] 4.19.193-rc1 review 122 (122) 2021/06/02 02:23
[PATCH 4.14 00/79] 4.14.235-rc1 review 83 (83) 2021/06/02 01:46
[PATCH 4.9 00/66] 4.9.271-rc1 review 69 (69) 2021/06/01 02:13
[PATCH 4.4 00/54] 4.4.271-rc1 review 59 (59) 2021/05/31 21:43
[syzbot] KASAN: out-of-bounds Read in i801_isr 3 (4) 2021/05/24 10:42
Similar bugs (5)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: stack-out-of-bounds Write in i801_isr (3) i2c 1 19d 15d 0/26 upstream: reported on 2024/03/14 11:17
upstream KASAN: stack-out-of-bounds Write in i801_isr (2) i2c 1 358d 353d 0/26 auto-obsoleted due to no activity on 2023/08/04 06:44
upstream KASAN: out-of-bounds Write in i801_isr i2c 1 1304d 1298d 0/26 auto-closed as invalid on 2020/12/31 09:40
upstream KASAN: stack-out-of-bounds Read in i801_isr i2c 1 1535d 1535d 0/26 closed as dup on 2020/01/15 06:49
upstream KASAN: stack-out-of-bounds Write in i801_isr i2c 3 1227d 1310d 0/26 auto-closed as invalid on 2021/03/18 06:45

Sample crash report:
==================================================================
BUG: KASAN: out-of-bounds in i801_isr_byte_done drivers/i2c/busses/i2c-i801.c:608 [inline]
BUG: KASAN: out-of-bounds in i801_isr drivers/i2c/busses/i2c-i801.c:668 [inline]
BUG: KASAN: out-of-bounds in i801_isr+0xc70/0xd60 drivers/i2c/busses/i2c-i801.c:649
Read of size 1 at addr ffffc90000e37d61 by task syz-executor.0/18565

CPU: 2 PID: 18565 Comm: syz-executor.0 Not tainted 5.13.0-rc6-syzkaller #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014
Call Trace:
 <IRQ>
 __dump_stack lib/dump_stack.c:79 [inline]
 dump_stack+0x141/0x1d7 lib/dump_stack.c:120
 print_address_description.constprop.0.cold+0x5/0x2f8 mm/kasan/report.c:233
 __kasan_report mm/kasan/report.c:419 [inline]
 kasan_report.cold+0x7c/0xd8 mm/kasan/report.c:436
 i801_isr_byte_done drivers/i2c/busses/i2c-i801.c:608 [inline]
 i801_isr drivers/i2c/busses/i2c-i801.c:668 [inline]
 i801_isr+0xc70/0xd60 drivers/i2c/busses/i2c-i801.c:649
 __handle_irq_event_percpu+0x303/0x8f0 kernel/irq/handle.c:156
 handle_irq_event_percpu kernel/irq/handle.c:196 [inline]
 handle_irq_event+0x102/0x290 kernel/irq/handle.c:213
 handle_fasteoi_irq+0x22f/0x9f0 kernel/irq/chip.c:714
 generic_handle_irq_desc include/linux/irqdesc.h:158 [inline]
 handle_irq arch/x86/kernel/irq.c:231 [inline]
 __common_interrupt+0x9e/0x200 arch/x86/kernel/irq.c:250
 common_interrupt+0x4c/0xd0 arch/x86/kernel/irq.c:240
 asm_common_interrupt+0x1e/0x40 arch/x86/include/asm/idtentry.h:638
RIP: 0010:__do_softirq+0x196/0x9f6 kernel/softirq.c:545
Code: 00 48 01 f0 48 89 44 24 18 48 c7 c7 20 55 6a 89 e8 cf fa d6 ff 65 66 c7 05 b5 4a c3 76 00 00 e8 80 e8 3a f8 fb b8 ff ff ff ff <48> c7 c3 c0 a0 c0 8b 41 0f bc c5 41 89 c7 41 83 c7 01 75 47 e9 d2
RSP: 0018:ffffc90000550f70 EFLAGS: 00000202
RAX: 00000000ffffffff RBX: ffff8880146e0000 RCX: 1ffffffff2045f0a
RDX: 0000000000000000 RSI: 0000000000000103 RDI: 0000000000000000
RBP: ffff888011af9c40 R08: 0000000000000001 R09: ffffffff902288b7
R10: 0000000000000001 R11: 0000000000000001 R12: 0000000000000000
R13: 0000000000000002 R14: 0000000000000000 R15: 0000000000000000
 invoke_softirq kernel/softirq.c:433 [inline]
 __irq_exit_rcu+0x136/0x200 kernel/softirq.c:637
 irq_exit_rcu+0x5/0x20 kernel/softirq.c:649
 sysvec_apic_timer_interrupt+0x93/0xc0 arch/x86/kernel/apic/apic.c:1100
 </IRQ>
 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:647
RIP: 0010:debug_smp_processor_id+0x5/0x20 lib/smp_processor_id.c:64
Code: ff 48 8b 74 24 28 48 c7 c7 40 e8 c2 89 e8 10 36 bf ff e8 ad 8f cd ff eb a2 66 66 2e 0f 1f 84 00 00 00 00 00 90 0f 1f 44 00 00 <48> c7 c6 80 e8 c2 89 48 c7 c7 c0 e8 c2 89 e9 98 fe ff ff 0f 1f 84
RSP: 0018:ffffc90000dd7598 EFLAGS: 00000286
RAX: 0000000000000001 RBX: 1ffff920001baebb RCX: ffffffff815a8768
RDX: 0000000000000002 RSI: 0000000000000008 RDI: ffffffff8dc97a90
RBP: 0000000000000000 R08: 0000000000000000 R09: ffffffff8dc97a97
R10: fffffbfff1b92f52 R11: 0000000000000000 R12: 0000000000000001
R13: ffffffff8bf79660 R14: 0000000000000000 R15: 0000000000000000
 rcu_dynticks_curr_cpu_in_eqs kernel/rcu/tree.c:325 [inline]
 rcu_is_watching+0xe/0xc0 kernel/rcu/tree.c:1168
 rcu_read_lock_held_common kernel/rcu/update.c:108 [inline]
 rcu_read_lock_sched_held+0x1c/0x70 kernel/rcu/update.c:123
 trace_lock_acquire include/trace/events/lock.h:13 [inline]
 lock_acquire+0x5e9/0x740 kernel/locking/lockdep.c:5483
 rcu_lock_acquire include/linux/rcupdate.h:267 [inline]
 rcu_read_lock include/linux/rcupdate.h:657 [inline]
 lock_page_memcg+0x66/0x7d0 mm/memcontrol.c:1982
 page_remove_rmap+0x25/0x1430 mm/rmap.c:1345
 zap_pte_range mm/memory.c:1270 [inline]
 zap_pmd_range mm/memory.c:1385 [inline]
 zap_pud_range mm/memory.c:1414 [inline]
 zap_p4d_range mm/memory.c:1435 [inline]
 unmap_page_range+0xea6/0x2890 mm/memory.c:1456
 unmap_single_vma+0x198/0x300 mm/memory.c:1501
 unmap_vmas+0x16d/0x2f0 mm/memory.c:1533
 exit_mmap+0x2a8/0x590 mm/mmap.c:3208
 __mmput+0x122/0x470 kernel/fork.c:1096
 mmput+0x58/0x60 kernel/fork.c:1117
 exit_mm kernel/exit.c:502 [inline]
 do_exit+0xb0a/0x2a60 kernel/exit.c:813
 do_group_exit+0x125/0x310 kernel/exit.c:923
 get_signal+0x47f/0x2150 kernel/signal.c:2835
 arch_do_signal_or_restart+0x2a8/0x1eb0 arch/x86/kernel/signal.c:789
 handle_signal_work kernel/entry/common.c:148 [inline]
 exit_to_user_mode_loop kernel/entry/common.c:172 [inline]
 exit_to_user_mode_prepare+0x180/0x290 kernel/entry/common.c:209
 __syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline]
 syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:302
 __do_fast_syscall_32+0x74/0xe0 arch/x86/entry/common.c:146
 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:168
 entry_SYSENTER_compat_after_hwframe+0x4d/0x5c
RIP: 0023:0xf7ff4549
Code: Unable to access opcode bytes at RIP 0xf7ff451f.
RSP: 002b:00000000f55ee68c EFLAGS: 00000246 ORIG_RAX: 00000000000000f0
RAX: 0000000000000001 RBX: 000000000819afcc RCX: 0000000000000081
RDX: 00000000000f4240 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 00000000080525a9 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000


Memory state around the buggy address:
 ffffc90000e37c00: f2 f2 00 00 f3 f3 00 00 00 00 00 00 00 00 00 00
 ffffc90000e37c80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffffc90000e37d00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                                                       ^
 ffffc90000e37d80: 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00
 ffffc90000e37e00: f2 f2 f2 00 00 00 00 00 00 00 00 00 00 00 f3 f3
==================================================================

Crashes (16):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/06/20 20:58 upstream cba5e97280f5 aba2b2fb .config console log report info ci-qemu-upstream-386 KASAN: out-of-bounds Read in i801_isr
2021/06/17 13:23 upstream 70585216fe77 aba2b2fb .config console log report info ci-qemu-upstream-386 KASAN: out-of-bounds Read in i801_isr
2021/06/16 21:14 upstream 6b00bc639f1f c06f97ad .config console log report info ci-qemu-upstream-386 KASAN: out-of-bounds Read in i801_isr
2021/06/16 19:04 upstream 6b00bc639f1f c06f97ad .config console log report info ci-qemu-upstream-386 KASAN: out-of-bounds Read in i801_isr
2021/06/15 00:46 upstream 009c9aa5be65 1ba81399 .config console log report info ci-qemu-upstream-386 KASAN: out-of-bounds Read in i801_isr
2021/06/01 14:16 upstream c2131f7e73c9 032639db .config console log report info ci-qemu-upstream-386 KASAN: out-of-bounds Read in i801_isr
2021/05/28 16:06 upstream 97e5bf604b7a 858ea628 .config console log report info ci-qemu-upstream-386 KASAN: out-of-bounds Read in i801_isr
2021/03/25 18:33 upstream e138138003eb 6a383ecf .config console log report info ci-qemu-upstream-386 KASAN: out-of-bounds Read in i801_isr
2021/06/01 16:54 upstream c2131f7e73c9 032639db .config console log report info ci-qemu-upstream KASAN: stack-out-of-bounds Write in i801_isr
2021/05/17 00:40 upstream 63d1cb53e26a f54a5c09 .config console log report info ci-qemu-upstream KASAN: out-of-bounds Write in i801_isr
2021/05/16 16:22 upstream 63d1cb53e26a f54a5c09 .config console log report info ci-qemu-upstream KASAN: vmalloc-out-of-bounds Read in i801_isr
2021/05/11 22:51 upstream 88b06399c9c7 b3c3bb8e .config console log report info ci-qemu-upstream KASAN: stack-out-of-bounds Read in i801_isr
2021/05/08 18:54 upstream ab159ac569fd bc5434be .config console log report info ci-qemu-upstream KASAN: vmalloc-out-of-bounds Read in i801_isr
2021/06/15 13:55 upstream 009c9aa5be65 8022d7e3 .config console log report info ci-qemu-upstream-386 KASAN: stack-out-of-bounds Read in i801_isr
2021/05/06 12:54 upstream 18a3c5f7abfd 06c27ff5 .config console log report info ci-qemu-upstream-386 KASAN: out-of-bounds Write in i801_isr
2021/04/23 07:26 upstream 90c911ad7445 590921a5 .config console log report info ci-qemu-upstream-386 KASAN: out-of-bounds Write in i801_isr
* Struck through repros no longer work on HEAD.