From: Shuangpeng Bai <shuangpeng.kernel@gmail.com>
To: mst@redhat.com, jasowang@redhat.com, xuanzhuo@linux.alibaba.com,
eperezma@redhat.com, xieyongji@bytedance.com,
virtualization@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: [BUG] KASAN: slab-use-after-free in mutex_lock from vduse
Date: Sun, 14 Jun 2026 18:11:10 -0400 [thread overview]
Message-ID: <178144969601.60470.3373689816332131174@gmail.com> (raw)
Hi Kernel Maintainers,
I hit the following report while testing current upstream kernel:
KASAN: slab-use-after-free in mutex_lock from vduse
I reproduced this on commit: e8c2f9fdadee7cbc75134dc463c1e0d856d6e5c7 (May 25 2026)
To help trigger the bug more reliably, we applied a minimal diagnostic patch
that only adds delays and print statements.
The reproducer and .config files are here.
https://gist.github.com/shuangpengbai/947d604f1b5d86d8b7a3c7a4000455ad
I'm happy to test debug patches or provide additional information.
Reported-by: Shuangpeng Bai <shuangpeng.kernel@gmail.com>
[ 111.459938][ T8370] BUG: KASAN: slab-use-after-free in mutex_lock (include/linux/instrumented.h:112 include/linux/atomic/atomic-instrumented.h:4456 kernel/locking/mutex.c:161 kernel/locking/mutex.c:318)
[ 111.460790][ T8370] Write of size 8 at addr ffff88811bb7a028 by task vduse_open_dest/8370
[ 111.461901][ T8370]
[ 111.462229][ T8370] 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
[ 111.462233][ T8370] Call Trace:
[ 111.462238][ T8370] <TASK>
[ 111.462240][ T8370] dump_stack_lvl (lib/dump_stack.c:94 lib/dump_stack.c:120)
[ 111.462249][ T8370] print_report (mm/kasan/report.c:378 mm/kasan/report.c:482)
[ 111.462265][ T8370] kasan_report (mm/kasan/report.c:595)
[ 111.462285][ T8370] kasan_check_range (mm/kasan/generic.c:? mm/kasan/generic.c:200)
[ 111.462290][ T8370] mutex_lock (include/linux/instrumented.h:112 include/linux/atomic/atomic-instrumented.h:4456 kernel/locking/mutex.c:161 kernel/locking/mutex.c:318)
[ 111.462311][ T8370] vduse_dev_open (drivers/vdpa/vdpa_user/vduse_dev.c:1663)
[ 111.462327][ T8370] chrdev_open (fs/char_dev.c:411)
[ 111.462347][ T8370] do_dentry_open (fs/open.c:947)
[ 111.462356][ T8370] vfs_open (fs/open.c:1079)
[ 111.462361][ T8370] path_openat (fs/namei.c:4699 fs/namei.c:4858)
[ 111.462384][ T8370] do_file_open (fs/namei.c:4887)
[ 111.462436][ T8370] do_sys_openat2 (fs/open.c:1364)
[ 111.462462][ T8370] __x64_sys_openat (fs/open.c:1370 fs/open.c:1386 fs/open.c:1381 fs/open.c:1381)
[ 111.462479][ T8370] do_syscall_64 (arch/x86/entry/syscall_64.c:63 arch/x86/entry/syscall_64.c:94)
[ 111.462486][ T8370] entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:121)
[ 111.462492][ T8370] RIP: 0033:0x7facc56097e4
[ 111.462497][ T8370] Code: 84 00 00 00 00 00 44 89 54 24 0c e8 36 f5 ff ff 44 8b 54 24 0c 44 89 e2 48 89 ee 41 89 c0 bf 9c ff ff ff b8 01 01 00 00 0f 05 <48> 3d 00 f0 ff ff 77 34 44 89 c7 89 44 24 0c e8 68 f5 ff ff 8b 44
[ 111.462502][ T8370] RSP: 002b:00007facc2418e70 EFLAGS: 00000293 ORIG_RAX: 0000000000000101
[ 111.462509][ T8370] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007facc56097e4
[ 111.462512][ T8370] RDX: 0000000000080002 RSI: 00007ffe00ff5eb0 RDI: 00000000ffffff9c
[ 111.462515][ T8370] RBP: 00007ffe00ff5eb0 R08: 0000000000000000 R09: 00007facc2419700
[ 111.462518][ T8370] R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000080002
[ 111.462520][ T8370] R13: 00007ffe00ff5ccf R14: 00007facc2418fc0 R15: 0000000000802000
[ 111.462526][ T8370] </TASK>
[ 111.462528][ T8370]
[ 111.465710][ T8370] Freed by task 8361 on cpu 1 at 111.442076s:
[ 111.465718][ T8370] kasan_save_track (mm/kasan/common.c:57 mm/kasan/common.c:78)
[ 111.467048][ T8370] kasan_save_free_info (mm/kasan/generic.c:584)
[ 111.467993][ T8370] __kasan_slab_free (mm/kasan/common.c:253 mm/kasan/common.c:285)
[ 111.469000][ T8370] kfree (include/linux/kasan.h:235 mm/slub.c:2689 mm/slub.c:6251 mm/slub.c:6566)
[ 111.469887][ T8370] vduse_ioctl (drivers/vdpa/vdpa_user/vduse_dev.c:1866 drivers/vdpa/vdpa_user/vduse_dev.c:1908 drivers/vdpa/vdpa_user/vduse_dev.c:2208)
[ 111.470848][ T8370] __se_sys_ioctl (fs/ioctl.c:51 fs/ioctl.c:597 fs/ioctl.c:583)
[ 111.471775][ T8370] do_syscall_64 (arch/x86/entry/syscall_64.c:63 arch/x86/entry/syscall_64.c:94)
[ 111.472940][ T8370] entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:121)
[ 111.473875][ T8370]
[ 111.475022][ T8370] The buggy address belongs to the object at ffff88811bb7a000
[ 111.475022][ T8370] which belongs to the cache kmalloc-512 of size 512
[ 111.475948][ T8370] The buggy address is located 40 bytes inside of
[ 111.475948][ T8370] freed 512-byte region [ffff88811bb7a000, ffff88811bb7a200)
[ 111.476936][ T8370]
Best,
Shuangpeng
reply other threads:[~2026-06-14 22:11 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=178144969601.60470.3373689816332131174@gmail.com \
--to=shuangpeng.kernel@gmail.com \
--cc=eperezma@redhat.com \
--cc=jasowang@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=virtualization@lists.linux.dev \
--cc=xieyongji@bytedance.com \
--cc=xuanzhuo@linux.alibaba.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox