[PATCH] selftests/landlock: NULL-terminate unix pathname addresses

Mickaël Salaün mic at digikod.net
Fri Dec 19 20:26:59 UTC 2025


Thanks for both patches! Applied to my -next branch.

On Wed, Dec 03, 2025 at 10:48:45AM +0100, Günther Noack wrote:
> 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