]> www.infradead.org Git - users/hch/misc.git/commit
compiler.h: Move C string helpers into C-only kernel section
authorKees Cook <kees@kernel.org>
Wed, 5 Feb 2025 20:32:49 +0000 (12:32 -0800)
committerKees Cook <kees@kernel.org>
Fri, 7 Feb 2025 02:48:00 +0000 (18:48 -0800)
commitcb7380de9e4cbc9a24216b722ec50e092ae83036
treec121d6bd240ee53c10ed79b9d7d8caaefdbdcc8d
parent78bba6097b9318f4aa645afeade14024af86af4e
compiler.h: Move C string helpers into C-only kernel section

The C kernel helpers for evaluating C Strings were positioned where they
were visible to assembly inclusion, which was not intended. Move them
into the kernel and C-only area of the header so future changes won't
confuse the assembler.

Fixes: d7a516c6eeae ("compiler.h: Fix undefined BUILD_BUG_ON_ZERO()")
Fixes: 559048d156ff ("string: Check for "nonstring" attribute on strscpy() arguments")
Reviewed-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Kees Cook <kees@kernel.org>
include/linux/compiler.h