Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

xen/privcmd: unregister xenstore notifier on module exit

Commit 453b8fb68f36 ("xen/privcmd: restrict usage in
unprivileged domU") added a xenstore notifier to defer setting the
restriction target until Xenstore is ready.

XEN_PRIVCMD can be built as a module, but privcmd_exit() leaves that
notifier behind. Balance the notifier lifecycle by unregistering it on
module exit.

This is harmless even if xenstore was already ready at registration
time and the notifier was never queued on the chain.

Fixes: 453b8fb68f3641fe ("xen/privcmd: restrict usage in unprivileged domU")
Signed-off-by: GuoHan Zhao <zhaoguohan@kylinos.cn>
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Message-ID: <20260325120246.252899-1-zhaoguohan@kylinos.cn>

authored by

GuoHan Zhao and committed by
Juergen Gross
cd7e1fef 0138af24

+3
+3
drivers/xen/privcmd.c
··· 1765 1765 1766 1766 static void __exit privcmd_exit(void) 1767 1767 { 1768 + if (!xen_initial_domain()) 1769 + unregister_xenstore_notifier(&xenstore_notifier); 1770 + 1768 1771 privcmd_ioeventfd_exit(); 1769 1772 privcmd_irqfd_exit(); 1770 1773 misc_deregister(&privcmd_dev);