summaryrefslogtreecommitdiff
path: root/include/uapi/linux/stddef.h
diff options
context:
space:
mode:
authorKees Cook <kees@kernel.org>2025-02-06 16:48:13 -0800
committerKees Cook <kees@kernel.org>2025-02-28 11:51:32 -0800
commit3407caa69a06932f87bd22f62aa257fb1593ce7a (patch)
treed35fc0b269027a5fa46413bb5f3ec621c12a9405 /include/uapi/linux/stddef.h
parentc0e1d4656ea5fbecee9942fb2fc83ab579433421 (diff)
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>
Diffstat (limited to 'include/uapi/linux/stddef.h')
-rw-r--r--include/uapi/linux/stddef.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/uapi/linux/stddef.h b/include/uapi/linux/stddef.h
index a6fce46aeb37..b87df1b485c2 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 */