From: syzbot <syzbot+87bb32e345aa80c0554b@syzkaller.appspotmail.com>
To: kapoorarnav43@gmail.com
Cc: kapoorarnav43@gmail.com, linux-kernel@vger.kernel.org,
syzkaller-bugs@googlegroups.com
Subject: Re: Private message regarding: [syzbot] [pci?] WARNING in pci_scan_single_device (2)
Date: Tue, 20 Jan 2026 23:00:55 -0800 [thread overview]
Message-ID: <697079a7.a00a0220.3ad28e.4e2e.GAE@google.com> (raw)
In-Reply-To: <ceecf9ca-065f-43f2-9652-ce3f2b79225en@googlegroups.com>
> #syz test
>
> From: Arnav Kapoor <kapoorarnav43@gmail.com>
> Date: Tue, 21 Jan 2026 05:30:00 +0530
> Subject: [PATCH] PCI: Replace WARN_ON with proper error handling in
> pci_device_add
>
> The WARN_ON macro in pci_device_add triggers kernel warnings when
> device_add()
> fails due to memory pressure or error injection. This is inappropriate for
> normal error conditions that can occur in fuzzing scenarios.
>
> Replace WARN_ON with proper error handling and logging:
> - Convert firmware device_add failure to error logging
> - Convert kernel device_add failure to error logging and cleanup
> - Properly handle failure cases without triggering spurious warnings
>
> Reported-by: syzbot+87bb32e345aa80c0554b@syzkaller.appspotmail.com
> Signed-off-by: Arnav Kapoor <kapoorarnav43@gmail.com>
> ---
> drivers/pci/probe.c | 14 ++++++++++++--
> 1 file changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
> index 669e7c519..9238ec951 100644
> --- a/drivers/pci/probe.c
> +++ b/drivers/pci/probe.c
> @@ -2795,16 +2795,26 @@ void pci_device_add(struct pci_dev *dev, struct
> pci_bus *bus)
> ret = pcibios_device_add(dev);
> - WARN_ON(ret < 0);
> + if (ret < 0) {
> + pci_warn(dev, "pcibios_device_add failed\n");
> + }
>
> /* Set up MSI IRQ domain */
> pci_set_msi_domain(dev);
>
> /* Notifier could use PCI capabilities */
> ret = device_add(&dev->dev);
> - WARN_ON(ret < 0);
> + if (ret < 0) {
> + pci_warn(dev, "device_add failed\n");
> + /* Clean up the device from the bus list */
> + down_write(&pci_bus_sem);
> + list_del(&dev->bus_list);
> + up_write(&pci_bus_sem);
> + return;
> + }
>
> /* Establish pdev->tsm for newly added (e.g. new SR-IOV VFs) */
> pci_tsm_init(dev);
>
> pci_npem_create(dev);
>
> pci_doe_sysfs_init(dev);
> }
>
> --
> 2.43.0
>
> On Wednesday, 21 January 2026 at 05:38:30 UTC+5:30 syzbot wrote:
>
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit: 983d014aafb1 kernel: modules: Add SPDX license identifier ..
> git tree: upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=10658852580000
> kernel config: https://syzkaller.appspot.com/x/.config?x=ae589cd0a6acd9be
> dashboard link: https://syzkaller.appspot.com/bug?extid=87bb32e345aa80c0554b
> compiler: gcc (Debian 12.2.0-14+deb12u1) 12.2.0, 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/8a294469166c/disk-983d014a.raw.xz
> vmlinux:
> https://storage.googleapis.com/syzbot-assets/f9504a6df5a7/vmlinux-983d014a.xz
> kernel image:
> https://storage.googleapis.com/syzbot-assets/88a1d939d6af/bzImage-983d014a.xz
>
> IMPORTANT: if you fix the issue, please add the following tag to the
> commit:
> Reported-by: syzbot+87bb32...@syzkaller.appspotmail.com
>
> ------------[ cut here ]------------
> WARNING: drivers/pci/probe.c:2800 at pci_device_add+0x105e/0x1490
> drivers/pci/probe.c:2800, CPU#0: syz.5.1730/14510
> Modules linked in:
> CPU: 0 UID: 0 PID: 14510 Comm: syz.5.1730 Tainted: G U L syzkaller #0
> PREEMPT(full)
> Tainted: [U]=USER, [L]=SOFTLOCKUP
> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
> Google 10/25/2025
> RIP: 0010:pci_device_add+0x105e/0x1490 drivers/pci/probe.c:2800
> Code: e5 04 83 e0 8f 09 e8 88 83 c0 00 00 00 e9 ef f2 ff ff e8 85 7a d6 fc
> 90 0f 0b 90 90 0f 0b 90 e9 ee f4 ff ff e8 73 7a d6 fc 90 <0f> 0b 90 e9 c1
> f7 ff ff e8 65 7a d6 fc 90 0f 0b 90 e9 54 f7 ff ff
> RSP: 0018:ffffc9000bb5f938 EFLAGS: 00010283
> RAX: 000000000003659d RBX: 00000000fffffff4 RCX: ffffc90015bd3000
> RDX: 0000000000080000 RSI: ffffffff84e7e38d RDI: 0000000000000005
> RBP: ffff88801bae0400 R08: 0000000000000005 R09: 0000000000000000
> R10: 00000000fffffff4 R11: ffffffff81000130 R12: ffff888142e87028
> R13: ffff888142e87000 R14: 0000000000000001 R15: ffff888142ea2000
> FS: 00007fa6b528e6c0(0000) GS:ffff8881248f9000(0000) knlGS:0000000000000000
> CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> CR2: 000020000058e000 CR3: 000000007e2d4000 CR4: 00000000003526f0
> Call Trace:
> <TASK>
> pci_scan_single_device drivers/pci/probe.c:2824 [inline]
> pci_scan_single_device+0x252/0x310 drivers/pci/probe.c:2810
> pci_scan_slot+0x1c0/0x760 drivers/pci/probe.c:2907
> pci_scan_child_bus_extend+0x6b/0x7d0 drivers/pci/probe.c:3126
> pci_scan_child_bus drivers/pci/probe.c:3239 [inline]
> pci_rescan_bus+0x18/0x40 drivers/pci/probe.c:3530
> rescan_store+0xfb/0x130 drivers/pci/pci-sysfs.c:472
> bus_attr_store+0x74/0xb0 drivers/base/bus.c:172
> sysfs_kf_write+0xf2/0x150 fs/sysfs/file.c:142
> kernfs_fop_write_iter+0x3af/0x570 fs/kernfs/file.c:352
> new_sync_write fs/read_write.c:593 [inline]
> vfs_write+0x7d3/0x11d0 fs/read_write.c:686
> ksys_write+0x12a/0x250 fs/read_write.c:738
> do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
> do_syscall_64+0xcd/0xf80 arch/x86/entry/syscall_64.c:94
> entry_SYSCALL_64_after_hwframe+0x77/0x7f
> RIP: 0033:0x7fa6b438f7c9
> 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:00007fa6b528e038 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
> RAX: ffffffffffffffda RBX: 00007fa6b45e5fa0 RCX: 00007fa6b438f7c9
> RDX: 0000000000000001 RSI: 0000200000000200 RDI: 0000000000000003
> RBP: 00007fa6b4413f91 R08: 0000000000000000 R09: 0000000000000000
> R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
> R13: 00007fa6b45e6038 R14: 00007fa6b45e5fa0 R15: 00007ffd9a287b48
> </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
>
Command #1:
This crash does not have a reproducer. I cannot test it.
parent reply other threads:[~2026-01-21 7:00 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <ceecf9ca-065f-43f2-9652-ce3f2b79225en@googlegroups.com>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=697079a7.a00a0220.3ad28e.4e2e.GAE@google.com \
--to=syzbot+87bb32e345aa80c0554b@syzkaller.appspotmail.com \
--cc=kapoorarnav43@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=syzkaller-bugs@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.