]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
xen: privcmd: Switch from mutex to spinlock for irqfds
authorViresh Kumar <viresh.kumar@linaro.org>
Tue, 18 Jun 2024 09:42:28 +0000 (15:12 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Aug 2024 13:34:08 +0000 (15:34 +0200)
commit49f2a5da6785b2dbde93e291cae037662440346e
treedac4b925d9dd825688a58d729d423561af4a2b4d
parent4ededa02c6f50ec0df3bf438f10776828814d0ac
xen: privcmd: Switch from mutex to spinlock for irqfds

[ Upstream commit 1c682593096a487fd9aebc079a307ff7a6d054a3 ]

irqfd_wakeup() gets EPOLLHUP, when it is called by
eventfd_release() by way of wake_up_poll(&ctx->wqh, EPOLLHUP), which
gets called under spin_lock_irqsave(). We can't use a mutex here as it
will lead to a deadlock.

Fix it by switching over to a spin lock.

Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Juergen Gross <jgross@suse.com>
Link: https://lore.kernel.org/r/a66d7a7a9001424d432f52a9fc3931a1f345464f.1718703669.git.viresh.kumar@linaro.org
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/xen/privcmd.c