From nobody Fri Apr 3 01:25:59 2026 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2D4A93B7773 for ; Wed, 25 Mar 2026 12:02:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=124.126.103.232 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774440182; cv=none; b=sWGx2FWyTECYR3fzYXs9SKsIyEK9DG+2vAKdxBiBC/DnBtRErY47o5v0zQZ2mhZ0SK1wz39ngGQc7LMBd0obeajOX9UKg2TRItWmi52FJVYxpg8nwiJ5lj3XFYEcyI/1tTW7CHezsII8r6gHh9W0szhjJFnstb91XwSgejfdnQg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774440182; c=relaxed/simple; bh=CGLK32SfBtrrt1dQL830iuCtlXBfeZK/squUL9PBkNA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=a1I7j3xPrwz1beFqSwIXIOw7aNE8+n73xxOExtx2E6ljjZuzS/7Bwj/CFUa5lWBqMoSFExKaAzvrTc5d7S0YmDzC4IIH0VZepjVjJJdNm8Db2GRHRiRItz9xrl0yNpHi6OpEr6IiR8t9ZuJvp4p3YpjglzEx5hvUINoA4W8g/xk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=kylinos.cn; arc=none smtp.client-ip=124.126.103.232 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn X-UUID: 8ade3388284211f1a21c59e7364eecb8-20260325 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.3.11,REQID:140d25ea-eb09-4808-8438-de17a524f1a1,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:89c9d04,CLOUDID:ab8db2c8cd2d23d717ed6e4592da157a,BulkI D:nil,BulkQuantity:0,Recheck:0,SF:102|850|898,TC:nil,Content:0|15|50,EDM:- 3,IP:nil,URL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,A V:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 2,SSN|SDN X-CID-BAS: 2,SSN|SDN,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-CID-RHF: D41D8CD98F00B204E9800998ECF8427E X-UUID: 8ade3388284211f1a21c59e7364eecb8-20260325 X-User: zhaoguohan@kylinos.cn Received: from localhost.localdomain [(10.44.16.150)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA with TLSv1.3 TLS_AES_256_GCM_SHA384 256/256) with ESMTP id 1348781306; Wed, 25 Mar 2026 20:02:48 +0800 From: GuoHan Zhao To: Juergen Gross , Stefano Stabellini Cc: Oleksandr Tyshchenko , xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, GuoHan Zhao Subject: [PATCH] xen/privcmd: unregister xenstore notifier on module exit Date: Wed, 25 Mar 2026 20:02:46 +0800 Message-ID: <20260325120246.252899-1-zhaoguohan@kylinos.cn> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Juergen Gross --- drivers/xen/privcmd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c index bbf9ee21306c..15ba592236e8 100644 --- a/drivers/xen/privcmd.c +++ b/drivers/xen/privcmd.c @@ -1765,6 +1765,9 @@ static int __init privcmd_init(void) =20 static void __exit privcmd_exit(void) { + if (!xen_initial_domain()) + unregister_xenstore_notifier(&xenstore_notifier); + privcmd_ioeventfd_exit(); privcmd_irqfd_exit(); misc_deregister(&privcmd_dev); --=20 2.43.0