[PATCH v2] pinctrl: zynqmp: Ensure function names are NUL terminated
Linus Walleij
linusw at kernel.org
Mon Nov 30 12:48:44 PST 2026
On Wed, Nov 18, 2026 at 12:18 PM Sai Krishna Potthuri
<sai.krishna.potthuri at amd.com> wrote:
> PM_QID_PINCTRL_GET_FUNCTION_NAME returns the function name in a fixed
> 16-byte field and does not guarantee NUL termination. A 16-character
> name fills the entire field.
> The driver copies this field into a 16-byte buffer and subsequently
> uses it as a C string. For a non-NUL-terminated name, string operations
> can read past the end of the buffer into the adjacent groups pointer.
>
> Reserve an extra byte for the NUL terminator and explicitly terminate
> the copied function name.
>
> Signed-off-by: Sai Krishna Potthuri <sai.krishna.potthuri at amd.com>
Patch applied!
Yours,
Linus Walleij
More information about the linux-arm-kernel
mailing list