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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 12 Apr 2018 13:23:43 -0500
From:   Bjorn Helgaas <helgaas@...nel.org>
To:     Eric Biederman <ebiederm@...ssion.com>
Cc:     Thiago Jung Bauermann <bauerman@...ux.vnet.ibm.com>,
        Dave Young <dyoung@...hat.com>,
        Michael Ellerman <mpe@...erman.id.au>,
        kexec@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: [PATCH v1 2/2] kexec: Remove "weak" from arch_kexec_walk_mem()
 declaration

From: Bjorn Helgaas <bhelgaas@...gle.com>

Weak header file declarations are error-prone because they make every
definition weak, and the linker chooses one based on link order (see
10629d711ed7 ("PCI: Remove __weak annotation from pcibios_get_phb_of_node
decl")).

kernel/kexec_file.c contains a weak definition of arch_kexec_walk_mem() and
arch/powerpc/kernel/machine_kexec_file_64.c contains a definition intended
to be non-weak.  But the annotation in the header file makes *both*
definitions weak, so it's unclear which one will be used.

Remove the "weak" attribute from the declaration so we always prefer a
non-weak definition over the weak one.

Fixes: 60fe3910bb02 ("kexec_file: Allow arch-specific memory walking for kexec_add_buffer")
Signed-off-by: Bjorn Helgaas <bhelgaas@...gle.com>
CC: stable@...r.kernel.org      # v4.10+
---
 include/linux/kexec.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/kexec.h b/include/linux/kexec.h
index 8bf0ff90885c..e7db550c5fb6 100644
--- a/include/linux/kexec.h
+++ b/include/linux/kexec.h
@@ -159,8 +159,8 @@ struct kexec_buf {
 	bool top_down;
 };
 
-int __weak arch_kexec_walk_mem(struct kexec_buf *kbuf,
-			       int (*func)(struct resource *, void *));
+int arch_kexec_walk_mem(struct kexec_buf *kbuf,
+			int (*func)(struct resource *, void *));
 extern int kexec_add_buffer(struct kexec_buf *kbuf);
 int kexec_locate_mem_hole(struct kexec_buf *kbuf);
 #endif /* CONFIG_KEXEC_FILE */

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ