anolis-cloud-kernel/kernel/irq
Barry Song 10df72ea5f genirq: Add IRQF_NO_AUTOEN for request_irq/nmi()
ANBZ: #12990

commit cbe16f35be upstream.

Many drivers don't want interrupts enabled automatically via request_irq().
So they are handling this issue by either way of the below two:

(1)
  irq_set_status_flags(irq, IRQ_NOAUTOEN);
  request_irq(dev, irq...);

(2)
  request_irq(dev, irq...);
  disable_irq(irq);

The code in the second way is silly and unsafe. In the small time gap
between request_irq() and disable_irq(), interrupts can still come.

The code in the first way is safe though it's subobtimal.

Add a new IRQF_NO_AUTOEN flag which can be handed in by drivers to
request_irq() and request_nmi(). It prevents the automatic enabling of the
requested interrupt/nmi in the same safe way as #1 above. With that the
various usage sites of #1 and #2 above can be simplified and corrected.

Signed-off-by: Barry Song <song.bao.hua@hisilicon.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: dmitry.torokhov@gmail.com
Link: https://lore.kernel.org/r/20210302224916.13980-2-song.bao.hua@hisilicon.com
Fixes: CVE-2024-27437
Signed-off-by: Qinyun Tan <qinyuntan@linux.alibaba.com>
Reviewed-by: Guanghui Feng <guanghuifeng@linux.alibaba.com>
Link: https://gitee.com/anolis/cloud-kernel/pulls/4379
2024-12-26 04:23:39 +00:00
..
Kconfig genirq: Provide a snapshot mechanism for interrupt statistics 2024-05-18 00:30:34 +00:00
Makefile genirq/timings: Add selftest for circular array 2019-06-12 10:47:04 +02:00
affinity.c anolis: genirq/affinity: add support for limiting managed interrupts 2024-11-04 09:22:10 +00:00
autoprobe.c genirq: Delay deactivation in free_irq() 2019-07-03 10:12:28 +02:00
chip.c irq: Fix typos in comments 2024-08-07 09:37:56 +00:00
cpuhotplug.c anolis: genirq/cpuhotplug: Handle managed IRQs when the last CPU hotplug out in the affinity 2024-11-04 09:22:10 +00:00
debug.h
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 irq: Fix typos in comments 2024-08-07 09:37:56 +00:00
generic-chip.c genirq/generic_chip: Make irq_remove_generic_chip() irqdomain aware 2024-08-07 09:37:56 +00:00
handle.c random: remove unused irq_flags argument from add_interrupt_randomness() 2022-05-30 09:33:27 +02:00
internals.h genirq: Increase the number of IRQ descriptors 2024-12-17 08:54:59 +00:00
ipi.c genirq: Fix various typos in comments 2018-12-18 14:22:28 +01:00
irq_sim.c genirq/irq_sim: Simplify the API 2020-05-18 10:30:21 +01:00
irqdesc.c irq: Fix typos in comments 2024-08-07 09:37:56 +00:00
irqdomain.c irqdomain: Fix domain registration race 2024-08-07 09:37:56 +00:00
manage.c genirq: Add IRQF_NO_AUTOEN for request_irq/nmi() 2024-12-26 04:23:39 +00:00
matrix.c genirq/matrix: Exclude managed interrupts in irq_matrix_allocated() 2024-08-07 09:37:56 +00:00
migration.c genirq/migration: Avoid out of line call if pending is not set 2018-06-06 15:18:20 +02:00
msi.c irq: Fix typos in comments 2024-08-07 09:37:56 +00:00
pm.c genirq/PM: Introduce IRQCHIP_ENABLE_WAKEUP_ON_SUSPEND flag 2020-10-06 11:23:41 +01:00
proc.c genirq: Avoid summation loops for /proc/interrupts 2024-05-18 00:30:34 +00:00
resend.c genirq: Walk the irq_data hierarchy when resending an interrupt 2020-09-06 18:25:23 +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 irq: Fix typos in comments 2024-08-07 09:37:56 +00:00