android_kernel_motorola_sm6375/kernel
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Steven Rostedt (VMware) 4a44efda70 tracing: Check return value of __create_val_fields() before using its result
After having a typo for writing a histogram trigger.

Wrote:
  echo 'hist:key=pid:ts=common_timestamp.usec' > events/sched/sched_waking/trigger

Instead of:
  echo 'hist:key=pid:ts=common_timestamp.usecs' > events/sched/sched_waking/trigger

and the following crash happened:

 BUG: kernel NULL pointer dereference, address: 0000000000000008
 #PF: supervisor read access in kernel mode
 #PF: error_code(0x0000) - not-present page
 PGD 0 P4D 0
 Oops: 0000 [#1] PREEMPT SMP PTI
 CPU: 4 PID: 1641 Comm: sh Not tainted 5.9.0-rc5-test+ #549
 Hardware name: Hewlett-Packard HP Compaq Pro 6300 SFF/339A, BIOS K01 v03.03 07/14/2016
 RIP: 0010:event_hist_trigger_func+0x70b/0x1ee0
 Code: 24 08 89 d5 49 89 cc e9 8c 00 00 00 4c 89 f2 41 b9 00 10 00 00 4c 89 e1 44 89 ee 4c 89 ff e8 dc d3 ff ff 45 89 ea 4b 8b 14 d7 <f6> 42 08 04 74 17 41 8b 8f c0 00 00 00 8d 71 01 41 89 b7 c0 00 00
 RSP: 0018:ffff959213d53db0 EFLAGS: 00010202
 RAX: ffffffffffffffea RBX: 0000000000000000 RCX: 0000000000084c04
 RDX: 0000000000000000 RSI: df7326aefebd174c RDI: 0000000000031080
 RBP: 0000000000000002 R08: 0000000000000001 R09: 0000000000000001
 R10: 0000000000000001 R11: 0000000000000046 R12: ffff959211dcf690
 R13: 0000000000000001 R14: ffff95925a36e370 R15: ffff959251c89800
 FS:  00007fb9ea934740(0000) GS:ffff95925ab00000(0000) knlGS:0000000000000000
 CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
 CR2: 0000000000000008 CR3: 00000000c976c005 CR4: 00000000001706e0
 Call Trace:
  ? trigger_process_regex+0x78/0x110
  trigger_process_regex+0xc5/0x110
  event_trigger_write+0x71/0xd0
  vfs_write+0xca/0x210
  ksys_write+0x70/0xf0
  do_syscall_64+0x33/0x40
  entry_SYSCALL_64_after_hwframe+0x44/0xa9
 RIP: 0033:0x7fb9eaa29487
 Code: 64 89 02 48 c7 c0 ff ff ff ff eb bb 0f 1f 80 00 00 00 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 51 c3 48 83 ec 28 48 89 54 24 18 48 89 74 24

This was caused by accessing the hlist_data fields after the call to
__create_val_fields() without checking if the creation succeed.

Link: https://lkml.kernel.org/r/20201013154852.3abd8702@gandalf.local.home

Change-Id: I5c9f3561f724aceea24a7ef43dcc50c7e79bf8ff
Fixes: 63a1e5de3006 ("tracing: Save normal string variables")
Reviewed-by: Masami Hiramatsu <mhiramat@kernel.org>
Reviewed-by: Tom Zanussi <zanussi@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Git-commit: 6d9bd139455d9d40fec8c242985996468b34180c
Git-repo: https://android.googlesource.com/kernel/common/
Signed-off-by: Srinivasarao Pathipati <quic_c_spathi@quicinc.com>
2022-05-12 22:44:11 -07:00
..
bpf UPSTREAM: bpf: Add kconfig knob for disabling unpriv bpf by default 2022-03-14 12:47:00 +01:00
cgroup Merge android11-5.4.180+ (598165f) into msm-5.4 2022-04-21 10:51:21 +05:30
configs
debug kdb: Make memory allocations more robust 2021-03-04 10:26:10 +01:00
dma Merge android11-5.4.161+ (b9d179c) into msm-5.4 2022-02-07 22:29:21 +05:30
events Merge android11-5.4.180+ (598165f) into msm-5.4 2022-04-21 10:51:21 +05:30
gcov gcov: re-fix clang-11+ support 2021-04-14 08:24:10 +02:00
irq Merge android11-5.4.147+ (dc8c919) into msm-5.4 2021-11-05 17:27:33 +05:30
livepatch ANDROID: kallsyms: increase KSYM_NAME_LEN 2020-08-04 19:33:41 +00:00
locking Merge android11-5.4.161+ (b9d179c) into msm-5.4 2022-02-07 22:29:21 +05:30
power Merge android11-5.4.180+ (598165f) into msm-5.4 2022-04-21 10:51:21 +05:30
printk Merge android11-5.4.161+ (b9d179c) into msm-5.4 2022-02-07 22:29:21 +05:30
rcu Merge android11-5.4.180+ (598165f) into msm-5.4 2022-04-21 10:51:21 +05:30
sched Merge android11-5.4.180+ (598165f) into msm-5.4 2022-04-21 10:51:21 +05:30
time Merge android11-5.4.180+ (598165f) into msm-5.4 2022-04-21 10:51:21 +05:30
trace tracing: Check return value of __create_val_fields() before using its result 2022-05-12 22:44:11 -07:00
.gitignore This is the 5.4.118 stable release 2021-05-11 16:56:33 +02:00
acct.c
async.c
audit.c audit: improve audit queue handling when "audit=1" on cmdline 2022-02-08 18:24:26 +01:00
audit.h audit: fix a net reference leak in audit_list_rules_send() 2020-06-22 09:30:59 +02:00
audit_fsnotify.c
audit_tree.c audit: move put_tree() to avoid trim_trees refcount underflow and UAF 2021-09-03 10:08:16 +02:00
audit_watch.c audit: CONFIG_CHANGE don't log internal bookkeeping as an event 2020-10-01 13:17:32 +02:00
auditfilter.c audit: fix a net reference leak in audit_list_rules_send() 2020-06-22 09:30:59 +02:00
auditsc.c audit: fix possible null-pointer dereference in audit_filter_rules 2021-10-27 09:54:27 +02:00
backtracetest.c
bounds.c
capability.c
cfi.c ANDROID: cfi: ensure RCU is watching in __cfi_slowpath 2020-11-02 18:55:52 +00:00
compat.c
configs.c
context_tracking.c
cpu.c Merge android11-5.4.134+ (dca02b1) into msm-5.4 2021-10-06 09:48:07 +05:30
cpu_pm.c kernel/cpu_pm: Fix uninitted local in cpu_pm 2020-06-22 09:31:22 +02:00
crash_core.c
crash_dump.c
cred.c keys: Fix request_key() cache 2020-01-17 19:48:42 +01:00
delayacct.c
dma.c
exec_domain.c
exit.c Merge android11-5.4.86+ (75c93eb) into msm-5.4 2021-04-22 09:44:51 +05:30
extable.c
fail_function.c fail_function: Remove a redundant mutex unlock 2020-11-24 13:29:18 +01:00
fork.c Merge android11-5.4.161+ (b9d179c) into msm-5.4 2022-02-07 22:29:21 +05:30
freezer.c
futex.c Linux 5.4.129 2021-06-30 19:19:07 +02:00
gen_kheaders.sh Revert one chunk from 37432a83fa commit 2021-03-18 11:01:03 +05:30
groups.c
hung_task.c hung task: check specific tasks for long uninterruptible sleep state 2020-03-23 15:44:56 -07:00
iomem.c
irq_work.c
jump_label.c
kallsyms.c ANDROID: kallsyms: ignore ThinLTO+CFI hash suffix in kallsyms_lookup_name() 2020-09-22 20:17:26 +00:00
kcmp.c Revert "kernel/kcmp.c: Use new infrastructure to fix deadlocks in execve" 2021-01-11 14:35:18 +01:00
Kconfig.freezer
Kconfig.hz
Kconfig.locks
Kconfig.preempt
kcov.c UPSTREAM: kcov: remote coverage support 2020-01-13 18:54:56 +00:00
kexec.c
kexec_core.c kernel: kexec: remove the lock operation of system_transition_mutex 2021-02-03 23:25:56 +01:00
kexec_elf.c
kexec_file.c kernel: kexec_file: fix error return code of kexec_calculate_store_digests() 2021-05-19 10:08:28 +02:00
kexec_internal.h
kheaders.c
kmod.c kmod: make request_module() return an error when autoloading is disabled 2020-04-17 10:50:22 +02:00
kprobes.c kprobes: Limit max data_size of the kretprobe instances 2021-12-08 09:01:10 +01:00
ksysfs.c
kthread.c This is the 5.4.145 stable release 2021-09-12 09:54:40 +02:00
latencytop.c
Makefile kbuild: update config_data.gz only when the content of .config is changed 2021-05-11 14:04:16 +02:00
module-internal.h
module.c Merge android11-5.4.134+ (dca02b1) into msm-5.4 2021-10-06 09:48:07 +05:30
module_signature.c module: harden ELF info handling 2021-04-07 14:47:38 +02:00
module_signing.c module: harden ELF info handling 2021-04-07 14:47:38 +02:00
notifier.c kernel/notifier.c: intercept duplicate registrations to avoid infinite loops 2020-10-01 13:17:23 +02:00
nsproxy.c
padata.c padata: add separate cpuhp node for CPUHP_PADATA_DEAD 2020-06-17 16:40:22 +02:00
panic.c
params.c
pid.c Merge android11-5.4.61+ (d240b69) into msm-5.4 2020-10-09 07:27:04 -07:00
pid_namespace.c memcg: enable accounting for pids in nested pid namespaces 2021-09-22 12:26:37 +02:00
profile.c profiling: fix shift-out-of-bounds bugs 2021-09-26 14:07:09 +02:00
ptrace.c ptrace: make ptrace() fail if the tracee changed its pid unexpectedly 2021-05-26 12:05:15 +02:00
range.c
reboot.c This is the 5.4.78 stable release 2020-11-19 08:52:52 +01:00
relay.c kernel/relay.c: fix memleak on destroy relay channel 2020-08-26 10:40:51 +02:00
resource.c /dev/mem: Revoke mappings when a driver claims the region 2020-06-24 17:50:35 +02:00
rseq.c
scs.c ANDROID: scs: fix recursive spinlock in scs_check_usage 2020-06-09 23:39:55 -07:00
seccomp.c seccomp: Invalidate seccomp mode to catch death failures 2022-02-16 12:52:53 +01:00
signal.c Merge android11-5.4.161+ (b9d179c) into msm-5.4 2022-02-07 22:29:21 +05:30
smp.c Revert "smp: Fix smp_call_function_single_async prototype" 2021-05-14 15:29:26 +02:00
smpboot.c kthread: Extract KTHREAD_IS_PER_CPU 2021-02-07 15:35:49 +01:00
smpboot.h
softirq.c trace: Add trace points for tasklet entry/exit 2020-02-25 07:37:13 -08:00
stackleak.c
stacktrace.c stacktrace: Don't skip first entry on noncurrent tasks 2019-11-04 21:19:25 +01:00
stop_machine.c stop_machine: Avoid potential race behaviour 2019-10-17 12:47:12 +02:00
sys.c Merge 5.4.149 into android11-5.4-lts 2021-10-01 14:07:54 +02:00
sys_ni.c mm/madvise: introduce process_madvise() syscall: an external memory hinting API 2020-06-18 17:55:54 +05:30
sysctl-test.c kernel/sysctl-test: Add null pointer test for sysctl.c:proc_dointvec() 2020-10-01 13:17:10 +02:00
sysctl.c Merge android11-5.4.180+ (598165f) into msm-5.4 2022-04-21 10:51:21 +05:30
sysctl_binary.c
task_work.c
taskstats.c taskstats: properly account NR_KERNEL_MISC_RECLAIMABLE 2021-07-01 06:18:34 -07:00
test_kprobes.c
torture.c
tracepoint.c tracepoint: Add tracepoint_probe_register_may_exist() for BPF tracing 2021-07-14 16:53:08 +02:00
tsacct.c
ucount.c
uid16.c
uid16.h
umh.c usermodehelper: reset umask to default before executing user process 2020-10-14 10:32:58 +02:00
up.c Revert "smp: Fix smp_call_function_single_async prototype" 2021-05-14 15:29:26 +02:00
user-return-notifier.c
user.c Revert "ANDROID: proc: Add /proc/uid directory" 2020-03-06 20:23:08 +00:00
user_namespace.c
utsname.c
utsname_sysctl.c
watchdog.c Merge android-5.4.24 (ce5de62) into msm-5.4 2020-04-14 08:25:29 -07:00
watchdog_hld.c
workqueue.c Merge android11-5.4.180+ (598165f) into msm-5.4 2022-04-21 10:51:21 +05:30
workqueue_internal.h