[PATCH] selftests/landlock: NULL-terminate unix pathname addresses
Günther Noack
gnoack at google.com
Wed Dec 3 09:48:45 UTC 2025
On Tue, Dec 02, 2025 at 10:51:41PM +0100, Matthieu Buffet wrote:
> The size of Unix pathname addresses is computed in selftests using
> offsetof(struct sockaddr_un, sun_path) + strlen(xxx). It should have
> been that +1, which makes addresses passed to the libc and kernel
> non-NULL-terminated. unix_mkname_bsd() fixes that in Linux so there is
> no harm, but just using sizeof(the address struct) should improve
> readability.
>
> Signed-off-by: Matthieu Buffet <matthieu at buffet.re>
> ---
> [...]
Thank you very much, this looks good!
Reviewed-by: Günther Noack <gnoack at google.com>
—Günther
More information about the Linux-security-module-archive
mailing list