android_kernel_motorola_sm6375/scripts
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Danesh Petigara 2f397d4f68 ANDROID: recordmcount: avoid STT_FILE as base for mcount offset relocation
This problem was observed with a kernel built using clang and
LTO.

When the section header index of a section that contains mcount
calls coincides with SHN_ABS, recordmcount ends up selecting a
STT_FILE symbol as the base for mcount offset relocation. Since
the STT_FILE symbol value is 0, it's not a suitable candidate as
the base for relocation and results in the __mcount_loc table
containing an invalid entry causing kernel oops in ftrace_init():

[    0.000000] ftrace: allocating 45789 entries in 179 pages
[    0.000000] ------------[ cut here ]------------
[    0.000000] WARNING: CPU: 0 PID: 0 at arch/arm64/kernel/ftrace.c:172 ftrace_make_nop+0x11c/0x150
[    0.000000] Modules linked in:
[    0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 5.4.69-0-1pre+ #1
[    0.000000] Hardware name: BCM972180HB_V20 (DT)
[    0.000000] pstate: 20400085 (nzCv daIf +PAN -UAO)
[    0.000000] pc : ftrace_make_nop+0x11c/0x150
[    0.000000] lr : ftrace_make_nop+0x5c/0x150
[    0.000000] sp : ffffffc011a43ef0
[    0.000000] x29: ffffffc011a43f00 x28: 0000000000000001
[    0.000000] x27: ffffff8027801380 x26: 0000000000000000
[    0.000000] x25: ffffff8027880008 x24: 0000000000000000
[    0.000000] x23: 0000000000000000 x22: 0000000000000008
[    0.000000] x21: ffffffc010f5acdc x20: 0000000000000000
[    0.000000] x19: 0000000000000020 x18: ffffffc011a79020
[    0.000000] x17: 000000000000003c x16: 0000000000000022
[    0.000000] x15: dead000000000100 x14: 0000000000000001
[    0.000000] x13: 0000000000000000 x12: 0000000000000000
[    0.000000] x11: 0000000000000000 x10: 0000000008000000
[    0.000000] x9 : 0000000000000002 x8 : 0000000000000001
[    0.000000] x7 : 0000000000000000 x6 : 000000000000003f
[    0.000000] x5 : 00000000000235b8 x4 : 0000000000000001
[    0.000000] x3 : 0000000000000001 x2 : ffffffc010f5acdc
[    0.000000] x1 : ffffff8027880000 x0 : 0000000000000001
[    0.000000] Call trace:
[    0.000000]  ftrace_make_nop+0x11c/0x150
[    0.000000]  ftrace_process_locs+0x338/0x3e0
[    0.000000]  ftrace_init+0xac/0xdc
[    0.000000]  start_kernel+0x194/0x43c
[    0.000000] random: get_random_bytes called from __warn+0xe0/0x138 with crng_init=0
[    0.000000] ---[ end trace a8999690c4edae16 ]---
[    0.000000] ------------[ cut here ]------------
[    0.000000] WARNING: CPU: 0 PID: 0 at kernel/trace/ftrace.c:2008 ftrace_bug+0x94/0x268
[    0.000000] Modules linked in:
[    0.000000] CPU: 0 PID: 0 Comm: swapper Tainted: G        W         5.4.69-0-1pre+ #1
[    0.000000] Hardware name: BCM972180HB_V20 (DT)
[    0.000000] pstate: 60400085 (nZCv daIf +PAN -UAO)
[    0.000000] pc : ftrace_bug+0x94/0x268
[    0.000000] lr : ftrace_process_locs+0x364/0x3e0
[    0.000000] sp : ffffffc011a43ef0
[    0.000000] x29: ffffffc011a43ef0 x28: 0000000000000001
[    0.000000] x27: ffffff8027801380 x26: 0000000000000000
[    0.000000] x25: ffffff8027880008 x24: 0000000000000000
[    0.000000] x23: 0000000000000000 x22: 0000000000000008
[    0.000000] x21: ffffffc010f5acdc x20: 0000000000000020
[    0.000000] x19: ffffff8027880000 x18: ffffffc011a79020
[    0.000000] x17: 000000000000003c x16: 0000000000000022
[    0.000000] x15: dead000000000100 x14: 0000000000000001
[    0.000000] x13: 0000000000000000 x12: ffffffc010f5ed94
[    0.000000] x11: ffffffc011a4f000 x10: ffffffc011a4f000
[    0.000000] x9 : 0000000000000001 x8 : ffffffc011a4f000
[    0.000000] x7 : 0000000000000000 x6 : 000000000000003f
[    0.000000] x5 : 00000000000235b8 x4 : 0000000000000001
[    0.000000] x3 : 0000000000000001 x2 : ffffffc010f5acdc
[    0.000000] x1 : ffffff8027880000 x0 : ffffffc01151ade2
[    0.000000] Call trace:
[    0.000000]  ftrace_bug+0x94/0x268
[    0.000000]  ftrace_process_locs+0x364/0x3e0
[    0.000000]  ftrace_init+0xac/0xdc
[    0.000000]  start_kernel+0x194/0x43c
[    0.000000] ---[ end trace a8999690c4edae17 ]---
[    0.000000] ftrace failed to modify
[    0.000000] [<0000000000000020>] 0x20
[    0.000000]  actual:
[    0.000000] Unable to handle kernel read from unreadable memory at virtual address 0000000000000020
[    0.000000] Mem abort info:
[    0.000000]   ESR = 0x96000005
[    0.000000]   EC = 0x25: DABT (current EL), IL = 32 bits
[    0.000000]   SET = 0, FnV = 0
[    0.000000]   EA = 0, S1PTW = 0
[    0.000000] Data abort info:
[    0.000000]   ISV = 0, ISS = 0x00000005
[    0.000000]   CM = 0, WnR = 0
[    0.000000] [0000000000000020] user address but active_mm is swapper
[    0.000000] Internal error: Oops: 96000005 [#1] PREEMPT SMP
[    0.000000] Modules linked in:
[    0.000000] CPU: 0 PID: 0 Comm: swapper Tainted: G        W         5.4.69-0-1pre+ #1
[    0.000000] Hardware name: BCM972180HB_V20 (DT)
[    0.000000] pstate: 60400085 (nZCv daIf +PAN -UAO)
[    0.000000] pc : print_ip_ins+0x48/0x80
[    0.000000] lr : print_ip_ins+0x2c/0x80
[    0.000000] sp : ffffffc011a43eb0
[    0.000000] x29: ffffffc011a43eb0 x28: 0000000000000001
[    0.000000] x27: ffffff8027801380 x26: 0000000000000000
[    0.000000] x25: ffffff8027880008 x24: 0000000000000000
[    0.000000] x23: ffffffc0115f1abc x22: ffffffc01160e929
[    0.000000] x21: 0000000000000000 x20: ffffffc011577a9c
[    0.000000] x19: 0000000000000020 x18: ffffffc011a79028
[    0.000000] x17: 000000000000002c x16: ffffffc010f33fec
[    0.000000] x15: 0000000000000004 x14: ffff0000ffffff00
[    0.000000] x13: 0000000000000000 x12: 0000000000000000
[    0.000000] x11: 0000000000000000 x10: 00000000ffffffff
[    0.000000] x9 : 0000000000000000 x8 : 0000000000000000
[    0.000000] x7 : 3030303030303030 x6 : ffffffc011c031a3
[    0.000000] x5 : 000000000000000b x4 : ffffffc011c00866
[    0.000000] x3 : 0000000000000020 x2 : 000000000000000b
[    0.000000] x1 : ffffffc011c00871 x0 : 000000000000000b
[    0.000000] Call trace:
[    0.000000]  print_ip_ins+0x48/0x80
[    0.000000]  ftrace_bug+0xcc/0x268
[    0.000000]  ftrace_process_locs+0x364/0x3e0
[    0.000000]  ftrace_init+0xac/0xdc
[    0.000000]  start_kernel+0x194/0x43c
[    0.000000] Code: aa1f03f5 9124a6d6 912af2f7 912a7294 (38756a62)
[    0.000000] ---[ end trace a8999690c4edae18 ]---
[    0.000000] Kernel panic - not syncing: Attempted to kill the idle task!

This can be fixed by avoiding STT_FILE symbols as the base for
mcount offset relocation.

Bug: 168835511
Signed-off-by: Danesh Petigara <danesh.petigara@broadcom.com>
Signed-off-by: Pierre Couillaud <pierre@broadcom.com>
Change-Id: I9e73706d5104bfa81bccd091e956660364f294de
2020-10-22 19:57:13 +00:00
..
atomic locking/atomics: Use sed(1) instead of non-standard head(1) option 2019-06-25 10:17:07 +02:00
basic kbuild: remove unneeded comments and code from scripts/basic/Makefile 2019-08-29 23:54:29 +09:00
coccinelle scripts: add dummy report mode to add_namespace.cocci 2020-08-11 15:33:35 +02:00
dtc scripts/dtc: Remove redundant YYLOC global declaration 2020-04-01 11:02:00 +02:00
gcc-plugins gcc-common.h: Update for GCC 10 2020-05-27 17:46:24 +02:00
gdb scripts/gdb: fix lx-symbols 'gdb.error' while loading modules 2020-07-29 10:18:35 +02:00
genksyms genksyms: convert to SPDX License Identifier for lex.l and parse.y 2019-09-14 11:40:13 +09:00
kconfig kconfig: qconf: fix signal connection to invalid slots 2020-08-26 10:41:04 +02:00
ksymoops
mod UPSTREAM: scripts: Fix the inclusion order in modpost 2020-04-27 18:37:46 -07:00
package kbuild/deb-pkg: annotate libelf-dev dependency as :native 2020-01-17 19:49:07 +01:00
selinux treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
tracing treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 166 2019-05-30 11:26:39 -07:00
.gitignore scripts: remove unnecessary ihex2fw and check-lc_ctypes from .gitignore 2018-12-22 00:37:52 +09:00
adjust_autoksyms.sh FROMLIST: kbuild: split adjust_autoksyms.sh in two parts 2020-02-27 15:13:00 +00:00
asn1_compiler.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 36 2019-05-24 17:27:11 +02:00
bin2c.c
bloat-o-meter bloat-o-meter: ignore __addressable_ symbols 2018-12-28 12:11:44 -08:00
bootgraph.pl treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 391 2019-06-05 17:37:11 +02:00
bpf_helpers_doc.py bpf: fix script for generating man page on BPF helpers 2019-05-13 01:12:45 +02:00
cc-can-link.sh
check_extable.sh
checkincludes.pl
checkkconfigsymbols.py treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 166 2019-05-30 11:26:39 -07:00
checkpatch.pl UPSTREAM: update to latest version of scripts/checkpatch.pl 2020-08-14 13:16:17 +02:00
checkstack.pl scripts/checkstack.pl: Fix arm64 wrong or unknown architecture 2019-06-05 02:33:10 +09:00
checksyscalls.sh checksyscalls: fix up mq_timedreceive and stat exceptions 2019-02-19 21:27:53 +01:00
checkversion.pl
clang-android.sh ANDROID: Kbuild, LLVMLinux: allow overriding clang target triple 2019-05-03 10:39:56 -07:00
clang-version.sh kbuild: update comment block of scripts/clang-version.sh 2019-03-04 22:34:54 +09:00
cleanfile
cleanpatch
coccicheck
config scripts/config: allow colons in option strings for sed 2020-05-10 10:31:27 +02:00
conmakehash.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 54 2019-05-24 17:36:42 +02:00
const_structs.checkpatch
decode_stacktrace.sh scripts/decode_stacktrace: strip basepath from all paths 2020-07-29 10:18:35 +02:00
decodecode scripts/decodecode: fix trapping instruction formatting 2020-05-14 07:58:29 +02:00
depmod.sh kbuild: modules_install: warn when missing System.map file 2018-09-09 09:14:07 +09:00
diffconfig
documentation-file-ref-check scripts/documentation-file-ref-check: ignore output dir 2019-06-14 14:43:01 -06:00
export_report.pl modpost: move the namespace field in Module.symvers last 2020-03-25 08:25:55 +01:00
extract-cert.c
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
extract_xc3028.pl treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 339 2019-06-05 17:37:07 +02:00
faddr2line scripts/faddr2line: fix location of start_kernel in comment 2018-11-18 10:15:09 -08:00
file-size.sh
find-unused-docs.sh scripts/find-unused-docs: Fix massive false positives 2020-02-11 04:35:23 -08:00
gcc-goto.sh jump_label: move 'asm goto' support test to Kconfig 2019-01-06 09:46:51 +09:00
gcc-ld
gcc-plugin.sh
gcc-version.sh kbuild: clean up scripts/gcc-version.sh 2019-03-04 22:35:04 +09:00
gcc-x86_32-has-stack-protector.sh
gcc-x86_64-has-stack-protector.sh
gen_autoksyms.sh ANDROID: kbuild: align UNUSED_KSYMS_WHITELIST with upstream 2020-03-10 13:10:27 +00:00
gen_compile_commands.py gen_compile_commands: lower the entry count threshold 2019-07-27 12:18:19 +09:00
gen_ksymdeps.sh kbuild: simplify dependency generation for CONFIG_TRIM_UNUSED_KSYMS 2018-12-01 23:13:14 +09:00
generate_initcall_order.pl ANDROID: init: ensure initcall ordering with LTO 2019-11-27 12:49:11 -08:00
get_abi.pl doc: ABI scripts: add a SPDX header file 2019-06-21 16:58:37 +02:00
get_dvb_firmware treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 61 2019-05-24 17:36:45 +02:00
get_maintainer.pl get_maintainer: add ability to skip moderated mailing lists 2019-07-16 19:23:22 -07:00
gfp-translate treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 166 2019-05-30 11:26:39 -07:00
headerdep.pl
headers_check.pl
headers_install.sh scripts: headers_install: Exit with error on config leak 2020-06-24 17:50:33 +02:00
insert-sys-cert.c
kallsyms.c ANDROID: kallsyms: increase KSYM_NAME_LEN 2020-08-04 19:33:41 +00:00
Kbuild.include kbuild: improve cc-option to clean up all temporary files 2020-06-30 15:37:05 -04:00
Kconfig.include kconfig: introduce m32-flag and m64-flag 2020-04-08 09:08:37 +02:00
kernel-doc kernel-doc: Allow anonymous enum 2019-08-12 15:00:37 -06:00
ld-version.sh
leaking_addresses.pl treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 166 2019-05-30 11:26:39 -07:00
Lindent
link-vmlinux.sh This is the 5.4.47 stable release 2020-06-18 10:05:17 +02:00
Makefile ANDROID: kbuild: don't preprocess module-lto.lds 2020-08-19 09:15:50 -07:00
Makefile.asm-generic kbuild: force all architectures except um to include mandatory-y 2019-03-17 12:56:32 +09:00
Makefile.build This is the 5.4.24 stable release 2020-03-05 17:42:40 +01:00
Makefile.clean kbuild: clean up subdir-ymn calculation in Makefile.clean 2019-08-29 23:54:29 +09:00
Makefile.dtbinst
Makefile.extrawarn kbuild: Disable -Wpointer-to-enum-cast 2020-03-25 08:25:54 +01:00
Makefile.gcc-plugins gcc-plugins: structleak: Generalize to all variable types 2019-03-04 09:29:41 -08:00
Makefile.headersinst kbuild: move headers_check rule to usr/include/Makefile 2020-03-05 16:43:47 +01:00
Makefile.host kbuild: change *FLAGS_<basetarget>.o to take the path relative to $(obj) 2019-09-04 23:12:50 +09:00
Makefile.kasan kasan/arm64: fix CONFIG_KASAN_SW_TAGS && KASAN_INLINE 2019-08-15 13:24:04 +01:00
Makefile.kcov treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile.lib ANDROID: GKI: scripts: Makefile: update the lz4 command (#2) 2020-07-01 19:16:31 +00:00
Makefile.modbuiltin kbuild: get rid of kernel/ prefix from in-tree modules.{order,builtin} 2019-07-17 22:39:27 +09:00
Makefile.modfinal ANDROID: kbuild: fix dynamic ftrace with clang LTO 2019-11-27 12:49:10 -08:00
Makefile.modinst kbuild: modinst: read modules.order instead of $(MODVERDIR)/*.mod 2019-07-17 22:39:27 +09:00
Makefile.modpost ANDROID: kbuild: add support for Clang LTO 2019-11-27 12:49:10 -08:00
Makefile.modsign kbuild: modsign: read modules.order instead of $(MODVERDIR)/*.mod 2019-07-17 22:39:27 +09:00
Makefile.package kbuild: pkg: rename scripts/package/Makefile to scripts/Makefile.package 2019-08-25 07:42:00 +09:00
Makefile.ubsan ubsan: Remove vla bound checks. 2019-05-06 11:12:09 -07:00
makelst
markup_oops.pl treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 373 2019-06-05 17:37:10 +02:00
mkcompile_h UPSTREAM: kbuild: use CONFIG_CC_VERSION_TEXT to construct LINUX_COMPILER macro 2020-09-24 10:02:57 +00:00
mkmakefile kbuild: get rid of $(realpath ...) from scripts/mkmakefile 2019-08-29 23:54:29 +09:00
mksysmap mksysmap: Fix the mismatch of '.L' symbols in System.map 2020-06-24 17:50:19 +02:00
mkuboot.sh
module-common.lds
module-lto.lds ANDROID: kbuild: don't preprocess module-lto.lds 2020-08-19 09:15:50 -07:00
modules-check.sh kbuild: get rid of kernel/ prefix from in-tree modules.{order,builtin} 2019-07-17 22:39:27 +09:00
namespace.pl namespace: fix namespace.pl script to support relative paths 2019-10-05 15:29:49 +09:00
nsdeps scripts: add dummy report mode to add_namespace.cocci 2020-08-11 15:33:35 +02:00
objdiff treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 199 2019-05-30 11:29:23 -07:00
parse-maintainers.pl parse-maintainers: Mark as executable 2020-03-25 08:25:49 +01:00
patch-kernel
pnmtologo.c
profile2linkerlist.pl
prune-kernel
recordmcount.c Revert "ANDROID: Revert: Merge 5.4.60 into android11-5.4" 2020-08-23 13:12:51 +02:00
recordmcount.h ANDROID: recordmcount: avoid STT_FILE as base for mcount offset relocation 2020-10-22 19:57:13 +00:00
recordmcount.pl treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 166 2019-05-30 11:26:39 -07:00
setlocalversion ANDROID: update the kernel release format for GKI 2020-07-27 22:22:25 +00:00
show_delta treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 438 2019-06-05 17:37:17 +02:00
sign-file.c
sortextable.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 378 2019-06-05 17:37:10 +02:00
sortextable.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 378 2019-06-05 17:37:10 +02:00
spdxcheck-test.sh scripts: add spdxcheck.py self test 2018-12-28 12:11:44 -08:00
spdxcheck.py spdxcheck.py: fix directory structures 2019-06-01 15:51:31 -07:00
spelling.txt scripts/spelling.txt: add more spellings to spelling.txt 2019-07-12 11:05:41 -07:00
sphinx-pre-install scripts/sphinx-pre-install: seek for Noto CJK fonts for pdf output 2019-07-17 06:57:52 -03:00
split-man.pl
stackdelta
stackusage
subarch.include selftests: add headers_install to lib.mk 2018-09-05 08:12:09 -06:00
tags.sh kbuild: add a flag to force absolute path for srctree 2019-07-11 00:05:09 +09:00
tools-support-relr.sh scripts/tools-support-relr.sh: un-quote variables 2019-11-13 10:52:05 +00:00
unifdef.c unifdef: use memcpy instead of strncpy 2018-11-30 14:45:01 -08:00
ver_linux ver_linux: Assign constant RE to variable name for clarity 2019-01-22 13:34:35 +01:00
xen-hypercalls.sh
xz_wrap.sh