Re: [PATCH driver-core 0/1] kobject: reserve an envp slot for the terminator
From: Greg KH
Date: Mon Nov 23 2026 - 07:56:07 EST
On Mon, Nov 23, 2026 at 08:16:36PM +0800, Ren Wei wrote:
> From: Ruide Cao <caoruide123@xxxxxxxxx>
>
> Hi Linux kernel maintainers,
>
> We found an issue in lib/kobject_uevent.c.
>
> This bug is tracked at: https://bugtracker.nebusec.ai/f/16082
>
> add_uevent_var() permits envp_idx to reach ARRAY_SIZE(env->envp), filling
> the final pointer slot without reserving a trailing NULL. With
> CONFIG_UEVENT_HELPER and a nonempty helper path, an event containing
> exactly 61 variables before SEQNUM causes SEQNUM, HOME, and PATH to fill
> all 64 slots. call_usermodehelper then asynchronously passes this
> unterminated array to kernel_execve(). count_strings_kernel() reads beyond
> envp into envp_idx and env->buf, interprets those bytes as pointers, and
> later dereferences invalid addresses while copying the environment.
> Synthetic arguments allow the environment count to be tuned, resulting in
> an out-of-bounds scan and kernel crash.
>
> Privilege model: writing a synthetic uevent to /sys/module/kernel/uevent
> and setting /proc/sys/kernel/hotplug require CAP_SYS_ADMIN; the
> reproducer runs as root. The crash also depends on CONFIG_UEVENT_HELPER
> and a nonempty helper path.
This has come up many times in the past, nice to see your LLM has read
the mailing list archives :)
thanks,
greg k-h