Vitaly Kuznetsov
a629f6bc03
genirq/matrix: Prevent allocation counter corruption
...
[ Upstream commit c93a5e20c3c2dabef8ea360a3d3f18c6f68233ab ]
When irq_matrix_free() is called for an unallocated vector the
managed_allocated and total_allocated counters get out of sync with the
real state of the matrix. Later, when the last interrupt is freed, these
counters will underflow resulting in UINTMAX because the counters are
unsigned.
While this is certainly a problem of the calling code, this can be catched
in the allocator by checking the allocation bit for the to be freed vector
which simplifies debugging.
An example of the problem described above:
https://lore.kernel.org/lkml/20210318192819.636943062@linutronix.de/
Add the missing sanity check and emit a warning when it triggers.
Suggested-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20210319111823.1105248-1-vkuznets@redhat.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-05-11 14:04:05 +02:00
..
bpf
bpf: Fix leakage of uninitialized bpf stack under speculation
2021-05-07 10:51:37 +02:00
cgroup
cgroup: fix psi monitor for root cgroup
2021-02-17 10:35:14 +01:00
configs
debug
kdb: Make memory allocations more robust
2021-03-04 10:26:10 +01:00
dma
swiotlb: fix "x86: Don't panic if can not alloc buffer for swiotlb"
2020-11-18 19:20:32 +01:00
events
perf/core: Fix unconditional security_locked_down() call
2021-05-07 10:51:38 +02:00
gcov
gcov: re-fix clang-11+ support
2021-04-14 08:24:10 +02:00
irq
genirq/matrix: Prevent allocation counter corruption
2021-05-11 14:04:05 +02:00
livepatch
locking
locking/qrwlock: Fix ordering in queued_write_lock_slowpath()
2021-04-28 13:19:14 +02:00
power
PM: EM: postpone creating the debugfs dir till fs_initcall
2021-03-30 14:35:28 +02:00
printk
printk: fix deadlock when kernel panic
2021-03-04 10:26:50 +01:00
rcu
rcu/nocb: Perform deferred wake up before last idle's need_resched() check
2021-03-04 10:26:47 +01:00
sched
sched/membarrier: fix missing local execution of ipi_sync_rq_state()
2021-03-17 17:03:57 +01:00
time
posix-timers: Preserve return value in clock_adjtime32()
2021-05-11 14:04:04 +02:00
trace
ftrace: Handle commands when closing set_ftrace_filter file
2021-05-11 14:04:01 +02:00
.gitignore
acct.c
async.c
audit.c
audit: fix a net reference leak in audit_list_rules_send()
2020-06-22 09:30:59 +02: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_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
backtracetest.c
bounds.c
capability.c
compat.c
configs.c
context_tracking.c
cpu.c
kernel/cpu: add arch override for clear_tasks_mm_cpumask() mm handling
2020-12-30 11:50:56 +01:00
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
don't dump the threads that had been already exiting when zapped.
2020-11-18 19:20:31 +01:00
extable.c
fail_function.c
fail_function: Remove a redundant mutex unlock
2020-11-24 13:29:18 +01:00
fork.c
exec: Transform exec_update_mutex into a rw_semaphore
2021-01-09 13:44:55 +01:00
freezer.c
Revert "libata, freezer: avoid block device removal while system is frozen"
2019-10-06 09:11:37 -06:00
futex.c
kernel, fs: Introduce and use set_restart_fn() and arch_set_restart_data()
2021-03-24 11:26:44 +01:00
gen_kheaders.sh
kbuild: add variables for compression tools
2020-09-03 11:27:10 +02:00
groups.c
hung_task.c
iomem.c
irq_work.c
jump_label.c
kallsyms.c
kallsyms: Refactor kallsyms_show_value() to take cred
2020-07-16 08:16:44 +02:00
kcmp.c
exec: Transform exec_update_mutex into a rw_semaphore
2021-01-09 13:44:55 +01:00
Kconfig.freezer
Kconfig.hz
Kconfig.locks
Kconfig.preempt
kcov.c
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
ima: Free IMA measurement buffer after kexec syscall
2021-03-04 10:26:25 +01: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
tracing/kprobe: Fix to support kretprobe events on unloaded modules
2021-02-13 13:52:54 +01:00
ksysfs.c
kthread.c
kthread: Extract KTHREAD_IS_PER_CPU
2021-02-07 15:35:49 +01:00
latencytop.c
Makefile
elfcore: fix building with clang
2021-01-23 15:57:55 +01:00
module-internal.h
module.c
modules: inherit TAINT_PROPRIETARY_MODULE
2021-05-11 14:04:04 +02:00
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
panic: ensure preemption is disabled during panic()
2019-10-07 15:47:19 -07:00
params.c
pid.c
pid_namespace.c
profile.c
ptrace.c
ptrace: Set PF_SUPERPRIV when checking capability
2020-11-24 13:29:24 +01:00
range.c
reboot.c
reboot: fix overflow parsing reboot cpu number
2020-11-18 19:20:30 +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
seccomp.c
seccomp: Add missing return in non-void function
2021-03-04 10:26:45 +01:00
signal.c
ptrace: fix task_join_group_stop() for the case when current is traced
2020-11-10 12:37:24 +01:00
smp.c
smpboot.c
kthread: Extract KTHREAD_IS_PER_CPU
2021-02-07 15:35:49 +01:00
smpboot.h
softirq.c
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
kernel/sys.c: avoid copying possible padding bytes in copy_to_user
2020-10-01 13:17:23 +02:00
sys_ni.c
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
sysctl.c: fix underflow value setting risk in vm_table
2021-03-17 17:03:45 +01:00
sysctl_binary.c
task_work.c
taskstats.c
taskstats: fix data-race
2020-01-09 10:19:54 +01:00
test_kprobes.c
torture.c
tracepoint.c
tracepoint: Do not fail unregistering a probe due to memory failure
2021-03-04 10:26:32 +01: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
user-return-notifier.c
user.c
user_namespace.c
utsname.c
utsname_sysctl.c
watchdog.c
watchdog/softlockup: Enforce that timestamp is valid on boot
2020-02-24 08:36:52 +01:00
watchdog_hld.c
workqueue.c
workqueue: Move the position of debug_work_activate() in __queue_work()
2021-04-14 08:24:17 +02:00
workqueue_internal.h