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: <170083093117.398.8055972416269136622.tip-bot2@tip-bot2>
Date:   Fri, 24 Nov 2023 13:02:11 -0000
From:   "tip-bot2 for James Morse" <tip-bot2@...utronix.de>
To:     linux-tip-commits@...r.kernel.org
Cc:     James Morse <james.morse@....com>,
        "Russell King (Oracle)" <rmk+kernel@...linux.org.uk>,
        Ingo Molnar <mingo@...nel.org>, Gavin Shan <gshan@...hat.com>,
        "Rafael J. Wysocki" <rafael.j.wysocki@...el.com>, x86@...nel.org,
        linux-kernel@...r.kernel.org
Subject: [tip: x86/cpu] x86/cpu/intel_epb: Don't rely on link order

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

Commit-ID:     5bfa0e45e9e7212b87fe1564ab45f146c7d56e5f
Gitweb:        https://git.kernel.org/tip/5bfa0e45e9e7212b87fe1564ab45f146c7d56e5f
Author:        James Morse <james.morse@....com>
AuthorDate:    Fri, 24 Nov 2023 09:38:53 
Committer:     Ingo Molnar <mingo@...nel.org>
CommitterDate: Fri, 24 Nov 2023 13:54:31 +01:00

x86/cpu/intel_epb: Don't rely on link order

intel_epb_init() is called as a subsys_initcall() to register cpuhp
callbacks. The callbacks make use of get_cpu_device() which will return
NULL unless register_cpu() has been called. register_cpu() is called
from topology_init(), which is also a subsys_initcall().

This is fragile. Moving the register_cpu() to a different
subsys_initcall() leads to a NULL dereference during boot.

Make intel_epb_init() a late_initcall(), user-space can't provide a
policy before this point anyway.

Signed-off-by: James Morse <james.morse@....com>
Signed-off-by: Russell King (Oracle) <rmk+kernel@...linux.org.uk>
Signed-off-by: Ingo Molnar <mingo@...nel.org>
Reviewed-by: Gavin Shan <gshan@...hat.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
---
 arch/x86/kernel/cpu/intel_epb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/intel_epb.c b/arch/x86/kernel/cpu/intel_epb.c
index e4c3ba9..f18d35f 100644
--- a/arch/x86/kernel/cpu/intel_epb.c
+++ b/arch/x86/kernel/cpu/intel_epb.c
@@ -237,4 +237,4 @@ err_out_online:
 	cpuhp_remove_state(CPUHP_AP_X86_INTEL_EPB_ONLINE);
 	return ret;
 }
-subsys_initcall(intel_epb_init);
+late_initcall(intel_epb_init);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ