/usr/src/linux-headers-5.15.0-190/scripts
NameSizeModeActions
atomic/-0755rm
basic/-0755rm
clang-tools/-0755rm
coccinelle/-0755rm
dtc/-0755rm
dummy-tools/-0755rm
gcc-plugins/-0755rm
gdb/-0755rm
genksyms/-0755rm
kconfig/-0755rm
ksymoops/-0755rm
mod/-0755rm
package/-0755rm
selinux/-0755rm
tracing/-0755rm
.gitignore1600644editdlrm
adjust_autoksyms.sh21220755editdlrm
as-version.sh20810755editdlrm
asn1_compiler.c361800644editdlrm
bin2c.c7430644editdlrm
bloat-o-meter34450755editdlrm
bootgraph.pl57800755editdlrm
bpf_doc.py255820755editdlrm
cc-can-link.sh1660755editdlrm
cc-version.sh15490755editdlrm
check-sysctl-docs44720755editdlrm
checkdeclares.pl11230755editdlrm
checkincludes.pl19880755editdlrm
checkkconfigsymbols.py161260755editdlrm
checkpatch.pl2294260755editdlrm
checkstack.pl60010755editdlrm
checksyscalls.sh76000755editdlrm
checkversion.pl22110755editdlrm
check_extable.sh50480755editdlrm
cleanfile35420755editdlrm
cleanpatch51820755editdlrm
coccicheck80750755editdlrm
config48990755editdlrm
const_structs.checkpatch10090644editdlrm
decodecode29520755editdlrm
decode_stacktrace.sh76910755editdlrm
depmod.sh14410755editdlrm
dev-needs.sh62190755editdlrm
diffconfig42220755editdlrm
documentation-file-ref-check56870755editdlrm
export_report.pl46050755editdlrm
extract-cert.c37200644editdlrm
extract-ikconfig17340755editdlrm
extract-module-sig.pl37460755editdlrm
extract-sys-certs.pl38360755editdlrm
extract-vmlinux16950755editdlrm
extract_xc3028.pl456860755editdlrm
faddr2line83640755editdlrm
file-size.sh860755editdlrm
find-unused-docs.sh13040755editdlrm
gcc-goto.sh5110755editdlrm
gcc-ld7110755editdlrm
gcc-x86_32-has-stack-protector.sh4050755editdlrm
gcc-x86_64-has-stack-protector.sh1950755editdlrm
generate_initcall_order.pl60900755editdlrm
gen_autoksyms.sh15090755editdlrm
gen_ksymdeps.sh5560755editdlrm
get_abi.pl154630755editdlrm
get_dvb_firmware251280755editdlrm
get_feat.pl146890755editdlrm
get_maintainer.pl687440755editdlrm
gfp-translate17320755editdlrm
headerdep.pl35870755editdlrm
headers_check.pl38190755editdlrm
headers_install.sh34310755editdlrm
insert-sys-cert.c133920644editdlrm
jobserver-exec22130755editdlrm
kallsyms.c184980644editdlrm
Kbuild.include103920644editdlrm
Kconfig.include26350644editdlrm
kernel-doc703880755editdlrm
ld-version.sh18640755editdlrm
leaking_addresses.pl131120755editdlrm
Lindent5020755editdlrm
link-vmlinux.sh111810755editdlrm
Makefile16810644editdlrm
Makefile.asm-generic18640644editdlrm
Makefile.build201350644editdlrm
Makefile.clang16020644editdlrm
Makefile.clean22540644editdlrm
Makefile.compiler28060644editdlrm
Makefile.dtbinst10070644editdlrm
Makefile.extrawarn30920644editdlrm
Makefile.gcc-plugins27780644editdlrm
Makefile.headersinst29500644editdlrm
Makefile.host47430644editdlrm
Makefile.kasan17150644editdlrm
Makefile.kcov3330644editdlrm
Makefile.kcsan7390644editdlrm
Makefile.lib184550644editdlrm
Makefile.modfinal27930644editdlrm
Makefile.modinst25810644editdlrm
Makefile.modpost44780644editdlrm
Makefile.package67710644editdlrm
Makefile.ubsan7700644editdlrm
Makefile.userprogs16070644editdlrm
makelst8080755editdlrm
markup_oops.pl81100755editdlrm
min-tool-version.sh5580755editdlrm
mkcompile_h25410755editdlrm
mksysmap13690755editdlrm
mkuboot.sh4140755editdlrm
module.lds.S16910644editdlrm
modules-check.sh4270755editdlrm
nsdeps17650644editdlrm
objdiff29050755editdlrm
pahole-flags.sh7490755editdlrm
pahole-version.sh2690755editdlrm
parse-maintainers.pl46460755editdlrm
patch-kernel101850755editdlrm
profile2linkerlist.pl4140755editdlrm
prune-kernel7080755editdlrm
recordmcount.c171520644editdlrm
recordmcount.h198320644editdlrm
recordmcount.pl180490755editdlrm
remove-stale-files13360755editdlrm
setlocalversion35800755editdlrm
show_delta30870755editdlrm
sign-file.c101720644editdlrm
sorttable.c89490644editdlrm
sorttable.h100630644editdlrm
spdxcheck-test.sh2770644editdlrm
spdxcheck.py103340755editdlrm
spelling.txt326460644editdlrm
sphinx-pre-install250350755editdlrm
split-man.pl6040755editdlrm
stackdelta18870755editdlrm
stackusage7940755editdlrm
subarch.include6190644editdlrm
syscallhdr.sh19350755editdlrm
syscallnr.sh14850755editdlrm
syscalltbl.sh14890755editdlrm
tags.sh101100755editdlrm
tools-support-relr.sh5460755editdlrm
ubuntu-retpoline-extract-one74340644editdlrm
unifdef.c356370644editdlrm
ver_linux26480755editdlrm
xen-hypercalls.sh3860755editdlrm
xz_wrap.sh5630755editdlrm
Edit: /usr/src/linux-headers-5.15.0-190/scripts/check_extable.sh (5048B)
#! /bin/bash # SPDX-License-Identifier: GPL-2.0 # (c) 2015, Quentin Casasnovas obj=$1 file ${obj} | grep -q ELF || (echo "${obj} is not an ELF file." 1>&2 ; exit 0) # Bail out early if there isn't an __ex_table section in this object file. objdump -hj __ex_table ${obj} 2> /dev/null > /dev/null [ $? -ne 0 ] && exit 0 white_list=.text,.fixup suspicious_relocs=$(objdump -rj __ex_table ${obj} | tail -n +6 | grep -v $(eval echo -e{${white_list}}) | awk '{print $3}') # No suspicious relocs in __ex_table, jobs a good'un [ -z "${suspicious_relocs}" ] && exit 0 # After this point, something is seriously wrong since we just found out we # have some relocations in __ex_table which point to sections which aren't # white listed. If you're adding a new section in the Linux kernel, and # you're expecting this section to contain code which can fault (i.e. the # __ex_table relocation to your new section is expected), simply add your # new section to the white_list variable above. If not, you're probably # doing something wrong and the rest of this code is just trying to print # you more information about it. function find_section_offset_from_symbol() { eval $(objdump -t ${obj} | grep ${1} | sed 's/\([0-9a-f]\+\) .\{7\} \([^ \t]\+\).*/section="\2"; section_offset="0x\1" /') # addr2line takes addresses in hexadecimal... section_offset=$(printf "0x%016x" $(( ${section_offset} + $2 )) ) } function find_symbol_and_offset_from_reloc() { # Extract symbol and offset from the objdump output eval $(echo $reloc | sed 's/\([^+]\+\)+\?\(0x[0-9a-f]\+\)\?/symbol="\1"; symbol_offset="\2"/') # When the relocation points to the begining of a symbol or section, it # won't print the offset since it is zero. if [ -z "${symbol_offset}" ]; then symbol_offset=0x0 fi } function find_alt_replacement_target() { # The target of the .altinstr_replacement is the relocation just before # the .altinstr_replacement one. eval $(objdump -rj .altinstructions ${obj} | grep -B1 "${section}+${section_offset}" | head -n1 | awk '{print $3}' | sed 's/\([^+]\+\)+\(0x[0-9a-f]\+\)/alt_target_section="\1"; alt_target_offset="\2"/') } function handle_alt_replacement_reloc() { # This will define alt_target_section and alt_target_section_offset find_alt_replacement_target ${section} ${section_offset} echo "Error: found a reference to .altinstr_replacement in __ex_table:" addr2line -fip -j ${alt_target_section} -e ${obj} ${alt_target_offset} | awk '{print "\t" $0}' error=true } function is_executable_section() { objdump -hwj ${section} ${obj} | grep -q CODE return $? } function handle_suspicious_generic_reloc() { if is_executable_section ${section}; then # We've got a relocation to a non white listed _executable_ # section, print a warning so the developper adds the section to # the white list or fix his code. We try to pretty-print the file # and line number where that relocation was added. echo "Warning: found a reference to section \"${section}\" in __ex_table:" addr2line -fip -j ${section} -e ${obj} ${section_offset} | awk '{print "\t" $0}' else # Something is definitively wrong here since we've got a relocation # to a non-executable section, there's no way this would ever be # running in the kernel. echo "Error: found a reference to non-executable section \"${section}\" in __ex_table at offset ${section_offset}" error=true fi } function handle_suspicious_reloc() { case "${section}" in ".altinstr_replacement") handle_alt_replacement_reloc ${section} ${section_offset} ;; *) handle_suspicious_generic_reloc ${section} ${section_offset} ;; esac } function diagnose() { for reloc in ${suspicious_relocs}; do # Let's find out where the target of the relocation in __ex_table # is, this will define ${symbol} and ${symbol_offset} find_symbol_and_offset_from_reloc ${reloc} # When there's a global symbol at the place of the relocation, # objdump will use it instead of giving us a section+offset, so # let's find out which section is this symbol in and the total # offset withing that section. find_section_offset_from_symbol ${symbol} ${symbol_offset} # In this case objdump was presenting us with a reloc to a symbol # rather than a section. Now that we've got the actual section, # we can skip it if it's in the white_list. if [ -z "$( echo $section | grep -v $(eval echo -e{${white_list}}))" ]; then continue; fi # Will either print a warning if the relocation happens to be in a # section we do not know but has executable bit set, or error out. handle_suspicious_reloc done } function check_debug_info() { objdump -hj .debug_info ${obj} 2> /dev/null > /dev/null || echo -e "${obj} does not contain debug information, the addr2line output will be limited.\n" \ "Recompile ${obj} with CONFIG_DEBUG_INFO to get a more useful output." } check_debug_info diagnose if [ "${error}" ]; then exit 1 fi exit 0