mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [BUG] KASAN: slab-use-after-free in pfru_ioctl
@ 2026-06-14 22:20 Shuangpeng Bai
  0 siblings, 0 replies; only message in thread
From: Shuangpeng Bai @ 2026-06-14 22:20 UTC (permalink / raw)
  To: rafael, lenb, linux-acpi, linux-kernel

Hi Kernel Maintainers,

I hit the following report while testing current upstream kernel:

KASAN: slab-use-after-free in pfru_ioctl

I reproduced this on commit: e8c2f9fdadee7cbc75134dc463c1e0d856d6e5c7 (May 25 2026)

The reproducer and .config files are here.
https://gist.github.com/shuangpengbai/00fb9f2207179688618e3d5e938d93df

I'm happy to test debug patches or provide additional information.

Reported-by: Shuangpeng Bai <shuangpeng.kernel@gmail.com>

[   83.847068][ T8420] BUG: KASAN: slab-use-after-free in pfru_ioctl (drivers/acpi/pfr_update.c:446)
[   83.849125][ T8420] Write of size 4 at addr ffff888102362938 by task pfrut_oldfd_rep/8420
[   83.851358][ T8420]
[   83.852029][ T8420] 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
[   83.852035][ T8420] Call Trace:
[   83.852041][ T8420]  <TASK>
[   83.852046][ T8420]  dump_stack_lvl (lib/dump_stack.c:94 lib/dump_stack.c:120)
[   83.852061][ T8420]  print_report (mm/kasan/report.c:378 mm/kasan/report.c:482)
[   83.852098][ T8420]  kasan_report (mm/kasan/report.c:595)
[   83.852121][ T8420]  pfru_ioctl (drivers/acpi/pfr_update.c:446)
[   83.852166][ T8420]  __se_sys_ioctl (fs/ioctl.c:51 fs/ioctl.c:597 fs/ioctl.c:583)
[   83.852177][ T8420]  do_syscall_64 (arch/x86/entry/syscall_64.c:63 arch/x86/entry/syscall_64.c:94)
[   83.852207][ T8420]  entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:121)
[   83.852217][ T8420] RIP: 0033:0x7fc16a359237
[   83.852227][ T8420] Code: 00 00 00 48 8b 05 59 cc 0d 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 29 cc 0d 00 f7 d8 64 89 01 48
[   83.852237][ T8420] RSP: 002b:00007ffe1d81d8d8 EFLAGS: 00000206 ORIG_RAX: 0000000000000010
[   83.852252][ T8420] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fc16a359237
[   83.852260][ T8420] RDX: 00007ffe1d81f8f0 RSI: 000000004004ee01 RDI: 0000000000000003
[   83.852266][ T8420] RBP: 0000000000000003 R08: 0000000000000000 R09: 0000000000000008
[   83.852272][ T8420] R10: fffffffffffff66f R11: 0000000000000206 R12: 00007ffe1d81f8f0
[   83.852278][ T8420] R13: 0000000000000000 R14: 00007fc16a43d4c0 R15: 000055c04503b150
[   83.852289][ T8420]  </TASK>
[   83.852293][ T8420]
[   83.870652][ T8420] Freed by task 8420 on cpu 0 at 83.642118s:
[   83.871211][ T8420]  kasan_save_track (mm/kasan/common.c:57 mm/kasan/common.c:78)
[   83.871657][ T8420]  kasan_save_free_info (mm/kasan/generic.c:584)
[   83.872128][ T8420]  __kasan_slab_free (mm/kasan/common.c:253 mm/kasan/common.c:285)
[   83.872582][ T8420]  kfree (include/linux/kasan.h:235 mm/slub.c:2689 mm/slub.c:6251 mm/slub.c:6566)
[   83.872953][ T8420]  devres_release_all (drivers/base/devres.c:50 drivers/base/devres.c:547 drivers/base/devres.c:576)
[   83.873431][ T8420]  device_release_driver_internal (drivers/base/dd.c:598 drivers/base/dd.c:1357 drivers/base/dd.c:1375)
[   83.874003][ T8420]  unbind_store (drivers/base/bus.c:244)
[   83.874436][ T8420]  kernfs_fop_write_iter (fs/kernfs/file.c:352)
[   83.874936][ T8420]  vfs_write (fs/read_write.c:595 fs/read_write.c:688)
[   83.875339][ T8420]  ksys_write (fs/read_write.c:740)
[   83.875748][ T8420]  do_syscall_64 (arch/x86/entry/syscall_64.c:63 arch/x86/entry/syscall_64.c:94)
[   83.876187][ T8420]  entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:121)
[   83.876745][ T8420]
[   83.876975][ T8420] The buggy address belongs to the object at ffff888102362900
[   83.876975][ T8420]  which belongs to the cache kmalloc-192 of size 192
[   83.878281][ T8420] The buggy address is located 56 bytes inside of
[   83.878281][ T8420]  freed 192-byte region [ffff888102362900, ffff8881023629c0)
[   83.879564][ T8420]


Best,
Shuangpeng

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-06-14 22:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-14 22:20 [BUG] KASAN: slab-use-after-free in pfru_ioctl Shuangpeng Bai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®