android_kernel_xiaomi_sm8450/arch/arm64/gunyah
Hrishabh Rajput 69060d4cfb gunyah: arm64: Fix possible irq_data use-after-free
Access to irq_data is maintained using RCU. In irq_dispose_mapping(),
unmapping and freeing of the irq data is done asynchronously using
call_rcu() API when the conditions are met.

In the next instruction, the same irq_data which is passed on for
freeing is used to retrieve virq number. This creates use-after-free
case if the task gets preempted out after the call to
irq_dispose_mapping() and irq_data gets freed asynchronously before it
gets scheduled back.

As a fix, this patch introduces a variable to store virq number
beforehand so that no access to irq_data is made after
irq_dispose_mapping() is called.

Change-Id: I2f6b4d98d953e0ce1ff55455453965d8c942c942
Signed-off-by: Hrishabh Rajput <quic_hrishabh@quicinc.com>
2024-05-09 19:58:55 +05:30
..
gh_arm.c gunyah: arm64: Add support for arm64 drivers for Gunyah 2021-07-13 17:41:09 -07:00
irq.c gunyah: arm64: Fix possible irq_data use-after-free 2024-05-09 19:58:55 +05:30
Kconfig gunyah: arm64: Add support for arm64 drivers for Gunyah 2021-07-13 17:41:09 -07:00
Makefile gunyah: arm64: Add arch support for reset reason validation 2021-07-13 17:50:24 -07:00
reset.c virt: gunyah: rm_core: Validate notifications using payload size only 2022-08-01 22:26:19 -07:00
reset.h gunyah: arm64: Add arch support for reset reason validation 2021-07-13 17:50:24 -07:00