[v6.1] general protection fault in mcp_i2c_xfer

8 views
Skip to first unread message

syzbot

unread,
Mar 27, 2025, 10:43:31 PM3/27/25
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 344a09659766 Linux 6.1.131
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=14012bcf980000
kernel config: https://syzkaller.appspot.com/x/.config?x=1eebf09bc04ebd78
dashboard link: https://syzkaller.appspot.com/bug?extid=03d875266c03a05c9ccb
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/bccba205a29a/disk-344a0965.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/bdca79b3b5db/vmlinux-344a0965.xz
kernel image: https://storage.googleapis.com/syzbot-assets/6c2271a91ef3/bzImage-344a0965.xz

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

general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
CPU: 0 PID: 23308 Comm: syz.0.5545 Not tainted 6.1.131-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
RIP: 0010:mcp_i2c_xfer+0x5a/0x430 drivers/hid/hid-mcp2221.c:309
Code: 00 48 89 d8 48 c1 e8 03 80 3c 28 00 74 08 48 89 df e8 5a c6 c3 f9 4c 8b 33 4d 89 f4 49 c1 ec 03 48 b8 00 00 00 00 00 fc ff df <41> 80 3c 04 00 74 08 4c 89 f7 e8 37 c6 c3 f9 49 8b 1e 48 8d ab a8
RSP: 0018:ffffc90004fb7898 EFLAGS: 00010246
RAX: dffffc0000000000 RBX: ffff88805defa1d8 RCX: 0000000000080000
RDX: ffffc9001ca1d000 RSI: 0000000000000070 RDI: 0000000000000071
RBP: dffffc0000000000 R08: ffffffff870a83ef R09: ffffed100bbdf4ba
R10: 0000000000000000 R11: dffffc0000000001 R12: 0000000000000000
R13: 0000000000000001 R14: 0000000000000000 R15: ffffc90004fb7b00
FS: 00007fca48e586c0(0000) GS:ffff8880b8e00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00002000000012c0 CR3: 000000005f70d000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 000000000000000e DR6: 00000000ffff0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
__i2c_transfer+0x850/0x2380 drivers/i2c/i2c-core-base.c:-1
i2c_transfer+0x261/0x3a0 drivers/i2c/i2c-core-base.c:2333
i2c_transfer_buffer_flags+0x17c/0x260 drivers/i2c/i2c-core-base.c:2361
i2c_master_send include/linux/i2c.h:110 [inline]
i2cdev_write+0x88/0x130 drivers/i2c/i2c-dev.c:175
do_loop_readv_writev fs/read_write.c:-1 [inline]
do_iter_write+0x503/0xc40 fs/read_write.c:863
vfs_writev fs/read_write.c:934 [inline]
do_writev+0x27b/0x460 fs/read_write.c:977
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7fca47f8d169
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fca48e58038 EFLAGS: 00000246 ORIG_RAX: 0000000000000014
RAX: ffffffffffffffda RBX: 00007fca481a5fa0 RCX: 00007fca47f8d169
RDX: 0000000000000001 RSI: 00002000000012c0 RDI: 0000000000000006
RBP: 00007fca4800e2a0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007fca481a5fa0 R15: 00007fff52bcdbd8
</TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:mcp_i2c_xfer+0x5a/0x430 drivers/hid/hid-mcp2221.c:309
Code: 00 48 89 d8 48 c1 e8 03 80 3c 28 00 74 08 48 89 df e8 5a c6 c3 f9 4c 8b 33 4d 89 f4 49 c1 ec 03 48 b8 00 00 00 00 00 fc ff df <41> 80 3c 04 00 74 08 4c 89 f7 e8 37 c6 c3 f9 49 8b 1e 48 8d ab a8
RSP: 0018:ffffc90004fb7898 EFLAGS: 00010246
RAX: dffffc0000000000 RBX: ffff88805defa1d8 RCX: 0000000000080000
RDX: ffffc9001ca1d000 RSI: 0000000000000070 RDI: 0000000000000071
RBP: dffffc0000000000 R08: ffffffff870a83ef R09: ffffed100bbdf4ba
R10: 0000000000000000 R11: dffffc0000000001 R12: 0000000000000000
R13: 0000000000000001 R14: 0000000000000000 R15: ffffc90004fb7b00
FS: 00007fca48e586c0(0000) GS:ffff8880b8f00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00002000001c0030 CR3: 000000005f70d000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
0: 00 48 89 add %cl,-0x77(%rax)
3: d8 48 c1 fmuls -0x3f(%rax)
6: e8 03 80 3c 28 call 0x283c800e
b: 00 74 08 48 add %dh,0x48(%rax,%rcx,1)
f: 89 df mov %ebx,%edi
11: e8 5a c6 c3 f9 call 0xf9c3c670
16: 4c 8b 33 mov (%rbx),%r14
19: 4d 89 f4 mov %r14,%r12
1c: 49 c1 ec 03 shr $0x3,%r12
20: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax
27: fc ff df
* 2a: 41 80 3c 04 00 cmpb $0x0,(%r12,%rax,1) <-- trapping instruction
2f: 74 08 je 0x39
31: 4c 89 f7 mov %r14,%rdi
34: e8 37 c6 c3 f9 call 0xf9c3c670
39: 49 8b 1e mov (%r14),%rbx
3c: 48 rex.W
3d: 8d .byte 0x8d
3e: ab stos %eax,%es:(%rdi)
3f: a8 .byte 0xa8


---
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

syzbot

unread,
Mar 28, 2025, 4:36:23 PM3/28/25
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 0c935c049b5c Linux 5.15.179
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=15562a4c580000
kernel config: https://syzkaller.appspot.com/x/.config?x=bcb6af887426ce59
dashboard link: https://syzkaller.appspot.com/bug?extid=2e1b728f22e5449c2297
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/75b060834e1e/disk-0c935c04.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/d42b06ae465d/vmlinux-0c935c04.xz
kernel image: https://storage.googleapis.com/syzbot-assets/d5217676cd35/bzImage-0c935c04.xz

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

general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
CPU: 0 PID: 5731 Comm: syz.2.394 Not tainted 5.15.179-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
RIP: 0010:mcp_i2c_xfer+0x5a/0x430 drivers/hid/hid-mcp2221.c:309
Code: 00 48 89 d8 48 c1 e8 03 80 3c 28 00 74 08 48 89 df e8 aa 2f f6 f9 4c 8b 33 4d 89 f4 49 c1 ec 03 48 b8 00 00 00 00 00 fc ff df <41> 80 3c 04 00 74 08 4c 89 f7 e8 87 2f f6 f9 49 8b 1e 48 8d ab 70
RSP: 0018:ffffc900030cf958 EFLAGS: 00010246
RAX: dffffc0000000000 RBX: ffff8880256fa1d8 RCX: 0000000000080000
RDX: ffffc90004074000 RSI: 0000000000000095 RDI: 0000000000000096
RBP: dffffc0000000000 R08: ffffffff86bbc579 R09: ffffed1004adf4d3
R10: 0000000000000000 R11: dffffc0000000001 R12: 0000000000000000
R13: 0000000000000001 R14: 0000000000000000 R15: ffffc900030cfbc0
FS: 00007fab076e76c0(0000) GS:ffff8880b8e00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00002000000012c0 CR3: 0000000056d69000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
__i2c_transfer+0x85a/0x2100 drivers/i2c/i2c-core-base.c:-1
i2c_transfer+0x261/0x3a0 drivers/i2c/i2c-core-base.c:2330
i2c_transfer_buffer_flags+0x17c/0x260 drivers/i2c/i2c-core-base.c:2358
i2c_master_send include/linux/i2c.h:109 [inline]
i2cdev_write+0x88/0x130 drivers/i2c/i2c-dev.c:175
do_loop_readv_writev fs/read_write.c:-1 [inline]
do_iter_write+0x39c/0x760 fs/read_write.c:857
vfs_writev fs/read_write.c:928 [inline]
do_writev+0x281/0x470 fs/read_write.c:971
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7fab0987e169
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fab076e7038 EFLAGS: 00000246 ORIG_RAX: 0000000000000014
RAX: ffffffffffffffda RBX: 00007fab09a96fa0 RCX: 00007fab0987e169
RDX: 0000000000000001 RSI: 00002000000012c0 RDI: 0000000000000004
RBP: 00007fab098ff2a0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007fab09a96fa0 R15: 00007ffe968f1c88
</TASK>
Modules linked in:
---[ end trace b1d3d00c209dc7b0 ]---
RIP: 0010:mcp_i2c_xfer+0x5a/0x430 drivers/hid/hid-mcp2221.c:309
Code: 00 48 89 d8 48 c1 e8 03 80 3c 28 00 74 08 48 89 df e8 aa 2f f6 f9 4c 8b 33 4d 89 f4 49 c1 ec 03 48 b8 00 00 00 00 00 fc ff df <41> 80 3c 04 00 74 08 4c 89 f7 e8 87 2f f6 f9 49 8b 1e 48 8d ab 70
RSP: 0018:ffffc900030cf958 EFLAGS: 00010246
RAX: dffffc0000000000 RBX: ffff8880256fa1d8 RCX: 0000000000080000
RDX: ffffc90004074000 RSI: 0000000000000095 RDI: 0000000000000096
RBP: dffffc0000000000 R08: ffffffff86bbc579 R09: ffffed1004adf4d3
R10: 0000000000000000 R11: dffffc0000000001 R12: 0000000000000000
R13: 0000000000000001 R14: 0000000000000000 R15: ffffc900030cfbc0
FS: 00007fab076e76c0(0000) GS:ffff8880b8e00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055ee20aa5268 CR3: 0000000056d69000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
0: 00 48 89 add %cl,-0x77(%rax)
3: d8 48 c1 fmuls -0x3f(%rax)
6: e8 03 80 3c 28 call 0x283c800e
b: 00 74 08 48 add %dh,0x48(%rax,%rcx,1)
f: 89 df mov %ebx,%edi
11: e8 aa 2f f6 f9 call 0xf9f62fc0
16: 4c 8b 33 mov (%rbx),%r14
19: 4d 89 f4 mov %r14,%r12
1c: 49 c1 ec 03 shr $0x3,%r12
20: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax
27: fc ff df
* 2a: 41 80 3c 04 00 cmpb $0x0,(%r12,%rax,1) <-- trapping instruction
2f: 74 08 je 0x39
31: 4c 89 f7 mov %r14,%rdi
34: e8 87 2f f6 f9 call 0xf9f62fc0
39: 49 8b 1e mov (%r14),%rbx
3c: 48 rex.W
3d: 8d .byte 0x8d
3e: ab stos %eax,%es:(%rdi)
3f: 70 .byte 0x70

syzbot

unread,
Mar 28, 2025, 9:34:21 PM3/28/25
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 0c935c049b5c Linux 5.15.179
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=11649198580000
kernel config: https://syzkaller.appspot.com/x/.config?x=bcb6af887426ce59
dashboard link: https://syzkaller.appspot.com/bug?extid=2e1b728f22e5449c2297
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=166c7804580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=11fd2a4c580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/75b060834e1e/disk-0c935c04.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/d42b06ae465d/vmlinux-0c935c04.xz
kernel image: https://storage.googleapis.com/syzbot-assets/d5217676cd35/bzImage-0c935c04.xz

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

general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
CPU: 0 PID: 4326 Comm: syz-executor739 Not tainted 5.15.179-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
RIP: 0010:mcp_i2c_xfer+0x5a/0x430 drivers/hid/hid-mcp2221.c:309
Code: 00 48 89 d8 48 c1 e8 03 80 3c 28 00 74 08 48 89 df e8 aa 2f f6 f9 4c 8b 33 4d 89 f4 49 c1 ec 03 48 b8 00 00 00 00 00 fc ff df <41> 80 3c 04 00 74 08 4c 89 f7 e8 87 2f f6 f9 49 8b 1e 48 8d ab 70
RSP: 0018:ffffc90005497958 EFLAGS: 00010246
RAX: dffffc0000000000 RBX: ffff88807ce101d8 RCX: ffff88802558bb80
RDX: 0000000000000000 RSI: ffffc90005497bc0 RDI: ffff88807ce10030
RBP: dffffc0000000000 R08: ffffffff86bbc579 R09: ffffed100f9c20d3
R10: 0000000000000000 R11: dffffc0000000001 R12: 0000000000000000
R13: 0000000000000001 R14: 0000000000000000 R15: ffffc90005497bc0
FS: 0000555578ba7380(0000) GS:ffff8880b8e00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00002000000012c0 CR3: 00000000292c4000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
__i2c_transfer+0x85a/0x2100 drivers/i2c/i2c-core-base.c:-1
i2c_transfer+0x261/0x3a0 drivers/i2c/i2c-core-base.c:2330
i2c_transfer_buffer_flags+0x17c/0x260 drivers/i2c/i2c-core-base.c:2358
i2c_master_send include/linux/i2c.h:109 [inline]
i2cdev_write+0x88/0x130 drivers/i2c/i2c-dev.c:175
do_loop_readv_writev fs/read_write.c:-1 [inline]
do_iter_write+0x39c/0x760 fs/read_write.c:857
vfs_writev fs/read_write.c:928 [inline]
do_writev+0x281/0x470 fs/read_write.c:971
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7fbe34f819e9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 c1 17 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fff9f37c638 EFLAGS: 00000246 ORIG_RAX: 0000000000000014
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fbe34f819e9
RDX: 0000000000000001 RSI: 00002000000012c0 RDI: 0000000000000004
RBP: 00000000000f4240 R08: 00232d6332692f76 R09: 00000000000000a0
R10: 000000000000001f R11: 0000000000000246 R12: 00000000000176cf
R13: 00007fff9f37c64c R14: 00007fff9f37c660 R15: 00007fff9f37c650
</TASK>
Modules linked in:
---[ end trace 46df22dd73a993cd ]---
RIP: 0010:mcp_i2c_xfer+0x5a/0x430 drivers/hid/hid-mcp2221.c:309
Code: 00 48 89 d8 48 c1 e8 03 80 3c 28 00 74 08 48 89 df e8 aa 2f f6 f9 4c 8b 33 4d 89 f4 49 c1 ec 03 48 b8 00 00 00 00 00 fc ff df <41> 80 3c 04 00 74 08 4c 89 f7 e8 87 2f f6 f9 49 8b 1e 48 8d ab 70
RSP: 0018:ffffc90005497958 EFLAGS: 00010246
RAX: dffffc0000000000 RBX: ffff88807ce101d8 RCX: ffff88802558bb80
RDX: 0000000000000000 RSI: ffffc90005497bc0 RDI: ffff88807ce10030
RBP: dffffc0000000000 R08: ffffffff86bbc579 R09: ffffed100f9c20d3
R10: 0000000000000000 R11: dffffc0000000001 R12: 0000000000000000
R13: 0000000000000001 R14: 0000000000000000 R15: ffffc90005497bc0
FS: 0000555578ba7380(0000) GS:ffff8880b8e00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00002000000012c0 CR3: 00000000292c4000 CR4: 00000000003506f0
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

syzbot

unread,
Mar 30, 2025, 10:42:25 AM3/30/25
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 8e60a714ba3b Linux 6.1.132
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=173bac3f980000
kernel config: https://syzkaller.appspot.com/x/.config?x=ebc45e145d6155ea
dashboard link: https://syzkaller.appspot.com/bug?extid=03d875266c03a05c9ccb
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=12d7d198580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/c8b8da8486ff/disk-8e60a714.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/ad79748d8748/vmlinux-8e60a714.xz
kernel image: https://storage.googleapis.com/syzbot-assets/28699fcb5d47/bzImage-8e60a714.xz

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

general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
CPU: 0 PID: 5142 Comm: syz.2.668 Not tainted 6.1.132-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
RIP: 0010:mcp_i2c_xfer+0x5a/0x430 drivers/hid/hid-mcp2221.c:309
Code: 00 48 89 d8 48 c1 e8 03 80 3c 28 00 74 08 48 89 df e8 1a 9f c3 f9 4c 8b 33 4d 89 f4 49 c1 ec 03 48 b8 00 00 00 00 00 fc ff df <41> 80 3c 04 00 74 08 4c 89 f7 e8 f7 9e c3 f9 49 8b 1e 48 8d ab a8
RSP: 0018:ffffc90005d07898 EFLAGS: 00010246
RAX: dffffc0000000000 RBX: ffff8880798621d8 RCX: ffff88802df1bb80
RDX: 0000000000000000 RSI: ffffc90005d07b00 RDI: ffff888079862030
RBP: dffffc0000000000 R08: ffffffff870aab7f R09: ffffed100f30c4ba
R10: 0000000000000000 R11: dffffc0000000001 R12: 0000000000000000
R13: 0000000000000001 R14: 0000000000000000 R15: ffffc90005d07b00
FS: 000055556b5fc500(0000) GS:ffff8880b8e00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00002000000012c0 CR3: 0000000027455000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
__i2c_transfer+0x850/0x2380 drivers/i2c/i2c-core-base.c:-1
i2c_transfer+0x261/0x3a0 drivers/i2c/i2c-core-base.c:2333
i2c_transfer_buffer_flags+0x17c/0x260 drivers/i2c/i2c-core-base.c:2361
i2c_master_send include/linux/i2c.h:110 [inline]
i2cdev_write+0x88/0x130 drivers/i2c/i2c-dev.c:175
do_loop_readv_writev fs/read_write.c:-1 [inline]
do_iter_write+0x503/0xc40 fs/read_write.c:863
vfs_writev fs/read_write.c:934 [inline]
do_writev+0x27b/0x460 fs/read_write.c:977
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7fa59518d169
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffe40407c58 EFLAGS: 00000246 ORIG_RAX: 0000000000000014
RAX: ffffffffffffffda RBX: 00007fa5953a5fa0 RCX: 00007fa59518d169
RDX: 0000000000000001 RSI: 00002000000012c0 RDI: 0000000000000005
RBP: 00007fa59520e2a0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fa5953a5fa0 R14: 00007fa5953a5fa0 R15: 0000000000000003
</TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:mcp_i2c_xfer+0x5a/0x430 drivers/hid/hid-mcp2221.c:309
Code: 00 48 89 d8 48 c1 e8 03 80 3c 28 00 74 08 48 89 df e8 1a 9f c3 f9 4c 8b 33 4d 89 f4 49 c1 ec 03 48 b8 00 00 00 00 00 fc ff df <41> 80 3c 04 00 74 08 4c 89 f7 e8 f7 9e c3 f9 49 8b 1e 48 8d ab a8
RSP: 0018:ffffc90005d07898 EFLAGS: 00010246
RAX: dffffc0000000000 RBX: ffff8880798621d8 RCX: ffff88802df1bb80
RDX: 0000000000000000 RSI: ffffc90005d07b00 RDI: ffff888079862030
RBP: dffffc0000000000 R08: ffffffff870aab7f R09: ffffed100f30c4ba
R10: 0000000000000000 R11: dffffc0000000001 R12: 0000000000000000
R13: 0000000000000001 R14: 0000000000000000 R15: ffffc90005d07b00
FS: 000055556b5fc500(0000) GS:ffff8880b8f00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fb3c3e4aea0 CR3: 0000000027455000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
0: 00 48 89 add %cl,-0x77(%rax)
3: d8 48 c1 fmuls -0x3f(%rax)
6: e8 03 80 3c 28 call 0x283c800e
b: 00 74 08 48 add %dh,0x48(%rax,%rcx,1)
f: 89 df mov %ebx,%edi
11: e8 1a 9f c3 f9 call 0xf9c39f30
16: 4c 8b 33 mov (%rbx),%r14
19: 4d 89 f4 mov %r14,%r12
1c: 49 c1 ec 03 shr $0x3,%r12
20: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax
27: fc ff df
* 2a: 41 80 3c 04 00 cmpb $0x0,(%r12,%rax,1) <-- trapping instruction
2f: 74 08 je 0x39
31: 4c 89 f7 mov %r14,%rdi
34: e8 f7 9e c3 f9 call 0xf9c39f30
39: 49 8b 1e mov (%r14),%rbx
3c: 48 rex.W
3d: 8d .byte 0x8d
3e: ab stos %eax,%es:(%rdi)
3f: a8 .byte 0xa8


---

syzbot

unread,
May 16, 2025, 3:06:35 AM5/16/25
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 02b72ccb5f9d Linux 6.1.138
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=108e42d4580000
kernel config: https://syzkaller.appspot.com/x/.config?x=40498c8aeab367b8
dashboard link: https://syzkaller.appspot.com/bug?extid=03d875266c03a05c9ccb
compiler: Debian clang version 20.1.2 (++20250402124445+58df0ef89dd6-1~exp1~20250402004600.97), Debian LLD 20.1.2
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=15442e70580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1764f6f4580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/741917d96f57/disk-02b72ccb.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/b5e0c69249ae/vmlinux-02b72ccb.xz
kernel image: https://storage.googleapis.com/syzbot-assets/06bfb546fb37/bzImage-02b72ccb.xz

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

general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
CPU: 0 PID: 4404 Comm: syz-executor187 Not tainted 6.1.138-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/19/2025
RIP: 0010:mcp_i2c_xfer+0x58/0x420 drivers/hid/hid-mcp2221.c:309
Code: 01 00 00 48 89 d8 48 c1 e8 03 42 80 3c 30 00 74 08 48 89 df e8 79 bf 35 fa 48 8b 1b 48 89 d8 48 c1 e8 03 4d 89 f4 48 89 04 24 <42> 80 3c 30 00 74 08 48 89 df e8 59 bf 35 fa 4c 8b 33 4d 8d ae a8
RSP: 0018:ffffc90005f3fb30 EFLAGS: 00010246
RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffff88802cce3b80
RDX: 0000000000000000 RSI: ffff888141b78a40 RDI: ffff88806dd70030
RBP: 0000000000000002 R08: dffffc0000000000 R09: ffffed100dbae0ba
R10: ffffed100dbae0ba R11: 1ffff1100dbae0b9 R12: dffffc0000000000
R13: 1ffff1100dbae02b R14: dffffc0000000000 R15: ffff888141b78a40
FS: 000055557b2c5380(0000) GS:ffff8880b8e00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000200000002580 CR3: 0000000023acd000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
__i2c_transfer+0x864/0x2260 drivers/i2c/i2c-core-base.c:-1
i2c_transfer+0x24c/0x390 drivers/i2c/i2c-core-base.c:2333
i2cdev_ioctl_rdwr+0x3da/0x6c0 drivers/i2c/i2c-dev.c:297
i2cdev_ioctl+0x5ba/0x750 drivers/i2c/i2c-dev.c:458
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:870 [inline]
__se_sys_ioctl+0xfa/0x170 fs/ioctl.c:856
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7fda30309ed9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 17 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffe8b48da08 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000018cf6 RCX: 00007fda30309ed9
RDX: 0000200000002580 RSI: 0000000000000707 RDI: 0000000000000004
RBP: 0000000000000000 R08: 00232d6332692f76 R09: 0000000000000008
R10: 000000000000000f R11: 0000000000000246 R12: 00007ffe8b48da2c
R13: 00007ffe8b48da60 R14: 00007ffe8b48da40 R15: 0000000000000019
</TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:mcp_i2c_xfer+0x58/0x420 drivers/hid/hid-mcp2221.c:309
Code: 01 00 00 48 89 d8 48 c1 e8 03 42 80 3c 30 00 74 08 48 89 df e8 79 bf 35 fa 48 8b 1b 48 89 d8 48 c1 e8 03 4d 89 f4 48 89 04 24 <42> 80 3c 30 00 74 08 48 89 df e8 59 bf 35 fa 4c 8b 33 4d 8d ae a8
RSP: 0018:ffffc90005f3fb30 EFLAGS: 00010246
RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffff88802cce3b80
RDX: 0000000000000000 RSI: ffff888141b78a40 RDI: ffff88806dd70030
RBP: 0000000000000002 R08: dffffc0000000000 R09: ffffed100dbae0ba
R10: ffffed100dbae0ba R11: 1ffff1100dbae0b9 R12: dffffc0000000000
R13: 1ffff1100dbae02b R14: dffffc0000000000 R15: ffff888141b78a40
FS: 000055557b2c5380(0000) GS:ffff8880b8e00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fda303810f0 CR3: 0000000023acd000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
0: 01 00 add %eax,(%rax)
2: 00 48 89 add %cl,-0x77(%rax)
5: d8 48 c1 fmuls -0x3f(%rax)
8: e8 03 42 80 3c call 0x3c804210
d: 30 00 xor %al,(%rax)
f: 74 08 je 0x19
11: 48 89 df mov %rbx,%rdi
14: e8 79 bf 35 fa call 0xfa35bf92
19: 48 8b 1b mov (%rbx),%rbx
1c: 48 89 d8 mov %rbx,%rax
1f: 48 c1 e8 03 shr $0x3,%rax
23: 4d 89 f4 mov %r14,%r12
26: 48 89 04 24 mov %rax,(%rsp)
* 2a: 42 80 3c 30 00 cmpb $0x0,(%rax,%r14,1) <-- trapping instruction
2f: 74 08 je 0x39
31: 48 89 df mov %rbx,%rdi
34: e8 59 bf 35 fa call 0xfa35bf92
39: 4c 8b 33 mov (%rbx),%r14
3c: 4d rex.WRB
3d: 8d .byte 0x8d
3e: ae scas %es:(%rdi),%al
3f: a8 .byte 0xa8


---

syzbot

unread,
Aug 20, 2025, 11:16:05 PM8/20/25
to syzkaller...@googlegroups.com
syzbot suspects this issue was fixed by commit:

commit 0499d5d579d4e552f5c67d74e56b150de31369d5
Author: Hamish Martin <hamish...@alliedtelesis.co.nz>
Date: Wed Oct 25 03:55:10 2023 +0000

HID: mcp2221: Set driver data before I2C adapter add

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=130916f0580000
start commit: 02b72ccb5f9d Linux 6.1.138
git tree: linux-6.1.y
If the result looks correct, please mark the issue as fixed by replying with:

#syz fix: HID: mcp2221: Set driver data before I2C adapter add

For information about bisection process see: https://goo.gl/tpsmEJ#bisection
Reply all
Reply to author
Forward
0 new messages