[BUG] lockd: KASAN: slab-use-after-free in nlm_async_call

Shuangpeng Bai <[email protected]>
Newsgroups org.kernel.vger.linux-nfs,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
Hi Kernel Maintainers,

I hit the following report while testing current upstream kernel:

KASAN: slab-use-after-free in nlm_async_call

on commit: 3aa1dcaa4f6f5ae08936491e08bd456f331f2d40 (2026-08-13)

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/e0569a211da5a1738fb91b1833465662

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

Reported-by: Shuangpeng Bai <[email protected]>

[  193.891339][ T8377] BUG: KASAN: slab-use-after-free in nlm_async_call+0xd6/0x230
[  193.893522][ T8377] Read of size 8 at addr ffff88811b04c808 by task lockd/8377
[  193.895154][ T8377]
[  193.895574][ T8377] Call Trace:
[  193.895578][ T8377]  <TASK>
[  193.895581][ T8377]  dump_stack_lvl+0x26/0x80
[  193.895592][ T8377]  print_report+0x147/0x790
[  193.895619][ T8377]  kasan_report+0xc3/0x100
[  193.895631][ T8377]  nlm_async_call+0xd6/0x230
[  193.895688][ T8377]  nlmsvc_retry_blocked+0x61c/0x800
[  193.895695][ T8377]  lockd+0x144/0x1c0
[  193.895702][ T8377]  kthread+0x2f2/0x3c0
[  193.895722][ T8377]  ret_from_fork+0x27d/0x670
[  193.895747][ T8377]  ret_from_fork_asm+0x1a/0x30
[  193.895754][ T8377]  </TASK>
[  193.913276][ T8377] Allocated by task 8377 on cpu 1 at 181.704904s:
[  193.914652][ T8377]  __kmalloc_cache_noprof+0x248/0x4b0
[  193.915123][ T8377]  nlm_alloc_call+0x4b/0x1b0
[  193.915527][ T8377]  nlmsvc_lock+0x3d2/0xfc0
[  193.915922][ T8377]  nlm4svc_do_lock+0x291/0x480
[  193.916341][ T8377]  nlmsvc_dispatch+0xac/0x1b0
[  193.916752][ T8377]  svc_process_common+0x1229/0x1700
[  193.917211][ T8377]  svc_process+0x26b/0x560
[  193.917601][ T8377]  svc_recv+0x1690/0x1c70
[  193.917986][ T8377]  lockd+0x14e/0x1c0
[  193.919766][ T8377] Freed by task 8392 on cpu 1 at 192.290946s:
[  193.921551][ T8377]  kfree+0x134/0x450
[  193.921895][ T8377]  nlmsvc_release_block+0x231/0x290
[  193.922345][ T8377]  nlmsvc_traverse_blocks+0x139/0x1b0
[  193.922816][ T8377]  nlm_traverse_files+0x1aa/0xa00
[  193.923250][ T8377]  nlmsvc_free_host_resources+0x12/0x60
[  193.923726][ T8377]  nlm_shutdown_hosts_net+0x127/0x280
[  193.924193][ T8377]  lockd_down+0xd5/0x1c0
[  193.924561][ T8377]  nfsd_destroy_serv+0x265/0x400
[  193.924994][ T8377]  nfsd_shutdown_threads+0xbb/0x100
[  193.925443][ T8377]  nfsd_umount+0x3b/0xc0
[  193.925815][ T8377]  deactivate_locked_super+0x9c/0x230
[  193.926279][ T8377]  cleanup_mnt+0x3a8/0x420


Best,
Shuangpeng
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.