Re: (subset) [PATCH v3] tools/leds/uledmon: reject device names that are too long
From: Lee Jones
Date: Tue Dec 01 2026 - 09:33:08 EST
On Mon, 23 Nov 2026 17:00:54 +0800, Gu Bin wrote:
> strncpy() does not NUL-terminate when the source is at least as long
> as the bound. uleds_dev.name is passed to the kernel with
> write(fd, &uleds_dev, sizeof(uleds_dev)), so a >= LED_MAX_NAME_SIZE
> byte argv[1] leaves name without a terminator and the write sends
> trailing bytes that are not part of a valid device name.
>
> Silently truncating such a name would create a device the user did
> not ask for, so error out instead, like the other argument checks
> already do.
>
> [...]
Applied, thanks!
[1/1] tools/leds/uledmon: reject device names that are too long
https://git.kernel.org/lee/leds/c/5971a938a11a
--
Lee Jones [李琼斯]