linux-sg2042/kernel/irq
Vitaly Kuznetsov c93a5e20c3 genirq/matrix: Prevent allocation counter corruption
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
2021-03-19 22:52:11 +01:00
..
Kconfig irqchip updates for Linux 5.11 2020-12-15 10:48:07 +01:00
Makefile genirq/timings: Add selftest for circular array 2019-06-12 10:47:04 +02:00
affinity.c genirq/affinity: Remove const qualifier from node_to_cpumask argument 2019-08-28 12:20:43 +02:00
autoprobe.c genirq: Delay deactivation in free_irq() 2019-07-03 10:12:28 +02:00
chip.c genirq: Fix typos and misspellings in comments 2021-03-16 15:08:29 +01:00
cpuhotplug.c genirq, sched/isolation: Isolate from handling managed interrupts 2020-01-22 16:29:49 +01:00
debug.h Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/pmladek/printk 2018-02-01 13:36:15 -08:00
debugfs.c Merge branch 'irq/qcom-pdc-wakeup' into irq/irqchip-next 2020-10-06 11:28:03 +01:00
devres.c genirq/devres: Use struct_size() in devm_kzalloc() 2019-04-16 21:54:03 +02:00
dummychip.c genirq: Add missing SPDX identifiers 2018-03-20 14:23:28 +01:00
generic-chip.c genirq: Fix kernel-doc markups 2020-11-16 15:20:54 +01:00
handle.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
internals.h genirq/chip: Use the first chip in irq_chip_compose_msi_msg() 2020-09-16 16:52:28 +02:00
ipi.c genirq: Fix typos and misspellings in comments 2021-03-16 15:08:29 +01:00
irq_sim.c genirq/irq_sim: Simplify the API 2020-05-18 10:30:21 +01:00
irqdesc.c genirq: Fix export of irq_to_desc() for powerpc KVM 2020-12-25 11:02:39 -08:00
irqdomain.c irqdomain: Mark fwnodes when their irqdomain is added/removed 2021-02-09 14:31:06 +01:00
manage.c genirq: Fix typos and misspellings in comments 2021-03-16 15:08:29 +01:00
matrix.c genirq/matrix: Prevent allocation counter corruption 2021-03-19 22:52:11 +01:00
migration.c genirq: Fix typos and misspellings in comments 2021-03-16 15:08:29 +01:00
msi.c genirq/msi: Activate Multi-MSI early when MSI_FLAG_ACTIVATE_EARLY is set 2021-01-30 01:22:31 +01:00
pm.c genirq/PM: Introduce IRQCHIP_ENABLE_WAKEUP_ON_SUSPEND flag 2020-10-06 11:23:41 +01:00
proc.c genirq: Annotate irq stats data races 2020-12-15 16:19:30 +01:00
resend.c genirq: Fix typos and misspellings in comments 2021-03-16 15:08:29 +01:00
settings.h genirq: Allow interrupts to be excluded from /proc/interrupts 2020-09-13 17:04:38 +01:00
spurious.c genirq: Add missing __must_hold() sparse annotation 2020-01-09 18:03:37 +01:00
timings.c genirq: Fix typos and misspellings in comments 2021-03-16 15:08:29 +01:00