linux-yocto/scripts
Kees Cook eabc92d1fb randstruct: gcc-plugin: Fix attribute addition
[ Upstream commit f39f18f3c3 ]

Based on changes in the 2021 public version of the randstruct
out-of-tree GCC plugin[1], more carefully update the attributes on
resulting decls, to avoid tripping checks in GCC 15's
comptypes_check_enum_int() when it has been configured with
"--enable-checking=misc":

arch/arm64/kernel/kexec_image.c:132:14: internal compiler error: in comptypes_check_enum_int, at c/c-typeck.cc:1519
  132 | const struct kexec_file_ops kexec_image_ops = {
      |              ^~~~~~~~~~~~~~
 internal_error(char const*, ...), at gcc/gcc/diagnostic-global-context.cc:517
 fancy_abort(char const*, int, char const*), at gcc/gcc/diagnostic.cc:1803
 comptypes_check_enum_int(tree_node*, tree_node*, bool*), at gcc/gcc/c/c-typeck.cc:1519
 ...

Link: https://archive.org/download/grsecurity/grsecurity-3.1-5.10.41-202105280954.patch.gz [1]
Reported-by: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
Closes: https://github.com/KSPP/linux/issues/367
Closes: https://lore.kernel.org/lkml/20250530000646.104457-1-thiago.bauermann@linaro.org/
Reported-by: Ingo Saitz <ingo@hannover.ccc.de>
Closes: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1104745
Fixes: 313dd1b629 ("gcc-plugins: Add the randstruct plugin")
Tested-by: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
Link: https://lore.kernel.org/r/20250530221824.work.623-kees@kernel.org
Signed-off-by: Kees Cook <kees@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-09-09 18:45:23 +02:00
..
atomic
basic
clang-tools gen_compile_commands: fix invalid escape sequence warning 2024-03-26 18:21:46 -04:00
coccinelle
dtc scripts/dtc: Call pkg-config POSIXly correct 2022-04-08 14:40:15 +02:00
dummy-tools kbuild: dummy-tools: adjust to stricter stackprotector check 2024-04-13 12:59:57 +02:00
gcc-plugins randstruct: gcc-plugin: Fix attribute addition 2025-09-09 18:45:23 +02:00
gdb scripts/gdb: fix lx-timerlist for Python3 2023-05-17 11:48:06 +02:00
genksyms genksyms: fix memory leak when the same symbol is read from *.symref file 2025-03-13 12:46:58 +01:00
kconfig kconfig: lxdialog: fix 'space' to (de)select options 2025-08-28 16:22:47 +02:00
ksymoops
mod modpost: fix the missed iteration for the max bit in do_input() 2025-01-09 13:25:06 +01:00
package builddeb: clean generated package content 2023-03-11 16:39:46 +01:00
selinux selinux: Chain up tool resolving errors in install_policy.sh 2025-04-10 14:30:55 +02:00
tracing ftrace/scripts: Update the instructions for ftrace-bisect.sh 2023-02-01 08:23:22 +01:00
.gitignore
adjust_autoksyms.sh
as-version.sh kbuild: Update assembler calls to use proper flags and language target 2025-06-27 11:04:10 +01:00
asn1_compiler.c ASN.1: Fix check for strdup() success 2023-04-26 11:27:42 +02:00
bin2c.c
bloat-o-meter scripts: switch explicitly to Python 3 2021-05-22 11:40:55 +02:00
bootgraph.pl
bpf_helpers_doc.py bpf, scripts: Correct GPL license name 2024-03-01 13:16:50 +01:00
cc-can-link.sh
check_extable.sh
check-sysctl-docs
checkincludes.pl
checkkconfigsymbols.py scripts: handle BrokenPipeError for python scripts 2023-03-17 08:45:15 +01:00
checkpatch.pl
checkstack.pl checkstack: fix printed address 2023-12-13 18:27:02 +01:00
checksyscalls.sh
checkversion.pl
clang-version.sh
cleanfile
cleanpatch
coccicheck
config kbuild: fix argument parsing in scripts/config 2025-06-04 14:37:00 +02:00
const_structs.checkpatch
decode_stacktrace.sh scripts/decode_stacktrace.sh: optionally use LLVM utilities 2024-02-23 08:42:31 +01:00
decodecode
depmod.sh
dev-needs.sh
diffconfig scripts: handle BrokenPipeError for python scripts 2023-03-17 08:45:15 +01:00
documentation-file-ref-check
export_report.pl
extract_xc3028.pl
extract-cert.c cert host tools: Stop complaining about deprecated OpenSSL functions 2022-11-16 09:57:17 +01:00
extract-ikconfig
extract-module-sig.pl
extract-sys-certs.pl
extract-vmlinux
faddr2line scripts/faddr2line: Fix regression in name resolution on ppc64le 2022-12-08 11:23:54 +01:00
file-size.sh
find-unused-docs.sh
gcc-goto.sh
gcc-ld
gcc-version.sh
gcc-x86_32-has-stack-protector.sh kbuild: Fix '-S -c' in x86 stack protector scripts 2024-08-19 05:40:59 +02:00
gcc-x86_64-has-stack-protector.sh kbuild: Fix '-S -c' in x86 stack protector scripts 2024-08-19 05:40:59 +02:00
gen_autoksyms.sh
gen_ksymdeps.sh kbuild: Fix 'no symbols' warning when CONFIG_TRIM_UNUSD_KSYMS=y 2021-09-18 13:40:16 +02:00
get_abi.pl scripts/get_abi: fix source path leak 2024-02-23 08:41:54 +01:00
get_dvb_firmware
get_maintainer.pl
gfp-translate
headerdep.pl
headers_check.pl
headers_install.sh
insert-sys-cert.c
jobserver-exec
kallsyms.c
Kbuild.include kbuild: Add KBUILD_CPPFLAGS to as-option invocation 2025-06-27 11:04:10 +01:00
Kconfig.include kbuild: Update assembler calls to use proper flags and language target 2025-06-27 11:04:10 +01:00
kernel-doc scripts: kernel-doc: Fix syntax error due to undeclared args variable 2024-04-13 12:58:46 +02:00
ld-version.sh
leaking_addresses.pl leaking_addresses: Always print a trailing newline 2021-11-18 14:03:57 +01:00
Lindent
link-vmlinux.sh kbuild: fix short log for AS in link-vmlinux.sh 2024-07-18 13:05:45 +02:00
lld-version.sh scripts/lld-version.sh: Rewrite based on upstream ld-version.sh 2021-11-21 13:46:37 +01:00
Makefile certs: Add ability to preload revocation certs 2021-06-30 08:47:30 -04:00
Makefile.asm-generic
Makefile.build x86/retbleed: Add fine grained Kconfig knobs 2022-07-25 11:26:50 +02:00
Makefile.clean
Makefile.dtbinst kbuild: Install dtb files as 0644 in Makefile.dtbinst 2024-07-05 09:12:54 +02:00
Makefile.extrawarn kbuild: Move -Wenum-enum-conversion to W=2 2025-03-13 12:47:10 +01:00
Makefile.gcc-plugins gcc-plugins: Undefine LATENT_ENTROPY_PLUGIN when plugin disabled for a file 2022-08-25 11:38:10 +02:00
Makefile.headersinst
Makefile.host
Makefile.kasan kasan: fix hwasan build for gcc 2021-04-28 13:40:02 +02:00
Makefile.kcov
Makefile.kcsan
Makefile.lib
Makefile.modfinal
Makefile.modinst
Makefile.modpost kbuild: Fix include path in scripts/Makefile.modpost 2022-09-05 10:28:55 +02:00
Makefile.modsign
Makefile.package
Makefile.ubsan ubsan: remove CONFIG_UBSAN_OBJECT_SIZE 2022-04-13 21:01:10 +02:00
Makefile.userprogs
makelst
markup_oops.pl
mkcompile_h kbuild: mkcompile_h: consider timestamp if KBUILD_BUILD_TIMESTAMP is set 2021-07-25 14:36:16 +02:00
mkmakefile
mksysmap mksysmap: Fix the mismatch of 'L0' symbols in System.map 2022-09-23 14:17:00 +02:00
mkuboot.sh
module.lds.S modules: Ensure natural alignment for .altinstructions and __bug_table sections 2022-08-25 11:38:19 +02:00
modules-check.sh
nsdeps
objdiff
pahole-flags.sh kbuild: Add skip_encoding_btf_enum64 option to pahole 2022-10-28 12:57:12 +02:00
parse-maintainers.pl
patch-kernel
profile2linkerlist.pl
prune-kernel
recordmcount.c recordmcount: Fix memory leaks in the uwrite function 2023-05-30 12:57:50 +01:00
recordmcount.h recordmcount: Correct st_shndx handling 2021-06-30 08:47:23 -04:00
recordmcount.pl recordmcount.pl: fix typo in s390 mcount regex 2022-01-05 12:40:29 +01:00
setlocalversion
show_delta tweewide: Fix most Shebang lines 2021-05-22 11:40:55 +02:00
sign-file.c sign-file: Fix incorrect return values check 2023-12-20 15:44:29 +01:00
sorttable.c
sorttable.h scripts/sorttable: fix orc_sort_cmp() to maintain symmetry and transitivity 2025-02-01 18:22:21 +01:00
spdxcheck-test.sh
spdxcheck.py
spelling.txt
sphinx-pre-install scripts: sphinx-pre-install: Fix ctex support on Debian 2022-01-27 10:54:36 +01:00
split-man.pl tweewide: Fix most Shebang lines 2021-05-22 11:40:55 +02:00
stackdelta
stackusage
subarch.include
tags.sh scripts/tags.sh: Resolve gtags empty index generation 2023-07-27 08:43:31 +02:00
tools-support-relr.sh Makefile: fix GDB warning with CONFIG_RELR 2021-07-14 16:55:53 +02:00
unifdef.c
ver_linux
xen-hypercalls.sh
xz_wrap.sh