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 <kees@kernel.org>
This commit is contained in:
Kees Cook 2025-02-06 16:48:13 -08:00
parent c0e1d4656e
commit 3407caa69a

View file

@ -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 */