kernel_samsung_a53x/kernel/irq
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
..
affinity.c
autoprobe.c
chip.c genirq: Allow irq_chip registration functions to take a const irq_chip 2024-11-23 23:20:21 +01:00
cpuhotplug.c genirq/cpuhotplug, x86/vector: Prevent vector leak during CPU offline 2024-11-19 12:27:11 +01:00
debug.h
debugfs.c
devres.c
dummychip.c
generic-chip.c
handle.c
internals.h
ipi.c
irq_sim.c
irqdesc.c genirq/irqdesc: Honor caller provided affinity in alloc_desc() 2024-11-23 23:20:29 +01:00
irqdomain.c
Kconfig arm64: Disable GENERIC_IRQ_EFFECTIVE_AFF_MASK 2024-11-19 17:54:22 +01:00
Makefile
manage.c task_work: s/task_work_cancel()/task_work_cancel_func()/ 2024-11-23 23:20:13 +01:00
matrix.c
migration.c
msi.c
pm.c
proc.c kernel: Initialize cpumask before parsing 2025-01-15 16:29:54 +01:00
resend.c
sbalance.c
settings.h
spurious.c irq: spurious: Disable IRQ debugging by default 2024-11-19 18:05:57 +01:00
timings.c