2
0
mirror of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-09-04 20:19:47 +08:00
linux/init
Nathan Chancellor 86a9b12506 hardening: Require clang 20.1.0 for __counted_by
After an innocuous change in -next that modified a structure that
contains __counted_by, clang-19 start crashing when building certain
files in drivers/gpu/drm/xe. When assertions are enabled, the more
descriptive failure is:

  clang: clang/lib/AST/RecordLayoutBuilder.cpp:3335: const ASTRecordLayout &clang::ASTContext::getASTRecordLayout(const RecordDecl *) const: Assertion `D && "Cannot get layout of forward declarations!"' failed.

According to a reverse bisect, a tangential change to the LLVM IR
generation phase of clang during the LLVM 20 development cycle [1]
resolves this problem. Bump the version of clang that enables
CONFIG_CC_HAS_COUNTED_BY to 20.1.0 to ensure that this issue cannot be
hit.

Link: 160fb1121c [1]
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Justin Stitt <justinstitt@google.com>
Link: https://lore.kernel.org/r/20250807-fix-counted_by-clang-19-v1-1-902c86c1d515@kernel.org
Signed-off-by: Kees Cook <kees@kernel.org>
2025-08-29 12:04:53 -07:00
..
.gitignore kbuild: build init/built-in.a just once 2022-09-29 04:40:15 +09:00
.kunitconfig initramfs_test: kunit tests for initramfs unpacking 2025-03-08 12:13:04 +01:00
calibrate.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
do_mounts_initrd.c treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
do_mounts_rd.c init: add an init_unlink helper 2020-07-31 08:17:52 +02:00
do_mounts.c init: replace deprecated strncpy with strscpy_pad 2024-04-30 10:34:29 -07:00
do_mounts.h init: flush async file closing 2024-02-08 18:41:03 +01:00
init_task.c signal: Provide ignored_posix_timers list 2024-11-07 02:14:45 +01:00
initramfs_internal.h init: add initramfs_internal.h 2025-03-04 09:52:36 +01:00
initramfs_test.c initramfs_test: kunit tests for initramfs unpacking 2025-03-08 12:13:04 +01:00
initramfs.c init: fix build warnings about export.h 2025-06-11 22:42:36 -07:00
Kconfig hardening: Require clang 20.1.0 for __counted_by 2025-08-29 12:04:53 -07:00
main.c Significant patch series in this pull request: 2025-08-03 16:23:09 -07:00
Makefile initramfs_test: kunit tests for initramfs unpacking 2025-03-08 12:13:04 +01:00
noinitramfs.c init: move usermodehelper_enable() to populate_rootfs() 2021-09-08 11:50:27 -07:00
version-timestamp.c init/version-timestamp.c: remove unneeded #include <linux/version.h> 2023-01-09 07:34:38 +09:00
version.c init/version.c: Replace strlcpy with strscpy 2023-09-22 09:50:56 -07:00