From: Shuangpeng <shuangpeng.kernel@gmail.com>
To: bhelgaas@google.com
Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [BUG] PCI/VGA: KASAN slab-use-after-free in dev_driver_string from vga_arb_release
Date: Mon, 22 Jun 2026 00:01:18 -0400 [thread overview]
Message-ID: <330FD8DD-ECBF-4531-900E-5B976FA9DF90@gmail.com> (raw)
Hi Kernel Maintainers,
I hit the following report while testing current upstream kernel:
KASAN: slab-use-after-free in dev_driver_string from vga_arb_release
on commit: e8c2f9fdadee7cbc75134dc463c1e0d856d6e5c7 (May 25 2026)
The reproducer and .config files are here.
https://gist.github.com/shuangpengbai/47ec0715a0120beaacf5009460b90687
I'm happy to test debug patches or provide additional information.
Reported-by: Shuangpeng Bai <shuangpeng.kernel@gmail.com>
[ 250.268327][ T8342] ==================================================================
[ 250.271034][ T8342] BUG: KASAN: slab-use-after-free in dev_driver_string (drivers/base/core.c:2406)
[ 250.273371][ T8342] Read of size 8 at addr ffff88810aebc138 by task bash/8342
[ 250.274604][ T8342]
[ 250.275019][ T8342] CPU: 0 UID: 0 PID: 8342 Comm: bash Not tainted 7.1.0-rc5+ #106 PREEMPT(full)
[ 250.275027][ T8342] Hardware name: QEMU Ubuntu 24.04 PC v2 (i440FX + PIIX, arch_caps fix, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[ 250.275031][ T8342] Call Trace:
[ 250.275044][ T8342] <TASK>
[ 250.275049][ T8342] dump_stack_lvl (lib/dump_stack.c:94 lib/dump_stack.c:120)
[ 250.275108][ T8342] print_report (mm/kasan/report.c:378 mm/kasan/report.c:482)
[ 250.275177][ T8342] kasan_report (mm/kasan/report.c:595)
[ 250.275190][ T8342] dev_driver_string (drivers/base/core.c:2406)
[ 250.275196][ T8342] __dynamic_dev_dbg (lib/dynamic_debug.c:906)
[ 250.275228][ T8342] vga_arb_release (drivers/pci/vgaarb.c:1436)
[ 250.275245][ T8342] __fput (fs/file_table.c:510)
[ 250.275260][ T8342] fput_close_sync (fs/file_table.c:615)
[ 250.275265][ T8342] __x64_sys_close (fs/open.c:1507 fs/open.c:1492 fs/open.c:1492)
[ 250.275271][ T8342] do_syscall_64 (arch/x86/entry/syscall_64.c:63 arch/x86/entry/syscall_64.c:94)
[ 250.275327][ T8342] entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:121)
[ 250.275333][ T8342] RIP: 0033:0x7f65140dbc03
[ 250.275341][ T8342] Code: e9 37 ff ff ff e8 2d f9 01 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 64 8b 04 25 18 00 00 00 85 c0 75 14 b8 03 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 45 c3 0f 1f 40 00 48 83 ec 18 89 7c 24 0c e8
[ 250.275346][ T8342] RSP: 002b:00007ffce08e3808 EFLAGS: 00000246 ORIG_RAX: 0000000000000003
[ 250.275363][ T8342] RAX: ffffffffffffffda RBX: 0000564bd1808ba0 RCX: 00007f65140dbc03
[ 250.275367][ T8342] RDX: 00000000ffffffff RSI: 0000000000000001 RDI: 000000000000000a
[ 250.275371][ T8342] RBP: 00007ffce08e3890 R08: 0000000000000000 R09: 0000000000000000
[ 250.275374][ T8342] R10: 00007f651417efc0 R11: 0000000000000246 R12: 0000000000000009
[ 250.275377][ T8342] R13: 0000000000000009 R14: 000000000000000a R15: 0000000000000000
[ 250.275393][ T8342] </TASK>
[ 250.275395][ T8342]
[ 250.295059][ T8342] Freed by task 8342 on cpu 1 at 249.233016s:
[ 250.295689][ T8342] kasan_save_track (mm/kasan/common.c:57 mm/kasan/common.c:78)
[ 250.296168][ T8342] kasan_save_free_info (mm/kasan/generic.c:584)
[ 250.296682][ T8342] __kasan_slab_free (mm/kasan/common.c:253 mm/kasan/common.c:285)
[ 250.297176][ T8342] kfree (include/linux/kasan.h:235 mm/slub.c:2689 mm/slub.c:6251 mm/slub.c:6566)
[ 250.297593][ T8342] device_release (drivers/base/core.c:2570)
[ 250.298062][ T8342] kobject_put (lib/kobject.c:689 lib/kobject.c:720 include/linux/kref.h:65 lib/kobject.c:737)
[ 250.298528][ T8342] pci_stop_and_remove_bus_device_locked (drivers/pci/remove.c:132 drivers/pci/remove.c:139)
[ 250.299187][ T8342] remove_store (drivers/pci/pci-sysfs.c:525)
[ 250.299631][ T8342] kernfs_fop_write_iter (fs/kernfs/file.c:352)
[ 250.300179][ T8342] vfs_write (fs/read_write.c:595 fs/read_write.c:688)
[ 250.300622][ T8342] ksys_write (fs/read_write.c:740)
[ 250.301054][ T8342] do_syscall_64 (arch/x86/entry/syscall_64.c:63 arch/x86/entry/syscall_64.c:94)
[ 250.301525][ T8342] entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:121)
[ 250.302121][ T8342]
[ 250.302372][ T8342] The buggy address belongs to the object at ffff88810aebc000
[ 250.302372][ T8342] which belongs to the cache kmalloc-4k of size 4096
[ 250.303772][ T8342] The buggy address is located 312 bytes inside of
[ 250.303772][ T8342] freed 4096-byte region [ffff88810aebc000, ffff88810aebd000)
[ 250.305161][ T8342]
Best,
Shuangpeng
next reply other threads:[~2026-06-22 4:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-22 4:01 Shuangpeng [this message]
2026-06-30 16:30 ` [PATCH] PCI/VGA: vgaarb: Hold pci_dev references for per-file cards Shuangpeng Bai
2026-06-30 16:46 ` sashiko-bot
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=330FD8DD-ECBF-4531-900E-5B976FA9DF90@gmail.com \
--to=shuangpeng.kernel@gmail.com \
--cc=bhelgaas@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
/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.