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: <20240719-fix-modpost-warning-default_dram_nodes-v2-1-792ff57a50b0@kernel.org>
Date: Fri, 19 Jul 2024 18:04:25 -0700
From: Nathan Chancellor <nathan@...nel.org>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: "Rafael J. Wysocki" <rafael@...nel.org>, Len Brown <lenb@...nel.org>, 
 Ho-Ren Chuang <horen.chuang@...ux.dev>, 
 "Huang, Ying" <ying.huang@...el.com>, 
 Jonathan Cameron <Jonathan.Cameron@...wei.com>, linux-acpi@...r.kernel.org, 
 linux-kernel@...r.kernel.org, kernel test robot <lkp@...el.com>, 
 Nathan Chancellor <nathan@...nel.org>
Subject: [PATCH v2] ACPI: HMAT: Mark hmat_set_default_dram_perf() as __init

After commit 823430c8e9d9 ("memory tier: consolidate the initialization
of memory tiers"), there is a modpost warning when
hmat_set_default_dram_perf() is not inlined into its callsite, as it
appears that default_dram_nodes may be accessed after its memory has
been freed.

  WARNING: modpost: vmlinux: section mismatch in reference: hmat_set_default_dram_perf+0x18 (section: .text) -> default_dram_nodes (section: .init.data)

The single callsite, hmat_init(), is __init, so this warning is not a
problem in reality but it is easily solvable by marking
hmat_set_default_dram_perf() as __init, which should have been done when
this function was added in commit 3718c02dbd4c ("acpi, hmat: calculate
abstract distance with HMAT").

Fixes: 823430c8e9d9 ("memory tier: consolidate the initialization of memory tiers")
Reported-by: kernel test robot <lkp@...el.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202406292310.hlRATeZJ-lkp@intel.com/
Reviewed-by: Huang, Ying <ying.huang@...el.com>
Signed-off-by: Nathan Chancellor <nathan@...nel.org>
---
Changes in v2:
- The problematic change appears to be merged into mm-stable, so I added
  a fixes tag and updated the commit message with the stable hash.
- Add Ying's reviewed-by tag.
- Link to v1: https://lore.kernel.org/r/20240710-fix-modpost-warning-default_dram_nodes-v1-1-8961453cc82d@kernel.org
---
 drivers/acpi/numa/hmat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/acpi/numa/hmat.c b/drivers/acpi/numa/hmat.c
index a2f9e7a4b479..ca0c0ea3e1ef 100644
--- a/drivers/acpi/numa/hmat.c
+++ b/drivers/acpi/numa/hmat.c
@@ -933,7 +933,7 @@ static int hmat_callback(struct notifier_block *self,
 	return NOTIFY_OK;
 }
 
-static int hmat_set_default_dram_perf(void)
+static __init int hmat_set_default_dram_perf(void)
 {
 	int rc;
 	int nid, pxm;

---
base-commit: 30d77b7eef019fa4422980806e8b7cdc8674493e
change-id: 20240710-fix-modpost-warning-default_dram_nodes-38b6faffe3da

Best regards,
-- 
Nathan Chancellor <nathan@...nel.org>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ