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:	Fri, 29 Apr 2016 10:31:28 +0200
From:	Ingo Molnar <mingo@...nel.org>
To:	linux-kernel@...r.kernel.org, peterz@...radead.org,
	matt@...eblueprint.co.uk, ard.biesheuvel@...aro.org, bp@...en8.de,
	tglx@...utronix.de, tony.luck@...el.com, hpa@...or.com
Cc:	linux-tip-commits@...r.kernel.org
Subject: [PATCH] efi: Remove unnecessary (and buggy) .memmap initialization
 from the Xen EFI driver


* tip-bot for Matt Fleming <tipbot@...or.com> wrote:

> Commit-ID:  884f4f66ffd6ffe632f3a8be4e6d10a858afdc37
> Gitweb:     http://git.kernel.org/tip/884f4f66ffd6ffe632f3a8be4e6d10a858afdc37
> Author:     Matt Fleming <matt@...eblueprint.co.uk>
> AuthorDate: Mon, 25 Apr 2016 21:06:39 +0100
> Committer:  Ingo Molnar <mingo@...nel.org>
> CommitDate: Thu, 28 Apr 2016 11:33:51 +0200
> 
> efi: Remove global 'memmap' EFI memory map
> 
> Abolish the poorly named EFI memory map, 'memmap'. It is shadowed by a
> bunch of local definitions in various files and having two ways to
> access the EFI memory map ('efi.memmap' vs. 'memmap') is rather
> confusing.
> 
> Furthermore, IA64 doesn't even provide this global object, which has
> caused issues when trying to write generic EFI memmap code.
> 
> Replace all occurrences with efi.memmap, and convert the remaining
> iterator code to use for_each_efi_mem_desc().
> 
> Signed-off-by: Matt Fleming <matt@...eblueprint.co.uk>
> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@...aro.org>
> Cc: Borislav Petkov <bp@...en8.de>
> Cc: Luck, Tony <tony.luck@...el.com>
> Cc: Peter Zijlstra <peterz@...radead.org>
> Cc: Thomas Gleixner <tglx@...utronix.de>
> Cc: linux-efi@...r.kernel.org
> Link: http://lkml.kernel.org/r/1461614832-17633-8-git-send-email-matt@codeblueprint.co.uk
> Signed-off-by: Ingo Molnar <mingo@...nel.org>
> ---
>  arch/x86/platform/efi/efi.c        | 84 +++++++++++++++++++++-----------------
>  drivers/firmware/efi/arm-init.c    | 20 ++++-----
>  drivers/firmware/efi/arm-runtime.c | 12 +++---
>  drivers/firmware/efi/efi.c         |  2 +-
>  drivers/firmware/efi/fake_mem.c    | 40 +++++++++---------
>  include/linux/efi.h                |  5 +--
>  6 files changed, 85 insertions(+), 78 deletions(-)

So this commit triggered the follwing build warning on x86 64-bit allyesconfig:

 In file included from ./include/uapi/linux/posix_types.h:4:0,
                 from include/uapi/linux/types.h:13,
                 from include/linux/compiler.h:203,
                 from include/asm-generic/bug.h:4,
                 from ./arch/x86/include/asm/bug.h:35,
                 from include/linux/bug.h:4,
                 from drivers/xen/efi.c:21:
include/linux/stddef.h:7:14: warning: initialization makes integer from pointer without a cast [-Wint-conversion]
 #define NULL ((void *)0)
              ^
drivers/xen/efi.c:319:30: note: in expansion of macro ‘NULL’
  .memmap                   = NULL, /* Not used under Xen. */
                              ^
  CC      drivers/gpu/drm/i915/intel_acpi.o
include/linux/stddef.h:7:14: note: (near initialization for ‘efi_xen.memmap.phys_map’)
 #define NULL ((void *)0)
              ^
drivers/xen/efi.c:319:30: note: in expansion of macro ‘NULL’
  .memmap                   = NULL, /* Not used under Xen. */
                              ^
drivers/xen/efi.c:290:47: warning: missing braces around initializer [-Wmissing-braces]
 static const struct efi efi_xen __initconst = {
                                               ^
drivers/xen/efi.c:290:47: note: (near initialization for ‘efi_xen’)


It's this initialization in drivers/xen/efi.c:

  static const struct efi efi_xen __initconst = {
  ...
        .memmap                   = NULL, /* Not used under Xen. */
  ...

which was forgotten about, as .memmap now is an embedded struct:

        struct efi_memory_map memmap;

We can remove this initialization - it's an EFI core internal data structure plus 
it's not used in the Xen driver anyway.

Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
 drivers/xen/efi.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/xen/efi.c b/drivers/xen/efi.c
index be7e56a338e8..e9d2135445c1 100644
--- a/drivers/xen/efi.c
+++ b/drivers/xen/efi.c
@@ -316,7 +316,6 @@ static const struct efi efi_xen __initconst = {
 	.get_next_high_mono_count = xen_efi_get_next_high_mono_count,
 	.reset_system             = NULL, /* Functionality provided by Xen. */
 	.set_virtual_address_map  = NULL, /* Not used under Xen. */
-	.memmap                   = NULL, /* Not used under Xen. */
 	.flags			  = 0     /* Initialized later. */
 };
 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ