]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
xen/events: increment refcnt only if event channel is refcounted
authorJuergen Gross <jgross@suse.com>
Wed, 13 Mar 2024 07:14:09 +0000 (08:14 +0100)
committerSasha Levin <sashal@kernel.org>
Tue, 26 Mar 2024 22:20:09 +0000 (18:20 -0400)
commitcfbb3abadc330eee433e4f35124ee19f644254b7
treec80011491b88df574ded7a359cc044b82e822ac4
parent99e425032c6ec13584d3cd33846e0c7307501b47
xen/events: increment refcnt only if event channel is refcounted

[ Upstream commit d277f9d82802223f242cd9b60c988cfdda1d6be0 ]

In bind_evtchn_to_irq_chip() don't increment the refcnt of the event
channel blindly. In case the event channel is NOT refcounted, issue a
warning instead.

Add an additional safety net by doing the refcnt increment only if the
caller has specified IRQF_SHARED in the irqflags parameter.

Fixes: 9e90e58c11b7 ("xen: evtchn: Allow shared registration of IRQ handers")
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Link: https://lore.kernel.org/r/20240313071409.25913-3-jgross@suse.com
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/xen/events/events_base.c