/
usr
/
src
/
kernels
/
4.18.0-553.121.1.el8_10.x86_64
/
scripts
/
/usr/src/kernels/4.18.0-553.121.1.el8_10.x86_64/scripts
mkdir
upload
Name
Size
Mode
Actions
basic/
-
0755
rm
clang-tools/
-
0755
rm
coccinelle/
-
0755
rm
dtc/
-
0755
rm
gcc-plugins/
-
0755
rm
gdb/
-
0755
rm
genksyms/
-
0755
rm
kconfig/
-
0755
rm
ksymoops/
-
0755
rm
mod/
-
0755
rm
package/
-
0755
rm
selinux/
-
0755
rm
adjust_autoksyms.sh
3010
0755
edit
dl
rm
asn1_compiler
28008
0755
edit
dl
rm
asn1_compiler.c
36391
0644
edit
dl
rm
bin2c
7024
0755
edit
dl
rm
bin2c.c
743
0644
edit
dl
rm
bloat-o-meter
3313
0755
edit
dl
rm
bootgraph.pl
6426
0755
edit
dl
rm
bpf_doc.py
25515
0755
edit
dl
rm
cc-can-link.sh
166
0755
edit
dl
rm
checkincludes.pl
1984
0755
edit
dl
rm
checkkconfigsymbols.py
15895
0755
edit
dl
rm
checkpatch.pl
197186
0755
edit
dl
rm
checkstack.pl
5303
0755
edit
dl
rm
checksyscalls.sh
7094
0755
edit
dl
rm
checkversion.pl
1938
0755
edit
dl
rm
check_00index.sh
1333
0755
edit
dl
rm
check_extable.sh
5049
0755
edit
dl
rm
clang-version.sh
635
0755
edit
dl
rm
cleanfile
3538
0755
edit
dl
rm
cleanpatch
5178
0755
edit
dl
rm
coccicheck
7407
0755
edit
dl
rm
config
4635
0755
edit
dl
rm
conmakehash
11616
0755
edit
dl
rm
conmakehash.c
6128
0644
edit
dl
rm
const_structs.checkpatch
964
0644
edit
dl
rm
decodecode
2525
0755
edit
dl
rm
decode_stacktrace.sh
3834
0755
edit
dl
rm
depmod.sh
1119
0755
edit
dl
rm
diffconfig
3821
0755
edit
dl
rm
documentation-file-ref-check
3548
0755
edit
dl
rm
export_report.pl
4654
0755
edit
dl
rm
extract-cert
11616
0755
edit
dl
rm
extract-cert.c
3541
0644
edit
dl
rm
extract-ikconfig
1734
0755
edit
dl
rm
extract-module-sig.pl
3742
0755
edit
dl
rm
extract-sys-certs.pl
3832
0755
edit
dl
rm
extract-vmlinux
1725
0755
edit
dl
rm
extract_xc3028.pl
45665
0755
edit
dl
rm
faddr2line
6303
0755
edit
dl
rm
file-size.sh
86
0755
edit
dl
rm
find-unused-docs.sh
1310
0755
edit
dl
rm
gcc-goto.sh
530
0755
edit
dl
rm
gcc-ld
711
0755
edit
dl
rm
gcc-plugin.sh
1090
0755
edit
dl
rm
gcc-version.sh
857
0755
edit
dl
rm
gcc-x86_32-has-stack-protector.sh
173
0755
edit
dl
rm
gcc-x86_64-has-stack-protector.sh
198
0755
edit
dl
rm
gen_initramfs_list.sh
8224
0755
edit
dl
rm
get_dvb_firmware
25824
0755
edit
dl
rm
get_maintainer.pl
67369
0755
edit
dl
rm
gfp-translate
1752
0755
edit
dl
rm
headerdep.pl
3582
0755
edit
dl
rm
headers.sh
512
0755
edit
dl
rm
headers_check.pl
3815
0755
edit
dl
rm
headers_install.sh
1397
0755
edit
dl
rm
insert-sys-cert.c
9084
0644
edit
dl
rm
kallsyms
19992
0755
edit
dl
rm
kallsyms.c
18580
0644
edit
dl
rm
Kbuild.include
15468
0644
edit
dl
rm
Kconfig.include
1173
0644
edit
dl
rm
kernel-doc
62560
0755
edit
dl
rm
ld-version.sh
269
0755
edit
dl
rm
leaking_addresses.pl
13160
0755
edit
dl
rm
Lindent
502
0755
edit
dl
rm
link-vmlinux.sh
9176
0755
edit
dl
rm
Makefile
1741
0644
edit
dl
rm
Makefile.asm-generic
1193
0644
edit
dl
rm
Makefile.build
19707
0644
edit
dl
rm
Makefile.clean
2883
0644
edit
dl
rm
Makefile.dtbinst
1116
0644
edit
dl
rm
Makefile.extrawarn
2770
0644
edit
dl
rm
Makefile.gcc-plugins
1861
0644
edit
dl
rm
Makefile.headersinst
4079
0644
edit
dl
rm
Makefile.host
6520
0644
edit
dl
rm
Makefile.kasan
1679
0644
edit
dl
rm
Makefile.kcov
319
0644
edit
dl
rm
Makefile.kcsan
118
0644
edit
dl
rm
Makefile.lib
15535
0644
edit
dl
rm
Makefile.modbuiltin
1717
0644
edit
dl
rm
Makefile.modinst
1149
0644
edit
dl
rm
Makefile.modpost
5430
0644
edit
dl
rm
Makefile.modsign
897
0644
edit
dl
rm
Makefile.ubsan
951
0644
edit
dl
rm
makelst
808
0755
edit
dl
rm
markup_oops.pl
8273
0755
edit
dl
rm
mkcompile_h
2628
0755
edit
dl
rm
mkmakefile
1218
0755
edit
dl
rm
mksysmap
1359
0755
edit
dl
rm
mkuboot.sh
414
0755
edit
dl
rm
module-common.lds
901
0644
edit
dl
rm
modules.order
0
0644
edit
dl
rm
namespace.pl
13358
0755
edit
dl
rm
objdiff
2917
0755
edit
dl
rm
parse-maintainers.pl
4646
0755
edit
dl
rm
patch-kernel
10185
0755
edit
dl
rm
pnmtologo
15720
0755
edit
dl
rm
pnmtologo.c
12197
0644
edit
dl
rm
profile2linkerlist.pl
410
0755
edit
dl
rm
prune-kernel
708
0755
edit
dl
rm
recordmcount
24008
0755
edit
dl
rm
recordmcount.c
17062
0644
edit
dl
rm
recordmcount.h
16772
0644
edit
dl
rm
recordmcount.pl
18709
0755
edit
dl
rm
setlocalversion
4013
0755
edit
dl
rm
show_delta
3076
0755
edit
dl
rm
sign-file
15768
0755
edit
dl
rm
sign-file.c
9994
0644
edit
dl
rm
sortextable
15712
0755
edit
dl
rm
sortextable.c
10411
0644
edit
dl
rm
sortextable.h
5614
0644
edit
dl
rm
spelling.txt
25611
0644
edit
dl
rm
sphinx-pre-install
14378
0755
edit
dl
rm
split-man.pl
600
0755
edit
dl
rm
stackdelta
1883
0755
edit
dl
rm
stackusage
794
0755
edit
dl
rm
subarch.include
641
0644
edit
dl
rm
tags.sh
9789
0755
edit
dl
rm
test_fortify.sh
2281
0644
edit
dl
rm
unifdef
36192
0755
edit
dl
rm
unifdef.c
35637
0644
edit
dl
rm
ver_linux
2747
0755
edit
dl
rm
xen-hypercalls.sh
386
0644
edit
dl
rm
xz_wrap.sh
562
0755
edit
dl
rm
Edit:
/usr/src/kernels/4.18.0-553.121.1.el8_10.x86_64/scripts/check_extable.sh
(5049B)
#! /bin/bash # SPDX-License-Identifier: GPL-2.0 # (c) 2015, Quentin Casasnovas <quentin.casasnovas@oracle.com> obj=$1 file ${obj} | grep -q ELF || (echo "${obj} is not and 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
Save
cmd:
run