]> www.infradead.org Git - users/dwmw2/linux.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)
committerJuergen Gross <jgross@suse.com>
Tue, 2 Jul 2024 10:23:39 +0000 (12:23 +0200)
commit1c682593096a487fd9aebc079a307ff7a6d054a3
treedeb70c9a768d8067d287ea18193544430317aac1
parent7cd23c1817b8f9df61dac67848d9593b1ca8882f
xen: privcmd: Switch from mutex to spinlock for irqfds

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>
drivers/xen/privcmd.c