From: Kees Cook Date: Fri, 7 Feb 2025 00:48:13 +0000 (-0800) Subject: uapi: stddef.h: Introduce __kernel_nonstring X-Git-Tag: v6.15-rc1~233^2~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3407caa69a06932f87bd22f62aa257fb1593ce7a;p=thirdparty%2Fkernel%2Flinux.git uapi: stddef.h: Introduce __kernel_nonstring In order to annotate byte arrays in UAPI that are not C strings (i.e. they may not be NUL terminated), the "nonstring" attribute is needed. However, we can't expose this to userspace as it is compiler version specific. Signed-off-by: Kees Cook --- diff --git a/include/uapi/linux/stddef.h b/include/uapi/linux/stddef.h index a6fce46aeb37c..b87df1b485c2a 100644 --- a/include/uapi/linux/stddef.h +++ b/include/uapi/linux/stddef.h @@ -70,4 +70,10 @@ #define __counted_by_be(m) #endif +#ifdef __KERNEL__ +#define __kernel_nonstring __nonstring +#else +#define __kernel_nonstring +#endif + #endif /* _UAPI_LINUX_STDDEF_H */