lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <171890915224.10875.8611592654168813177.tip-bot2@tip-bot2>
Date: Thu, 20 Jun 2024 18:45:52 -0000
From:
 tip-bot2 for Uwe Kleine-König <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: u.kleine-koenig@...gutronix.de, "Borislav Petkov (AMD)" <bp@...en8.de>,
 Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@...ux.intel.com>,
 Tom Lendacky <thomas.lendacky@....com>, x86@...nel.org,
 linux-kernel@...r.kernel.org
Subject: [tip: x86/sev] virt: sev-guest: Mark driver struct with __refdata to
 prevent section mismatch

The following commit has been merged into the x86/sev branch of tip:

Commit-ID:     3991b04d4870fd334b77b859a8642ca7fb592603
Gitweb:        https://git.kernel.org/tip/3991b04d4870fd334b77b859a8642ca7fb592603
Author:        Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
AuthorDate:    Fri, 29 Mar 2024 22:54:41 +01:00
Committer:     Borislav Petkov (AMD) <bp@...en8.de>
CommitterDate: Thu, 20 Jun 2024 20:28:50 +02:00

virt: sev-guest: Mark driver struct with __refdata to prevent section mismatch

As described in the added code comment, a reference to .exit.text is ok for
drivers registered via module_platform_driver_probe(). Make this explicit to
prevent the following section mismatch warning:

  WARNING: modpost: drivers/virt/coco/sev-guest/sev-guest: section mismatch in reference: \
    sev_guest_driver+0x10 (section: .data) -> sev_guest_remove (section: .exit.text)

that triggers on an allmodconfig W=1 build.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
Signed-off-by: Borislav Petkov (AMD) <bp@...en8.de>
Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@...ux.intel.com>
Reviewed-by: Tom Lendacky <thomas.lendacky@....com>
Link: https://lore.kernel.org/r/4a81b0e87728a58904283e2d1f18f73abc69c2a1.1711748999.git.u.kleine-koenig@pengutronix.de
---
 drivers/virt/coco/sev-guest/sev-guest.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/virt/coco/sev-guest/sev-guest.c b/drivers/virt/coco/sev-guest/sev-guest.c
index 3752288..f714009 100644
--- a/drivers/virt/coco/sev-guest/sev-guest.c
+++ b/drivers/virt/coco/sev-guest/sev-guest.c
@@ -1203,8 +1203,13 @@ static void __exit sev_guest_remove(struct platform_device *pdev)
  * This driver is meant to be a common SEV guest interface driver and to
  * support any SEV guest API. As such, even though it has been introduced
  * with the SEV-SNP support, it is named "sev-guest".
+ *
+ * sev_guest_remove() lives in .exit.text. For drivers registered via
+ * module_platform_driver_probe() this is ok because they cannot get unbound
+ * at runtime. So mark the driver struct with __refdata to prevent modpost
+ * triggering a section mismatch warning.
  */
-static struct platform_driver sev_guest_driver = {
+static struct platform_driver sev_guest_driver __refdata = {
 	.remove_new	= __exit_p(sev_guest_remove),
 	.driver		= {
 		.name = "sev-guest",

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ