[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250207010022.749952-7-kees@kernel.org>
Date: Thu, 6 Feb 2025 17:00:16 -0800
From: Kees Cook <kees@...nel.org>
To: Andy Shevchenko <andy@...nel.org>
Cc: Kees Cook <kees@...nel.org>,
Alexey Dobriyan <adobriyan@...il.com>,
Sven Eckelmann <sven@...fation.org>,
Tadeusz Struk <tadeusz.struk@...aro.org>,
Erick Archer <erick.archer@...look.com>,
Dmitry Antipov <dmantipov@...dex.ru>,
Sathya Prakash <sathya.prakash@...adcom.com>,
Sreekanth Reddy <sreekanth.reddy@...adcom.com>,
Suganath Prabu Subramani <suganath-prabu.subramani@...adcom.com>,
Kashyap Desai <kashyap.desai@...adcom.com>,
Sumit Saxena <sumit.saxena@...adcom.com>,
"James E.J. Bottomley" <James.Bottomley@...senPartnership.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
Nilesh Javali <njavali@...vell.com>,
Andrew Morton <akpm@...ux-foundation.org>,
"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
Borislav Petkov <bp@...en8.de>,
"H. Peter Anvin" <hpa@...or.com>,
kernel test robot <lkp@...el.com>,
Ryusuke Konishi <konishi.ryusuke@...il.com>,
Luc Van Oostenryck <luc.vanoostenryck@...il.com>,
linux-kernel@...r.kernel.org,
MPT-FusionLinux.pdl@...adcom.com,
linux-scsi@...r.kernel.org,
mpi3mr-linuxdrv.pdl@...adcom.com,
GR-QLogic-Storage-Upstream@...vell.com,
linux-hardening@...r.kernel.org,
x86@...nel.org,
linux-coco@...ts.linux.dev,
linux-nilfs@...r.kernel.org
Subject: [PATCH 07/10] 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@...nel.org>
---
Cc: Alexey Dobriyan <adobriyan@...il.com>
Cc: Sven Eckelmann <sven@...fation.org>
Cc: Tadeusz Struk <tadeusz.struk@...aro.org>
Cc: Erick Archer <erick.archer@...look.com>
Cc: Dmitry Antipov <dmantipov@...dex.ru>
---
include/uapi/linux/stddef.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/include/uapi/linux/stddef.h b/include/uapi/linux/stddef.h
index 58154117d9b0..0e7d289b7c2e 100644
--- a/include/uapi/linux/stddef.h
+++ b/include/uapi/linux/stddef.h
@@ -63,4 +63,10 @@
#define __counted_by_be(m)
#endif
+#ifdef __KERNEL__
+#define __kernel_nonstring __nonstring
+#else
+#define __kernel_nonstring
+#endif
+
#endif /* _UAPI_LINUX_STDDEF_H */
--
2.34.1
Powered by blists - more mailing lists