WARNING in its_msi_teardown
Subsystems (2)
syzbot
syzbotHello,
syzbot found the following issue on:
HEAD commit: b66b0005b6ce Merge branches 'for-next/fixes' and 'for-next.. git tree: git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci console output: https://syzkaller.appspot.com/x/log.txt?x=15f7d746580000 kernel config: https://syzkaller.appspot.com/x/.config?x=72c97575381cec47 dashboard link: https://syzkaller.appspot.com/bug?extid=229d761b8a110e6de517 compiler: Debian clang version 22.1.8 (++20260613092233+e80beda6e255-1~exp1~20260613092250.77), Debian LLD 22.1.8 userspace arch: arm64 syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1667e09e580000 C reproducer: https://syzkaller.appspot.com/x/repro.c?x=17525fde580000
Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/63e3226301fe/disk-b66b0005.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/b268844cbd22/vmlinux-b66b0005.xz
kernel image: https://storage.googleapis.com/syzbot-assets/9440dfc93d1e/Image-b66b0005.gz.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
el0_svc_common+0xec/0x23c arch/arm64/kernel/syscall.c:121 do_el0_svc+0x4c/0x5c arch/arm64/kernel/syscall.c:140 el0_svc+0x64/0x260 arch/arm64/kernel/entry-common.c:736 el0t_64_sync_handler+0x48/0x148 arch/arm64/kernel/entry-common.c:755 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:594 ------------[ cut here ]------------ WARNING: drivers/irqchip/irq-gic-v3-its.c:2251 at its_lpi_free drivers/irqchip/irq-gic-v3-its.c:2251 [inline], CPU#0: syz.0.18/4916 WARNING: drivers/irqchip/irq-gic-v3-its.c:2251 at its_msi_teardown+0x3a4/0x424 drivers/irqchip/irq-gic-v3-its.c:3644, CPU#0: syz.0.18/4916 Modules linked in: CPU: 0 UID: 0 PID: 4916 Comm: syz.0.18 Not tainted syzkaller #0 PREEMPT Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/02/2026 pstate: 83400005 (Nzcv daif +PAN -UAO +TCO +DIT -SSBS BTYPE=--) pc : its_lpi_free drivers/irqchip/irq-gic-v3-its.c:2251 [inline] pc : its_msi_teardown+0x3a4/0x424 drivers/irqchip/irq-gic-v3-its.c:3644 lr : its_lpi_free drivers/irqchip/irq-gic-v3-its.c:2251 [inline] lr : its_msi_teardown+0x3a4/0x424 drivers/irqchip/irq-gic-v3-its.c:3644
sp : ffff800098017560
x29: ffff8000980175f0 x28: ffff0000cfc75930 x27: 1fffe00019f8eb26
x26: 1fffe00019f8eb22 x25: ffff0000c13e1000 x24: dfff800000000000
x23: ffff700013002eac x22: 00000000fffffff4 x21: ffff800098017580
x20: ffff0000c1e07ce0 x19: ffff0000cfc75900 x18: 00000000ffffffff
x17: 70202c31206c6176 x16: 0000000000000001 x15: 0000000000000000
x14: 0000000000000000 x13: 0000000000000001 x12: 0000000000000000
x11: 0000000000000000 x10: 0000000000000003 x9 : 0000000000000000 x8 : 0000000000000000 x7 : 0000000000000000 x6 : 0000000000000000 x5 : 00000000ffffffff x4 : 0000000000000cc0 x3 : ffff800081ba1c7c x2 : 00000000fffffff4 x1 : ffff0000cfb10000 x0 : 0000000000000000
Call trace: its_lpi_free drivers/irqchip/irq-gic-v3-its.c:2251 [inline] (P) its_msi_teardown+0x3a4/0x424 drivers/irqchip/irq-gic-v3-its.c:3644 (P) its_msi_teardown+0xa0/0xb8 drivers/irqchip/irq-gic-its-msi-parent.c:249 msi_remove_device_irq_domain+0x16c/0x27c kernel/irq/msi.c:1127 msi_device_data_release+0x38/0x9c kernel/irq/msi.c:293 dr_node_release+0x4c/0x5c drivers/base/devres.c:122 release_nodes+0xac/0x108 drivers/base/devres.c:546 devres_release_all+0x138/0x1a4 drivers/base/devres.c:576 device_unbind_cleanup+0x80/0x1c8 drivers/base/dd.c:597 __device_release_driver drivers/base/dd.c:1354 [inline] device_release_driver_internal+0x19c/0x20c drivers/base/dd.c:1372 device_release_driver+0x28/0x38 drivers/base/dd.c:1395 pci_stop_dev drivers/pci/remove.c:27 [inline] pci_stop_bus_device+0x108/0x14c drivers/pci/remove.c:93 pci_stop_and_remove_bus_device+0x84/0xd0 drivers/pci/remove.c:128 pci_stop_and_remove_bus_device_locked+0x24/0x38 drivers/pci/remove.c:136 remove_store+0xdc/0x148 drivers/pci/pci-sysfs.c:523 dev_attr_store+0x6c/0x90 drivers/base/core.c:2505 sysfs_kf_write+0xe0/0x108 fs/sysfs/file.c:145 kernfs_fop_write_iter+0x260/0x3b8 fs/kernfs/file.c:345 new_sync_write fs/read_write.c:595 [inline] vfs_write+0x51c/0xa0c fs/read_write.c:687 ksys_write+0x12c/0x228 fs/read_write.c:739 __do_sys_write fs/read_write.c:750 [inline] __se_sys_write fs/read_write.c:747 [inline] __arm64_sys_write+0x7c/0x90 fs/read_write.c:747 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x244 arch/arm64/kernel/syscall.c:49 el0_svc_common+0xec/0x23c arch/arm64/kernel/syscall.c:121 do_el0_svc+0x4c/0x5c arch/arm64/kernel/syscall.c:140 el0_svc+0x64/0x260 arch/arm64/kernel/entry-common.c:736 el0t_64_sync_handler+0x48/0x148 arch/arm64/kernel/entry-common.c:755 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:594 irq event stamp: 1608 hardirqs last enabled at (1607): [<ffff8000868e3f4c>] irqentry_exit_to_kernel_mode_after_preempt include/linux/irq-entry-common.h:507 [inline] hardirqs last enabled at (1607): [<ffff8000868e3f4c>] arm64_exit_to_kernel_mode+0x80/0x94 arch/arm64/kernel/entry-common.c:62 hardirqs last disabled at (1608): [<ffff8000868dfe78>] el1_brk64+0x20/0x54 arch/arm64/kernel/entry-common.c:425 softirqs last enabled at (1528): [<ffff800084c10fac>] __alloc_skb+0x1c0/0x610 net/core/skbuff.c:698 softirqs last disabled at (1526): [<ffff800084c10f94>] local_bh_disable include/linux/bottom_half.h:20 [inline] softirqs last disabled at (1526): [<ffff800084c10f94>] __alloc_skb+0x1a8/0x610 net/core/skbuff.c:697 ---[ end trace 0000000000000000 ]---
pci 0000:00:01.0: [1af4:1005] type 00 class 0x00ff00 conventional PCI endpoint pci 0000:00:01.0: BAR 0 [io 0x1000-0x101f]
pci 0000:00:01.0: BAR 1 [mem 0x10110080-0x101100bf]
pci 0000:00:01.0: BAR 1 [mem 0x10110080-0x101100bf]: assigned
pci 0000:00:01.0: BAR 0 [io 0x1000-0x101f]: assigned
virtio-pci 0000:00:01.0: virtio_pci: leaving for legacy driver
---
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 [email protected].
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 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.
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
syzbotForwarded: Re: [syzbot] [kernel?] WARNING in its_msi_teardown
For archival purposes, forwarding an incoming command email to [email protected], [email protected].
For archival purposes, forwarding an incoming command email to [email protected], [email protected].
***
Subject: Re: [syzbot] [kernel?] WARNING in its_msi_teardown
Author: [email protected]
#syz test
drivers/irqchip/irq-gic-v3-its.c +16 -15
@@ -2108,11 +2108,15 @@ static struct lpi_range *mk_lpi_range(u32 base, u32 span) {struct lpi_range *range; - range =kmalloc_obj (*range); -if (range) { - range->base_id = base; - range->span = span; - } +/* +* Handing a range back is not allowed to fail: the callers of +* free_lpi_range() have no way of reporting an error, and losing the +* range here would leak the LPIs for good. This is a small, order-0 +* request and lpi_range_lock is a mutex, so the context is sleepable. +*/ + range =kmalloc_obj (*range,GFP_KERNEL | __GFP_NOFAIL); + range->base_id = base; + range->span = span;return range; }
@@ -2158,13 +2162,11 @@ static void merge_lpi_ranges(struct lpi_range *a, struct lpi_range *b)kfree (a); } -static int free_lpi_range (u32 base,u32 nr_lpis) +static void free_lpi_range (u32 base,u32 nr_lpis) {struct lpi_range *new, *old; new =mk_lpi_range (base, nr_lpis); -if (!new) -return -ENOMEM ;mutex_lock (&lpi_range_lock);
@@ -2188,14 +2190,12 @@ static int free_lpi_range(u32 base, u32 nr_lpis)merge_lpi_ranges (new,list_next_entry (new, entry));mutex_unlock (&lpi_range_lock); -return 0 ; } -static int __init its_lpi_init (u32 id_bits) +static void __init its_lpi_init (u32 id_bits) {u32 lpis = (1UL << id_bits) -8192 ;u32 numlpis; -int err; numlpis =1UL <<GICD_TYPER_NUM_LPIS (gic_rdists->gicd_typer);
@@ -2209,9 +2209,8 @@ static int __init its_lpi_init(u32 id_bits)* Initializing the allocator is just the same as freeing the * full range of LPIs. */ - err =free_lpi_range (8192 , lpis); +free_lpi_range (8192 , lpis);pr_debug ("ITS: Allocator initialized for %u LPIs\n" , lpis); -return err; }static unsigned long *its_lpi_alloc (int nr_irqs,u32 *base,int *nr_ids)
@@ -2248,7 +2247,7 @@ static unsigned long *its_lpi_alloc(int nr_irqs, u32 *base, int *nr_ids)static void its_lpi_free (unsigned long *bitmap,u32 base,u32 nr_ids) { -WARN_ON (free_lpi_range (base, nr_ids)); +free_lpi_range (base, nr_ids);bitmap_free (bitmap); }
@@ -2349,7 +2348,9 @@ static int __init its_setup_lpi_prop_table(void)pr_info ("GICv3: using LPI property table @%pa\n" , &gic_rdists->prop_table_pa); -return its_lpi_init (lpi_id_bits); +its_lpi_init (lpi_id_bits); + +return 0 ; }static const char *its_base_type_string[] = {
Marc Zyngier
maintainerQuoted 50 lines · syzbot
Hello,
syzbot found the following issue on:
HEAD commit: b66b0005b6ce Merge branches 'for-next/fixes' and 'for-next.. git tree: git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci console output: https://syzkaller.appspot.com/x/log.txt?x=15f7d746580000 kernel config: https://syzkaller.appspot.com/x/.config?x=72c97575381cec47 dashboard link: https://syzkaller.appspot.com/bug?extid=229d761b8a110e6de517 compiler: Debian clang version 22.1.8 (++20260613092233+e80beda6e255-1~exp1~20260613092250.77), Debian LLD 22.1.8 userspace arch: arm64 syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1667e09e580000 C reproducer: https://syzkaller.appspot.com/x/repro.c?x=17525fde580000Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/63e3226301fe/disk-b66b0005.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/b268844cbd22/vmlinux-b66b0005.xz
kernel image: https://storage.googleapis.com/syzbot-assets/9440dfc93d1e/Image-b66b0005.gz.xzIMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by [email protected]el0_svc_common+0xec/0x23c arch/arm64/kernel/syscall.c:121 do_el0_svc+0x4c/0x5c arch/arm64/kernel/syscall.c:140 el0_svc+0x64/0x260 arch/arm64/kernel/entry-common.c:736 el0t_64_sync_handler+0x48/0x148 arch/arm64/kernel/entry-common.c:755 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:594 ------------[ cut here ]------------ WARNING: drivers/irqchip/irq-gic-v3-its.c:2251 at its_lpi_free drivers/irqchip/irq-gic-v3-its.c:2251 [inline], CPU#0: syz.0.18/4916 WARNING: drivers/irqchip/irq-gic-v3-its.c:2251 at its_msi_teardown+0x3a4/0x424 drivers/irqchip/irq-gic-v3-its.c:3644, CPU#0: syz.0.18/4916 Modules linked in: CPU: 0 UID: 0 PID: 4916 Comm: syz.0.18 Not tainted syzkaller #0 PREEMPT Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/02/2026 pstate: 83400005 (Nzcv daif +PAN -UAO +TCO +DIT -SSBS BTYPE=--) pc : its_lpi_free drivers/irqchip/irq-gic-v3-its.c:2251 [inline] pc : its_msi_teardown+0x3a4/0x424 drivers/irqchip/irq-gic-v3-its.c:3644 lr : its_lpi_free drivers/irqchip/irq-gic-v3-its.c:2251 [inline] lr : its_msi_teardown+0x3a4/0x424 drivers/irqchip/irq-gic-v3-its.c:3644sp :
ffff800098017560
x29:ffff8000980175f0x28:ffff0000cfc75930x27:1fffe00019f8eb26
x26:1fffe00019f8eb22x25:ffff0000c13e1000x24:dfff800000000000
x23:ffff700013002eacx22:00000000fffffff4x21:ffff800098017580
x20:ffff0000c1e07ce0x19:ffff0000cfc75900x18:00000000ffffffff
x17:70202c31206c6176x16: 0000000000000001 x15: 0000000000000000
x14: 0000000000000000 x13: 0000000000000001 x12: 0000000000000000
x11: 0000000000000000 x10: 0000000000000003 x9 : 0000000000000000 x8 : 0000000000000000 x7 : 0000000000000000 x6 : 0000000000000000 x5 :00000000ffffffffx4 :0000000000000cc0x3 :ffff800081ba1c7cx2 :00000000fffffff4x1 :ffff0000cfb10000x0 : 0000000000000000
Quoted 4 lines
Call trace: its_lpi_free drivers/irqchip/irq-gic-v3-its.c:2251 [inline] (P) its_msi_teardown+0x3a4/0x424 drivers/irqchip/irq-gic-v3-its.c:3644 (P) its_msi_teardown+0xa0/0xb8 drivers/irqchip/irq-gic-its-msi-parent.c:249
That's an allocation failure, caused by a fault injection. We end-up leaking LPIs, but there isn't much we can do about that if we can't allocate the correct tracking structure.
So yes, we WARN() about this, and carry on.
M.
Signature · 1 line
Without deviation from the norm, progress is not possible.