Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1278977

[PATCH v4 1/6] x86: Page align _end to avoid pfn conversion bugs

From Matt Fleming <matt@codeblueprint.co.uk>
Newsgroups linux.kernel
Subject [PATCH v4 1/6] x86: Page align _end to avoid pfn conversion bugs
Date 2015-11-27 22:20 +0100
Message-ID <qzyAV-85W-15@gated-at.bofh.it> (permalink)
References <qzyrf-82O-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Ingo noted that if we can guarantee _end is aligned to PAGE_SIZE we
can automatically avoid bugs along the lines of,

	size = _end - _text >> PAGE_SHIFT

which is missing a call to PFN_ALIGN(). The EFI mixed mode contains
this bug, for example.

_text is already aligned to PAGE_SIZE through the use of
LOAD_PHYSICAL_ADDR, and the BSS and BRK sections are explicitly
aligned in the linker script, so it makes sense to align _end to
match.

Reported-by: Ingo Molnar <mingo@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H . Peter Anvin" <hpa@zytor.com>
Cc: Toshi Kani <toshi.kani@hp.com>
Cc: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Borislav Petkov <bp@alien8.de>
Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk>
---
 arch/x86/kernel/vmlinux.lds.S | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
index 74e4bf11f562..4f1994257a18 100644
--- a/arch/x86/kernel/vmlinux.lds.S
+++ b/arch/x86/kernel/vmlinux.lds.S
@@ -325,6 +325,7 @@ SECTIONS
 		__brk_limit = .;
 	}
 
+	. = ALIGN(PAGE_SIZE);
 	_end = .;
 
         STABS_DEBUG
-- 
2.6.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[GIT PULL v4 0/6] EFI page table isolation Matt Fleming <matt@codeblueprint.co.uk> - 2015-11-27 22:10 +0100
  [PATCH v4 3/6] x86/efi: Map RAM into the identity page table for mixed mode Matt Fleming <matt@codeblueprint.co.uk> - 2015-11-27 22:10 +0100
    [tip:x86/efi] x86/efi:   Map RAM into the identity page table for mixed mode tip-bot for Matt Fleming <tipbot@zytor.com> - 2015-11-29 10:10 +0100
  [PATCH v4 2/6] x86/mm/pageattr: Ensure cpa->pfn only contains page frame numbers Matt Fleming <matt@codeblueprint.co.uk> - 2015-11-27 22:20 +0100
    [tip:x86/efi] x86/mm/pat: Ensure cpa->  pfn only contains page frame numbers tip-bot for Matt Fleming <tipbot@zytor.com> - 2015-11-29 10:10 +0100
  [PATCH v4 4/6] x86/efi: Hoist page table switching code into efi_call_virt() Matt Fleming <matt@codeblueprint.co.uk> - 2015-11-27 22:20 +0100
    [tip:x86/efi] x86/efi:   Hoist page table switching code into efi_call_virt() tip-bot for Matt Fleming <tipbot@zytor.com> - 2015-11-29 10:10 +0100
  [PATCH v4 6/6] Documentation/x86: Update EFI memory region description Matt Fleming <matt@codeblueprint.co.uk> - 2015-11-27 22:20 +0100
    [tip:x86/efi] Documentation/x86:   Update EFI memory region description tip-bot for Matt Fleming <tipbot@zytor.com> - 2015-11-29 10:10 +0100
  [PATCH v4 1/6] x86: Page align _end to avoid pfn conversion bugs Matt Fleming <matt@codeblueprint.co.uk> - 2015-11-27 22:20 +0100
    [tip:x86/efi] x86/mm: Page align the '_end'   symbol to avoid pfn conversion bugs tip-bot for Matt Fleming <tipbot@zytor.com> - 2015-11-29 10:10 +0100
  [PATCH v4 5/6] x86/efi: Build our own page table structures Matt Fleming <matt@codeblueprint.co.uk> - 2015-11-27 22:20 +0100
    [tip:x86/efi] x86/efi: Build our own page table structures tip-bot for Matt Fleming <tipbot@zytor.com> - 2015-11-29 10:10 +0100
  Re: [GIT PULL v4 0/6] EFI page table isolation Ingo Molnar <mingo@kernel.org> - 2015-11-29 09:20 +0100

csiph-web