kernel_samsung_a53x/kernel/trace
Tetsuo Handa 5f9a54b11b kernel: Initialize cpumask before parsing
[ Upstream commit c5e3a41187ac01425f5ad1abce927905e4ac44e4 ]

KMSAN complains that new_value at cpumask_parse_user() from
write_irq_affinity() from irq_affinity_proc_write() is uninitialized.

  [  148.133411][ T5509] =====================================================
  [  148.135383][ T5509] BUG: KMSAN: uninit-value in find_next_bit+0x325/0x340
  [  148.137819][ T5509]
  [  148.138448][ T5509] Local variable ----new_value.i@irq_affinity_proc_write created at:
  [  148.140768][ T5509]  irq_affinity_proc_write+0xc3/0x3d0
  [  148.142298][ T5509]  irq_affinity_proc_write+0xc3/0x3d0
  [  148.143823][ T5509] =====================================================

Since bitmap_parse() from cpumask_parse_user() calls find_next_bit(),
any alloc_cpumask_var() + cpumask_parse_user() sequence has possibility
that find_next_bit() accesses uninitialized cpu mask variable. Fix this
problem by replacing alloc_cpumask_var() with zalloc_cpumask_var().

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Link: https://lore.kernel.org/r/20210401055823.3929-1-penguin-kernel@I-love.SAKURA.ne.jp
Stable-dep-of: 98feccbf32cf ("tracing: Prevent bad count for tracing_cpumask_write")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-01-15 16:29:54 +01:00
..
blktrace.c
bpf_trace.c
bpf_trace.h
error_report-traces.c
fgraph.c
ftrace.c ftrace: Fix regression with module command in stack_trace_filter 2024-12-17 13:20:50 +01:00
ftrace_internal.h
ipc_logging.c
ipc_logging_debug.c
ipc_logging_private.h
Kconfig tracing: Build event generation tests only as modules 2024-11-19 14:19:07 +01:00
kprobe_event_gen_test.c
Makefile
power-traces.c
preemptirq_delay_test.c tracing: Add MODULE_DESCRIPTION() to preemptirq_delay_test 2024-11-19 14:19:29 +01:00
ring_buffer.c ring-buffer: Fix a race between readers and resize checks 2024-11-19 12:26:51 +01:00
ring_buffer_benchmark.c
rpm-traces.c
synth_event_gen_test.c
trace.c kernel: Initialize cpumask before parsing 2025-01-15 16:29:54 +01:00
trace.h
trace_benchmark.c
trace_benchmark.h
trace_boot.c
trace_branch.c
trace_clock.c tracing: Use atomic64_inc_return() in trace_clock_counter() 2024-12-17 13:24:31 +01:00
trace_dynevent.c
trace_dynevent.h
trace_entries.h
trace_event_perf.c trace/trace_event_perf: remove duplicate samples on the first tracepoint event 2024-12-17 13:24:08 +01:00
trace_events.c
trace_events_filter.c
trace_events_filter_test.h
trace_events_hist.c
trace_events_inject.c
trace_events_synth.c
trace_events_trigger.c Revert "tracing/trigger: Fix to return error if failed to alloc snapshot" 2024-11-19 11:32:21 +01:00
trace_export.c
trace_functions.c
trace_functions_graph.c
trace_hwlat.c
trace_irqsoff.c
trace_kdb.c
trace_kprobe.c tracing/kprobe: Make trace_kprobe's module callback called after jump_label update 2025-01-15 16:29:50 +01:00
trace_kprobe_selftest.c
trace_kprobe_selftest.h
trace_mmiotrace.c
trace_nop.c
trace_output.c Revert "tracing: Remove precision vsnprintf() check from print event" 2024-11-24 00:22:59 +01:00
trace_output.h
trace_preemptirq.c
trace_printk.c
trace_probe.c tracing: Consider the NULL character when validating the event length 2024-11-23 23:22:00 +01:00
trace_probe.h Revert "tracing/kprobes: Return EADDRNOTAVAIL when func matches several symbols" 2024-11-24 00:22:59 +01:00
trace_probe_tmpl.h
trace_readwrite.c
trace_sched_switch.c
trace_sched_wakeup.c
trace_selftest.c
trace_selftest_dynamic.c
trace_seq.c
trace_stack.c
trace_stat.c
trace_stat.h
trace_synth.h
trace_syscalls.c
trace_uprobe.c
tracing_map.c tracing: Fix cmp_entries_dup() to respect sort() comparison rules 2024-12-17 13:24:28 +01:00
tracing_map.h