linux-stable/scripts
Kees Cook 8b9a5269b4 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:50:23 +02:00
..
atomic
basic
clang-tools
coccinelle
dtc
dummy-tools
gcc-plugins randstruct: gcc-plugin: Fix attribute addition 2025-09-09 18:50:23 +02:00
gdb
genksyms genksyms: fix memory leak when the same symbol is read from *.symref file 2025-03-13 12:50:13 +01:00
kconfig kconfig: lxdialog: fix 'space' to (de)select options 2025-08-28 16:24:25 +02:00
ksymoops
mod modpost: fix the missed iteration for the max bit in do_input() 2025-01-09 13:28:49 +01:00
package
selinux selinux: Chain up tool resolving errors in install_policy.sh 2025-04-10 14:31:57 +02:00
tracing
.gitignore
adjust_autoksyms.sh
as-version.sh kbuild: Update assembler calls to use proper flags and language target 2025-06-27 11:05:21 +01:00
asn1_compiler.c ASN.1: Fix check for strdup() success 2023-04-26 13:51:56 +02:00
bin2c.c kbuild: move bin2c back to scripts/ from scripts/basic/ 2018-07-18 01:18:05 +09:00
bloat-o-meter
bootgraph.pl
bpf_doc.py
cc-can-link.sh
cc-version.sh
check_extable.sh scripts: check_extable: fix typo in user error message 2021-09-08 11:50:28 -07:00
check-sysctl-docs
checkdeclares.pl
checkincludes.pl
checkkconfigsymbols.py scripts: handle BrokenPipeError for python scripts 2023-03-17 08:49:02 +01:00
checkpatch.pl
checkstack.pl
checksyscalls.sh
checkversion.pl
cleanfile
cleanpatch
coccicheck
config kbuild: fix argument parsing in scripts/config 2025-06-04 14:37:57 +02:00
const_structs.checkpatch
decode_stacktrace.sh scripts/decode_stacktrace.sh: optionally use LLVM utilities 2024-02-23 08:55:13 +01:00
decodecode
depmod.sh
dev-needs.sh
diffconfig
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:58:28 +01:00
extract-ikconfig
extract-module-sig.pl
extract-sys-certs.pl
extract-vmlinux treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 378 2019-06-05 17:37:10 +02:00
faddr2line
file-size.sh
find-unused-docs.sh scripts/find-unused-docs: Fix massive false positives 2020-01-27 14:25:06 -07:00
gcc-goto.sh
gcc-ld
gcc-x86_32-has-stack-protector.sh
gcc-x86_64-has-stack-protector.sh
gen_autoksyms.sh
gen_ksymdeps.sh
generate_initcall_order.pl
get_abi.pl
get_dvb_firmware
get_feat.pl
get_maintainer.pl
gfp-translate
headerdep.pl
headers_check.pl
headers_install.sh
insert-sys-cert.c
jobserver-exec
kallsyms.c
Kbuild.include
Kconfig.include kbuild: Update assembler calls to use proper flags and language target 2025-06-27 11:05:21 +01:00
kernel-doc
ld-version.sh
leaking_addresses.pl
Lindent
link-vmlinux.sh
Makefile kbuild: Allow kernel installation packaging to override pkg-config 2023-02-01 08:27:30 +01:00
Makefile.asm-generic
Makefile.build
Makefile.clang kbuild: add $(CLANG_FLAGS) to KBUILD_CPPFLAGS 2025-06-27 11:05:21 +01:00
Makefile.clean
Makefile.compiler kbuild: Add KBUILD_CPPFLAGS to as-option invocation 2025-06-27 11:05:21 +01:00
Makefile.dtbinst
Makefile.extrawarn kbuild: Move -Wenum-enum-conversion to W=2 2025-03-13 12:50:29 +01:00
Makefile.gcc-plugins
Makefile.headersinst
Makefile.host kbuild: sort hostprogs before passing it to ifneq 2020-08-10 01:32:59 +09:00
Makefile.kasan
Makefile.kcov
Makefile.kcsan
Makefile.lib
Makefile.modfinal
Makefile.modinst
Makefile.modpost kbuild: Fix include path in scripts/Makefile.modpost 2022-09-05 10:30:06 +02:00
Makefile.package
Makefile.ubsan
Makefile.userprogs
makelst
markup_oops.pl
min-tool-version.sh
mkcompile_h
mksysmap
mkuboot.sh
module.lds.S
modules-check.sh kbuild: check module name conflict for external modules as well 2021-04-25 05:22:42 +09:00
nsdeps
objdiff treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 199 2019-05-30 11:29:23 -07:00
pahole-flags.sh
pahole-version.sh
parse-maintainers.pl
patch-kernel
profile2linkerlist.pl
prune-kernel
recordmcount.c
recordmcount.h
recordmcount.pl
remove-stale-files
setlocalversion
show_delta
sign-file.c sign-file: Fix incorrect return values check 2023-12-20 15:17:37 +01:00
sorttable.c
sorttable.h scripts/sorttable: fix orc_sort_cmp() to maintain symmetry and transitivity 2025-01-23 17:15:52 +01:00
spdxcheck-test.sh
spdxcheck.py
spelling.txt
sphinx-pre-install
split-man.pl
stackdelta
stackusage
subarch.include
syscallhdr.sh
syscallnr.sh
syscalltbl.sh scripts: check duplicated syscall number in syscall table 2021-07-09 04:00:39 +09:00
tags.sh
tools-support-relr.sh
unifdef.c
ver_linux
xen-hypercalls.sh
xz_wrap.sh