[syzbot] [scsi?] WARNING in sg_remove_sfp_usercontext

17 views
Skip to first unread message

syzbot

unread,
Mar 28, 2024, 10:31:25 AMMar 28
to dgil...@interlog.com, je...@linux.ibm.com, linux-...@vger.kernel.org, linux...@vger.kernel.org, martin....@oracle.com, syzkall...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: a6bd6c933339 Add linux-next specific files for 20240328
git tree: linux-next
console output: https://syzkaller.appspot.com/x/log.txt?x=126f4231180000
kernel config: https://syzkaller.appspot.com/x/.config?x=b0058bda1436e073
dashboard link: https://syzkaller.appspot.com/bug?extid=93cdc797590ffc710918
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/7c1618ff7d25/disk-a6bd6c93.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/875519f620fe/vmlinux-a6bd6c93.xz
kernel image: https://storage.googleapis.com/syzbot-assets/ad92b057fb96/bzImage-a6bd6c93.xz

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

------------[ cut here ]------------
WARNING: CPU: 1 PID: 46 at drivers/scsi/sg.c:2236 sg_remove_sfp_usercontext+0x3f3/0x530 drivers/scsi/sg.c:2236
Modules linked in:
CPU: 1 PID: 46 Comm: kworker/1:1 Not tainted 6.9.0-rc1-next-20240328-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
Workqueue: events sg_remove_sfp_usercontext
RIP: 0010:sg_remove_sfp_usercontext+0x3f3/0x530 drivers/scsi/sg.c:2236
Code: 8b 36 49 8d 96 4d 01 00 00 48 c7 c7 a0 fe 4b 8c 48 c7 c1 c0 07 4c 8c 4d 89 e0 e8 d8 a3 eb ff e9 f7 fe ff ff e8 8e 9d 74 fb 90 <0f> 0b 90 e9 3f ff ff ff e8 80 9d 74 fb 48 8b 44 24 08 48 b9 00 00
RSP: 0018:ffffc90000b67b48 EFLAGS: 00010293
RAX: ffffffff8620cd42 RBX: 0000000000000002 RCX: ffff888015171e00
RDX: 0000000000000000 RSI: 0000000000000002 RDI: 0000000000000001
RBP: 0000000000008000 R08: ffffffff8620cc7c R09: 1ffff1100412372f
R10: dffffc0000000000 R11: ffffed1004123730 R12: ffff88805fb20000
R13: ffff88805fb21688 R14: ffff88802091b978 R15: ffff88805fb20148
FS: 0000000000000000(0000) GS:ffff8880b9500000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000001b32227000 CR3: 0000000068468000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
process_one_work kernel/workqueue.c:3218 [inline]
process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3299
worker_thread+0x86d/0xd70 kernel/workqueue.c:3380
kthread+0x2f0/0x390 kernel/kthread.c:388
ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:243
</TASK>


---
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, 2024, 6:40:35 PMMar 28
to dgil...@interlog.com, je...@linux.ibm.com, linux-...@vger.kernel.org, linux...@vger.kernel.org, martin....@oracle.com, syzkall...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: a6bd6c933339 Add linux-next specific files for 20240328
git tree: linux-next
console+strace: https://syzkaller.appspot.com/x/log.txt?x=17e3ac29180000
kernel config: https://syzkaller.appspot.com/x/.config?x=b0058bda1436e073
dashboard link: https://syzkaller.appspot.com/bug?extid=93cdc797590ffc710918
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=14c87791180000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1013ac29180000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/7c1618ff7d25/disk-a6bd6c93.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/875519f620fe/vmlinux-a6bd6c93.xz
kernel image: https://storage.googleapis.com/syzbot-assets/ad92b057fb96/bzImage-a6bd6c93.xz

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

------------[ cut here ]------------
WARNING: CPU: 1 PID: 24 at drivers/scsi/sg.c:2236 sg_remove_sfp_usercontext+0x3f3/0x530 drivers/scsi/sg.c:2236
Modules linked in:
CPU: 1 PID: 24 Comm: kworker/1:0 Not tainted 6.9.0-rc1-next-20240328-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
Workqueue: events sg_remove_sfp_usercontext
RIP: 0010:sg_remove_sfp_usercontext+0x3f3/0x530 drivers/scsi/sg.c:2236
Code: 8b 36 49 8d 96 4d 01 00 00 48 c7 c7 a0 fe 4b 8c 48 c7 c1 c0 07 4c 8c 4d 89 e0 e8 d8 a3 eb ff e9 f7 fe ff ff e8 8e 9d 74 fb 90 <0f> 0b 90 e9 3f ff ff ff e8 80 9d 74 fb 48 8b 44 24 08 48 b9 00 00
RSP: 0018:ffffc900001e7b48 EFLAGS: 00010293
RAX: ffffffff8620cd42 RBX: 0000000000000002 RCX: ffff8880176f8000
RDX: 0000000000000000 RSI: 0000000000000002 RDI: 0000000000000001
RBP: 0000000000008000 R08: ffffffff8620cc7c R09: 1ffff11003fccfaf
R10: dffffc0000000000 R11: ffffed1003fccfb0 R12: ffff888022830000
R13: ffff888022831688 R14: ffff88801fe67d78 R15: ffff888022830148
FS: 0000000000000000(0000) GS:ffff8880b9500000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000005fdeb8 CR3: 000000000e134000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
process_one_work kernel/workqueue.c:3218 [inline]
process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3299
worker_thread+0x86d/0xd70 kernel/workqueue.c:3380
kthread+0x2f0/0x390 kernel/kthread.c:388
ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:243
</TASK>


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

Pengfei Xu

unread,
Apr 4, 2024, 7:06:07 AMApr 4
to syzbot, dgil...@interlog.com, je...@linux.ibm.com, linux-...@vger.kernel.org, linux...@vger.kernel.org, martin....@oracle.com, syzkall...@googlegroups.com, pengf...@intel.com, Alex...@wetzel-home.de
cc Alexander Wetzel,

I used syzkaller and found the similar problem.

And bisected and found the related commit:
27f58c04a8f4 scsi: sg: Avoid sg device teardown race
Reverted the commit on top of v6.9-rc2, this issue was gone.

All detailed info: https://github.com/xupengfe/syzkaller_logs/tree/main/240401_231147_sg_remove_sfp_usercontext
Bisect log: https://github.com/xupengfe/syzkaller_logs/blob/main/240401_231147_sg_remove_sfp_usercontext/bisect_info.log
Kconfig(make olddefconfig): https://github.com/xupengfe/syzkaller_logs/blob/main/240401_231147_sg_remove_sfp_usercontext/kconfig_origin
v6.9-rc2 bzImage: https://github.com/xupengfe/syzkaller_logs/raw/main/240401_231147_sg_remove_sfp_usercontext/bzImage_v6.9-rc2.tar.gz
Reproduced code: https://github.com/xupengfe/syzkaller_logs/blob/main/240401_231147_sg_remove_sfp_usercontext/repro.c
Syscall reproduced steps: https://github.com/xupengfe/syzkaller_logs/blob/main/240401_231147_sg_remove_sfp_usercontext/repro.prog

I hope it's helpful and if it could be fixed.
Feel free to add the reported-by tag from me.

Best Regards,
Thanks!

Alexander Wetzel

unread,
Apr 4, 2024, 8:05:34 AMApr 4
to Pengfei Xu, syzbot, dgil...@interlog.com, je...@linux.ibm.com, linux-...@vger.kernel.org, linux...@vger.kernel.org, martin....@oracle.com, syzkall...@googlegroups.com
On 04.04.24 12:57, Pengfei Xu wrote:
> cc Alexander Wetzel,
>
> I used syzkaller and found the similar problem.
>
> And bisected and found the related commit:
> 27f58c04a8f4 scsi: sg: Avoid sg device teardown race
> Reverted the commit on top of v6.9-rc2, this issue was gone.

There were now multiple reports about the issue. The first (main)
discussion and fix is here:
https://lore.kernel.org/all/20240401191038.1...@wetzel-home.de/

In a nutshell:
The new WARN_ON_ONCE() was a (very) stupid idea and must be undone.
It's ok to just drop the line with the WARN_ON_ONCE(). The rest of the
proposed patch fixes a much less urgent issue.

Of course I can also break the fix into two patches, when this speeds up
the merge...

Alexander

Pengfei Xu

unread,
Apr 7, 2024, 6:55:14 AMApr 7
to Alexander Wetzel, syzbot, dgil...@interlog.com, je...@linux.ibm.com, linux-...@vger.kernel.org, linux...@vger.kernel.org, martin....@oracle.com, syzkall...@googlegroups.com
Hi Alexander,

On 2024-04-04 at 14:05:12 +0200, Alexander Wetzel wrote:
> On 04.04.24 12:57, Pengfei Xu wrote:
> > cc Alexander Wetzel,
> >
> > I used syzkaller and found the similar problem.
> >
> > And bisected and found the related commit:
> > 27f58c04a8f4 scsi: sg: Avoid sg device teardown race
> > Reverted the commit on top of v6.9-rc2, this issue was gone.
>
> There were now multiple reports about the issue. The first (main) discussion
> and fix is here:
> https://lore.kernel.org/all/20240401191038.1...@wetzel-home.de/
>
> In a nutshell:
> The new WARN_ON_ONCE() was a (very) stupid idea and must be undone.
> It's ok to just drop the line with the WARN_ON_ONCE(). The rest of the
> proposed patch fixes a much less urgent issue.

Got it, thanks for your description!

>
> Of course I can also break the fix into two patches, when this speeds up the
> merge...

Thank you, if it makes sense and accelerates the merge process.

Best Regards,
Thanks1

>
> Alexander
Reply all
Reply to author
Forward
0 new messages