]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
uapi: stddef.h: Introduce __kernel_nonstring
authorKees Cook <kees@kernel.org>
Fri, 7 Feb 2025 00:48:13 +0000 (16:48 -0800)
committerKees Cook <kees@kernel.org>
Fri, 28 Feb 2025 19:51:32 +0000 (11:51 -0800)
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 <kees@kernel.org>
include/uapi/linux/stddef.h

index a6fce46aeb37c999cc424282bb2a64b45359c826..b87df1b485c2a4e5d3843f88722f2ebc519d3c9b 100644 (file)
 #define __counted_by_be(m)
 #endif
 
+#ifdef __KERNEL__
+#define __kernel_nonstring     __nonstring
+#else
+#define __kernel_nonstring
+#endif
+
 #endif /* _UAPI_LINUX_STDDEF_H */