From: Petr Pavlu <petr.pavlu@suse.com>
To: Yang Zi <2959243019@qq.com>
Cc: linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [BUG] slab-use-after-free in idempotent() during concurrent finit_module [syzkaller] [ath10k_pci]
Date: Sun, 16 Aug 2026 11:30:02 +0200 [thread overview]
Message-ID: <0d11ebbb-2e9c-49f3-a550-760b5a94dfe0@suse.com> (raw)
In-Reply-To: <tencent_95B4D4B2EC1DAF3C31FDD07D6FA8B3FA9907@qq.com>
On 8/8/26 7:00 PM, Yang Zi wrote:
> Hi,
>
> While fuzzing the kernel with syzkaller (KASAN), we hit a slab
> use-after-free in the module loader's idempotent path. The crash is a
> Read of size 8 in `idempotent()` in kernel/module/main.c while
> concurrently loading modules via `finit_module`, when the load fd is
> `close()`d from another thread.
>
> Reproducer summary:
>
> BUG: KASAN: slab-use-after-free in idempotent kernel/module/main.c:3682 [inline]
> BUG: KASAN: slab-use-after-free in idempotent_init_module kernel/module/main.c:3788 [inline]
> BUG: KASAN: slab-use-after-free in __do_sys_finit_module kernel/module/main.c:3815 [inline]
> Read of size 8 at addr ffff88800d36fe48 by task modprobe/715
>
> The buggy address belongs to the object at ffff88800d36f700
> which belongs to the cache UNIX-STREAM of size 2048
> The buggy address is located 1864 bytes inside of a freed 2048-byte region
>
> Allocated by task 634: __sys_socket → unix_create1 → sk_alloc → kmem_cache_alloc (2048 B)
> Freed by task 634: __x64_sys_close → __fput → sock_close → unix_release_sock → __sk_destruct → sk_prot_free → kmem_cache_free
>
> `idempotent()` uses `file_inode(f)` as the cookie to compare entries on the
> global `idem_hash` list. `fdget` only holds a reference on the `struct file`,
> not on the inode/socket object. When a concurrent thread `close()`s the
> module-load fd while another `finit_module` is inside `idempotent()`, the
> `UNIX-STREAM` socket object is freed and the inode-cookie is dereferenced on
> the hash list → slab-use-after-free (Read 8 B).
>
> Root-cause hypothesis: the `file_inode(f)` cookie has no lifetime protection
> across the `hlist_for_each_entry` in `idempotent()`; the concurrent `close`
> can release the object underneath the traversal.
This doesn't quite hold up. 1) idempotent() never dereferences the
file_inode(f) cookie, so it cannot cause a use-after-free.
2) finit_module() calls fdget() on the input file and the file itself
pins its inode.
I'm afraid this looks very much like AI-generated spam. If it is
a genuine report, please provide more information, such as a syzkaller
reproducer and the full boot log.
--
Thanks,
Petr
prev parent reply other threads:[~2026-08-16 9:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-08 17:00 [BUG] slab-use-after-free in idempotent() during concurrent finit_module [syzkaller] [ath10k_pci] Yang Zi
2026-08-16 9:30 ` Petr Pavlu [this message]
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=0d11ebbb-2e9c-49f3-a550-760b5a94dfe0@suse.com \
--to=petr.pavlu@suse.com \
--cc=2959243019@qq.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-modules@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox