Skip to content

Commit 3407caa

Browse files
committed
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>
1 parent c0e1d46 commit 3407caa

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

include/uapi/linux/stddef.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,10 @@
7070
#define __counted_by_be(m)
7171
#endif
7272

73+
#ifdef __KERNEL__
74+
#define __kernel_nonstring __nonstring
75+
#else
76+
#define __kernel_nonstring
77+
#endif
78+
7379
#endif /* _UAPI_LINUX_STDDEF_H */

0 commit comments

Comments
 (0)