PATH:
usr
/
src
/
kernels
/
5.14.0-611.54.3.el9_7.x86_64
/
scripts
#!/bin/sh # SPDX-License-Identifier: GPL-2.0-only set -e # Argument 1: Source file to build. IN="$1" shift # Extract just the filename for error messages below. FILE="${IN##*/}" # Extract the function name for error messages below. FUNC="${FILE#*-}" FUNC="${FUNC%%-*}" FUNC="${FUNC%%.*}" # Extract the symbol to test for in build/symbol test below. WANT="__${FILE%%-*}" # Argument 2: Where to write the build log. OUT="$1" shift TMP="${OUT}.tmp" # Argument 3: Path to "nm" tool. NM="$1" shift # Remaining arguments are: $(CC) $(c_flags) # Clean up temporary file at exit. __cleanup() { rm -f "$TMP" } trap __cleanup EXIT # Function names in warnings are wrapped in backticks under UTF-8 locales. # Run the commands with LANG=C so that grep output will not change. export LANG=C status= # Attempt to build a source that is expected to fail with a specific warning. if "$@" -Werror -c "$IN" -o "$OUT".o 2> "$TMP" ; then # If the build succeeds, either the test has failed or the # warning may only happen at link time (Clang). In that case, # make sure the expected symbol is unresolved in the symbol list. # If so, FORTIFY is working for this case. if ! $NM -A "$OUT".o | grep -m1 "\bU ${WANT}$" >>"$TMP" ; then status="warning: unsafe ${FUNC}() usage lacked '$WANT' symbol in $IN" fi else # If the build failed, check for the warning in the stderr. # GCC: # ./include/linux/fortify-string.h:316:25: error: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror=attribute-warning] # Clang 14: # ./include/linux/fortify-string.h:316:4: error: call to __write_overflow_field declared with 'warning' attribute: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror,-Wattribute-warning] if ! grep -Eq -m1 "error: call to .?\b${WANT}\b.?" "$TMP" ; then status="warning: unsafe ${FUNC}() usage lacked '$WANT' warning in $IN" fi fi if [ -n "$status" ]; then # Report on failure results, including compilation warnings. echo "$status" | tee "$OUT" >&2 else # Report on good results, and save any compilation output to log. echo "ok: unsafe ${FUNC}() usage correctly detected with '$WANT' in $IN" >"$OUT" fi cat "$TMP" >>"$OUT"
[+]
..
[-] headers_check.pl
[edit]
[+]
genksyms
[-] cleanfile
[edit]
[+]
dtc
[-] file-size.sh
[edit]
[-] cleanpatch
[edit]
[-] checkdeclares.pl
[edit]
[-] extract-cert
[edit]
[-] module.lds
[edit]
[-] decode_stacktrace.sh
[edit]
[-] profile2linkerlist.pl
[edit]
[-] extract-sys-certs.pl
[edit]
[-] Makefile.randstruct
[edit]
[-] jobserver-exec
[edit]
[-] Kbuild.include
[edit]
[-] unifdef
[edit]
[-] modules-check.sh
[edit]
[-] check_extable.sh
[edit]
[-] mkuboot.sh
[edit]
[-] Makefile.userprogs
[edit]
[+]
gcc-plugins
[-] decodecode
[edit]
[-] tools-support-relr.sh
[edit]
[-] Makefile.kcov
[edit]
[-] cc-can-link.sh
[edit]
[-] kallsyms
[edit]
[-] Lindent
[edit]
[-] recordmcount.pl
[edit]
[-] Makefile.gcc-plugins
[edit]
[-] remove-stale-files
[edit]
[-] stackusage
[edit]
[-] kernel-doc
[edit]
[-] gen_ksymdeps.sh
[edit]
[-] install.sh
[edit]
[-] get_maintainer.pl
[edit]
[-] Makefile.compiler
[edit]
[-] sorttable.c
[edit]
[-] xen-hypercalls.sh
[edit]
[-] extract-module-sig.pl
[edit]
[-] spdxcheck-test.sh
[edit]
[-] faddr2line
[edit]
[-] Makefile.package
[edit]
[-] kallsyms.c
[edit]
[-] gcc-x86_32-has-stack-protector.sh
[edit]
[-] get_abi.pl
[edit]
[-] mkcompile_h
[edit]
[-] checkpatch.pl
[edit]
[-] sign-file
[edit]
[-] Makefile
[edit]
[-] gcc-x86_64-has-stack-protector.sh
[edit]
[-] Makefile.build
[edit]
[-] leaking_addresses.pl
[edit]
[-] syscallnr.sh
[edit]
[-] markup_oops.pl
[edit]
[-] checkversion.pl
[edit]
[-] headerdep.pl
[edit]
[-] Makefile.kmsan
[edit]
[-] recordmcount.h
[edit]
[-] depmod.sh
[edit]
[-] subarch.include
[edit]
[-] Makefile.kcsan
[edit]
[-] prune-kernel
[edit]
[-] sphinx-pre-install
[edit]
[-] Makefile.extrawarn
[edit]
[-] ld-version.sh
[edit]
[+]
gdb
[+]
atomic
[-] ver_linux
[edit]
[-] Makefile.host
[edit]
[-] parse-maintainers.pl
[edit]
[-] as-version.sh
[edit]
[-] objdiff
[edit]
[-] stackdelta
[edit]
[-] tags.sh
[edit]
[-] sign-file.c
[edit]
[-] objdump-func
[edit]
[-] insert-sys-cert.c
[edit]
[-] gen_packed_field_checks.c
[edit]
[-] Makefile.modinst
[edit]
[-] coccicheck
[edit]
[-] syscalltbl.sh
[edit]
[-] documentation-file-ref-check
[edit]
[-] Makefile.asm-generic
[edit]
[-] adjust_autoksyms.sh
[edit]
[-] bin2c.c
[edit]
[-] patch-kernel
[edit]
[-] generate_rust_target.rs
[edit]
[-] config
[edit]
[-] Makefile.lib
[edit]
[-] test_fortify.sh
[edit]
[+]
mod
[-] gfp-translate
[edit]
[-] headers_install.sh
[edit]
[-] pahole-version.sh
[edit]
[-] mksysmap
[edit]
[-] find-unused-docs.sh
[edit]
[-] extract_xc3028.pl
[edit]
[-] dev-needs.sh
[edit]
[-] makelst
[edit]
[-] bloat-o-meter
[edit]
[-] gen_autoksyms.sh
[edit]
[+]
basic
[-] setlocalversion
[edit]
[-] Makefile.modpost
[edit]
[-] link-vmlinux.sh
[edit]
[-] nsdeps
[edit]
[-] gcc-ld
[edit]
[-] Makefile.vmlinux_o
[edit]
[-] recordmcount.c
[edit]
[-] min-tool-version.sh
[edit]
[-] const_structs.checkpatch
[edit]
[-] cc-version.sh
[edit]
[-] checkincludes.pl
[edit]
[-] extract-cert.c
[edit]
[+]
selinux
[+]
coccinelle
[-] get_dvb_firmware
[edit]
[+]
clang-tools
[+]
package
[-] extract-ikconfig
[edit]
[-] check-sysctl-docs
[edit]
[-] checkkconfigsymbols.py
[edit]
[-] Makefile.clean
[edit]
[-] checksyscalls.sh
[edit]
[-] split-man.pl
[edit]
[+]
ksymoops
[-] show_delta
[edit]
[-] Makefile.modfinal
[edit]
[-] sorttable
[edit]
[-] spelling.txt
[edit]
[-] extract-vmlinux
[edit]
[-] export_report.pl
[edit]
[-] Makefile.btf
[edit]
[-] asn1_compiler.c
[edit]
[-] unifdef.c
[edit]
[-] sorttable.h
[edit]
[-] get_feat.pl
[edit]
[+]
include
[+]
kconfig
[-] bpf_doc.py
[edit]
[-] syscallhdr.sh
[edit]
[-] Makefile.dtbinst
[edit]
[-] diffconfig
[edit]
[-] xz_wrap.sh
[edit]
[-] Makefile.vmlinux
[edit]
[-] checkstack.pl
[edit]
[-] bootgraph.pl
[edit]
[-] Makefile.kasan
[edit]
[-] Makefile.headersinst
[edit]
[-] generate_initcall_order.pl
[edit]
[-] asn1_compiler
[edit]
[-] Kconfig.include
[edit]
[+]
dummy-tools
[-] module.lds.S
[edit]
[-] Makefile.ubsan
[edit]