syzbot


general protection fault in sg_write

Status: auto-closed as invalid on 2022/05/06 13:03
Reported-by: syzbot+c5f0c0e7db25a1c83fd1@syzkaller.appspotmail.com
First crash: 1062d, last: 1062d

Sample crash report:
kasan: CONFIG_KASAN_INLINE enabled
kasan: GPF could be caused by NULL-ptr deref or user memory access
general protection fault: 0000 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 19234 Comm: syz-executor.1 Not tainted 4.19.211-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:trace_event_get_offsets_lock_acquire include/trace/events/lock.h:13 [inline]
RIP: 0010:perf_trace_lock_acquire+0x9d/0x530 include/trace/events/lock.h:13
Code: 04 f1 f1 04 f2 c7 40 08 00 f3 f3 f3 65 48 8b 04 25 28 00 00 00 48 89 45 d0 31 c0 48 8d 46 18 48 89 85 40 ff ff ff 48 c1 e8 03 <80> 3c 10 00 0f 85 4f 03 00 00 49 8b 7d 18 48 c7 c0 80 14 6a 88 48
RSP: 0018:ffff88809058f358 EFLAGS: 00010002
 sg_new_write.isra.0+0x6f4/0xa10 drivers/scsi/sg.c:785
RAX: 0000000000000025 RBX: ffff8880b48ceea8 RCX: 0000000000000000
RDX: dffffc0000000000 RSI: 0000000000000110 RDI: ffffffff89f6d420
RBP: ffff88809058f440 R08: 0000000000000000 R09: 0000000000000001
R10: 0000000000000001 R11: 0000000000000000 R12: ffffffff89f6d420
R13: 0000000000000110 R14: 0000000000000000 R15: ffff88809058f418
FS:  00007f9350ab5700(0000) GS:ffff8880ba000000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f514791b000 CR3: 000000009b2f4000 CR4: 00000000003406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 sg_write.part.0+0xa57/0xe20 drivers/scsi/sg.c:643
 trace_lock_acquire include/trace/events/lock.h:13 [inline]
 lock_acquire+0x298/0x3c0 kernel/locking/lockdep.c:3907
 flush_workqueue+0x117/0x13e0 kernel/workqueue.c:2661
 nbd_disconnect_and_put+0x100/0x190 drivers/block/nbd.c:1928
 nbd_genl_disconnect+0x34f/0x4f0 drivers/block/nbd.c:1966
 sg_write+0x69/0xa0 drivers/scsi/sg.c:622
 do_loop_readv_writev fs/read_write.c:704 [inline]
 do_loop_readv_writev fs/read_write.c:688 [inline]
 do_iter_write+0x461/0x5d0 fs/read_write.c:962
 vfs_writev+0x153/0x2e0 fs/read_write.c:1005
 genl_family_rcv_msg+0x642/0xc40 net/netlink/genetlink.c:602
 genl_rcv_msg+0xbf/0x160 net/netlink/genetlink.c:627
 netlink_rcv_skb+0x160/0x440 net/netlink/af_netlink.c:2463
 do_writev+0x136/0x330 fs/read_write.c:1040
 genl_rcv+0x24/0x40 net/netlink/genetlink.c:638
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 netlink_unicast_kernel net/netlink/af_netlink.c:1325 [inline]
 netlink_unicast+0x4d5/0x690 net/netlink/af_netlink.c:1351
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7fe38df7ce99
 netlink_sendmsg+0x6c3/0xc50 net/netlink/af_netlink.c:1917
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 bc ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fe38c8f2168 EFLAGS: 00000246 ORIG_RAX: 0000000000000014
RAX: ffffffffffffffda RBX: 00007fe38e08ff60 RCX: 00007fe38df7ce99
RDX: 0000000000000002 RSI: 0000000020000000 RDI: 0000000000000003
 sock_sendmsg_nosec net/socket.c:651 [inline]
 sock_sendmsg+0xc3/0x120 net/socket.c:661
 ___sys_sendmsg+0x7bb/0x8e0 net/socket.c:2227
RBP: 00007fe38c8f21d0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000002
R13: 00007ffcd74e13df R14: 00007fe38c8f2300 R15: 0000000000022000
new mount options do not match the existing superblock, will be ignored
 __sys_sendmsg net/socket.c:2265 [inline]
 __do_sys_sendmsg net/socket.c:2274 [inline]
 __se_sys_sendmsg net/socket.c:2272 [inline]
 __x64_sys_sendmsg+0x132/0x220 net/socket.c:2272
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7f9352160e99
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 bc ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f9350ab5168 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00007f9352274030 RCX: 00007f9352160e99
RDX: 0000000000000000 RSI: 0000000020000240 RDI: 0000000000000006
RBP: 00007f93521baff1 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fff28d94b7f R14: 00007f9350ab5300 R15: 0000000000022000
Modules linked in:
---[ end trace 8fd1dedc0310f268 ]---
RIP: 0010:trace_event_get_offsets_lock_acquire include/trace/events/lock.h:13 [inline]
RIP: 0010:perf_trace_lock_acquire+0x9d/0x530 include/trace/events/lock.h:13
Code: 04 f1 f1 04 f2 c7 40 08 00 f3 f3 f3 65 48 8b 04 25 28 00 00 00 48 89 45 d0 31 c0 48 8d 46 18 48 89 85 40 ff ff ff 48 c1 e8 03 <80> 3c 10 00 0f 85 4f 03 00 00 49 8b 7d 18 48 c7 c0 80 14 6a 88 48
RSP: 0018:ffff88809058f358 EFLAGS: 00010002
RAX: 0000000000000025 RBX: ffff8880b48ceea8 RCX: 0000000000000000
RDX: dffffc0000000000 RSI: 0000000000000110 RDI: ffffffff89f6d420
RBP: ffff88809058f440 R08: 0000000000000000 R09: 0000000000000001
R10: 0000000000000001 R11: 0000000000000000 R12: ffffffff89f6d420
R13: 0000000000000110 R14: 0000000000000000 R15: ffff88809058f418
FS:  00007f9350ab5700(0000) GS:ffff8880ba000000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f514791b000 CR3: 000000009b2f4000 CR4: 00000000003406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	04 f1                	add    $0xf1,%al
   2:	f1                   	icebp
   3:	04 f2                	add    $0xf2,%al
   5:	c7 40 08 00 f3 f3 f3 	movl   $0xf3f3f300,0x8(%rax)
   c:	65 48 8b 04 25 28 00 	mov    %gs:0x28,%rax
  13:	00 00
  15:	48 89 45 d0          	mov    %rax,-0x30(%rbp)
  19:	31 c0                	xor    %eax,%eax
  1b:	48 8d 46 18          	lea    0x18(%rsi),%rax
  1f:	48 89 85 40 ff ff ff 	mov    %rax,-0xc0(%rbp)
  26:	48 c1 e8 03          	shr    $0x3,%rax
* 2a:	80 3c 10 00          	cmpb   $0x0,(%rax,%rdx,1) <-- trapping instruction
  2e:	0f 85 4f 03 00 00    	jne    0x383
  34:	49 8b 7d 18          	mov    0x18(%r13),%rdi
  38:	48 c7 c0 80 14 6a 88 	mov    $0xffffffff886a1480,%rax
  3f:	48                   	rex.W

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/01/06 13:02 linux-4.19.y 3f8a27f9e27b 6acc789a .config console log report info ci2-linux-4-19 general protection fault in sg_write
* Struck through repros no longer work on HEAD.