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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 14 Jul 2015 11:46:13 -0500
From:	Bjorn Helgaas <bhelgaas@...gle.com>
To:	Ralf Baechle <ralf@...ux-mips.org>
Cc:	Andrew Bresticker <abrestic@...omium.org>,
	linux-mips@...ux-mips.org, James Hogan <james.hogan@...tec.com>,
	linux-kernel@...r.kernel.org
Subject: [PATCH v2 0/8] Remove "weak" usage

These patches don't fix any problem I'm aware of, but I think they make the
code easier to analyze, and they reduce the likelihood of issues if MIPS
ever builds a multi-platform kernel.

Weak function declarations in header files are hard to use safely because
they make every definition weak.  If the linker sees multiple weak
definitions, it silently chooses one based on link order.  That's not a
very obvious criterion, and it can easily lead to running the wrong
version.

These patches remove the weak attribute from function declarations and
rework the code to match.  I don't have any of these platforms, so I can't
test them, but my intent is that these should cause no functional change.

Changes from v1-v2:
  - Rework vpe_run() patch to simply drop "weak" and the test for definition
  - #include <asm/irq.h> in kernel/time.c instead of #ifdef MIPS_CPU_IRQ_BASE
  - Add Reviewed-by from James for unchanged patches

---

Bjorn Helgaas (8):
      MIPS: CPC: Remove "weak" from mips_cpc_phys_base() and make it static
      MIPS: Remove "weak" from platform_maar_init() declaration
      MIPS: MT: Remove "weak" from vpe_run() declaration
      MIPS: Remove "weak" from get_c0_perfcount_int() declaration
      MIPS: Remove "weak" from get_c0_compare_int() declaration
      MIPS: Remove "weak" from get_c0_fdc_int() declaration
      MIPS: Remove "weak" from mips_cdmm_phys_base() declaration
      MIPS: Remove "__weak" definition from arch-specific linkage.h


 arch/mips/include/asm/cdmm.h         |    4 ++--
 arch/mips/include/asm/irq.h          |    2 +-
 arch/mips/include/asm/linkage.h      |    1 -
 arch/mips/include/asm/maar.h         |    2 +-
 arch/mips/include/asm/mips-cpc.h     |   10 ----------
 arch/mips/include/asm/time.h         |    4 ++--
 arch/mips/include/asm/vpe.h          |    2 +-
 arch/mips/kernel/cevt-r4k.c          |   11 +++++++----
 arch/mips/kernel/mips-cpc.c          |    9 ++++++++-
 arch/mips/kernel/perf_event_mipsxx.c |    7 +------
 arch/mips/kernel/time.c              |    9 ++++++++-
 arch/mips/kernel/vpe.c               |    2 +-
 arch/mips/oprofile/op_model_mipsxx.c |    8 +-------
 drivers/bus/mips_cdmm.c              |   14 +++++++++++++-
 drivers/tty/mips_ejtag_fdc.c         |    9 ++++++---
 15 files changed, 52 insertions(+), 42 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ