1. 07 5月, 2016 1 次提交
    • Y
      x86/boot: Split out kernel_ident_mapping_init() · cf4fb15b
      Yinghai Lu 提交于
      In order to support on-demand page table creation when moving the
      kernel for KASLR, we need to use kernel_ident_mapping_init() in the
      decompression code.
      
      This splits it out into its own file for use outside of init_64.c.
      Additionally, checking for __pa/__va defines is added since they
      need to be overridden in the decompression code.
      
      [kees: rewrote changelog]
      Signed-off-by: NYinghai Lu <yinghai@kernel.org>
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Baoquan He <bhe@redhat.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Dave Young <dyoung@redhat.com>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vivek Goyal <vgoyal@redhat.com>
      Cc: kernel-hardening@lists.openwall.com
      Cc: lasse.collin@tukaani.org
      Link: http://lkml.kernel.org/r/1462572095-11754-3-git-send-email-keescook@chromium.orgSigned-off-by: NIngo Molnar <mingo@kernel.org>
      cf4fb15b
  2. 09 8月, 2014 1 次提交
    • A
      arm64,ia64,ppc,s390,sh,tile,um,x86,mm: remove default gate area · a6c19dfe
      Andy Lutomirski 提交于
      The core mm code will provide a default gate area based on
      FIXADDR_USER_START and FIXADDR_USER_END if
      !defined(__HAVE_ARCH_GATE_AREA) && defined(AT_SYSINFO_EHDR).
      
      This default is only useful for ia64.  arm64, ppc, s390, sh, tile, 64-bit
      UML, and x86_32 have their own code just to disable it.  arm, 32-bit UML,
      and x86_64 have gate areas, but they have their own implementations.
      
      This gets rid of the default and moves the code into ia64.
      
      This should save some code on architectures without a gate area: it's now
      possible to inline the gate_area functions in the default case.
      Signed-off-by: NAndy Lutomirski <luto@amacapital.net>
      Acked-by: NNathan Lynch <nathan_lynch@mentor.com>
      Acked-by: NH. Peter Anvin <hpa@linux.intel.com>
      Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> [in principle]
      Acked-by: Richard Weinberger <richard@nod.at> [for um]
      Acked-by: Will Deacon <will.deacon@arm.com> [for arm64]
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Chris Metcalf <cmetcalf@tilera.com>
      Cc: Jeff Dike <jdike@addtoit.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Nathan Lynch <Nathan_Lynch@mentor.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a6c19dfe
  3. 19 11月, 2013 1 次提交
    • K
      x86/mm: Implement ASLR for hugetlb mappings · fd8526ad
      Kirill A. Shutemov 提交于
      Matthew noticed that hugetlb mappings don't participate in ASLR on x86-64:
      
        %  for i in `seq 3`; do
        > tools/testing/selftests/vm/map_hugetlb | grep address
        > done
        Returned address is 0x2aaaaac00000
        Returned address is 0x2aaaaac00000
        Returned address is 0x2aaaaac00000
      
      /proc/PID/maps entries for the mapping are always the same
      (except inode number):
      
        2aaaaac00000-2aaabac00000 rw-p 00000000 00:0c 8200              /anon_hugepage (deleted)
        2aaaaac00000-2aaabac00000 rw-p 00000000 00:0c 256               /anon_hugepage (deleted)
        2aaaaac00000-2aaabac00000 rw-p 00000000 00:0c 7180              /anon_hugepage (deleted)
      
      The reason is the generic hugetlb_get_unmapped_area() function
      which is used on x86-64.  It doesn't support randomization and
      use bottom-up unmapped area lookup, instead of usual top-down
      on x86-64.
      
      x86 has arch-specific hugetlb_get_unmapped_area(), but it's used
      only on x86-32.
      
      Let's use arch-specific hugetlb_get_unmapped_area() on x86-64
      too. That adds ASLR and switches hugetlb mappings to use top-down
      unmapped area lookup:
      
        %  for i in `seq 3`; do
        > tools/testing/selftests/vm/map_hugetlb | grep address
        > done
        Returned address is 0x7f4f08a00000
        Returned address is 0x7fdda4200000
        Returned address is 0x7febe0000000
      
      /proc/PID/maps entries:
      
        7f4f08a00000-7f4f18a00000 rw-p 00000000 00:0c 1168              /anon_hugepage (deleted)
        7fdda4200000-7fddb4200000 rw-p 00000000 00:0c 7092              /anon_hugepage (deleted)
        7febe0000000-7febf0000000 rw-p 00000000 00:0c 7183              /anon_hugepage (deleted)
      
      Unmapped area lookup policy for hugetlb mappings is consistent
      with normal mappings now -- the only difference is alignment
      requirements for huge pages.
      
      libhugetlbfs test-suite didn't detect any regressions with the
      patch applied (although it shows few failures on my machine
      regardless the patch).
      Signed-off-by: NKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Cc: Matthew Wilcox <willy@linux.intel.com>
      Cc: Dave Hansen <dave.hansen@intel.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Andrea Arcangeli <aarcange@redhat.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mel Gorman <mgorman@suse.de>
      Link: http://lkml.kernel.org/r/20131119131750.EA45CE0090@blue.fi.intel.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      fd8526ad
  4. 30 1月, 2013 1 次提交
  5. 17 11月, 2012 1 次提交
  6. 11 8月, 2010 1 次提交
  7. 12 6月, 2009 1 次提交
  8. 13 2月, 2009 1 次提交
  9. 12 2月, 2009 5 次提交
  10. 09 2月, 2009 1 次提交
  11. 07 2月, 2009 1 次提交
  12. 23 1月, 2009 1 次提交
  13. 23 10月, 2008 2 次提交
  14. 13 10月, 2008 1 次提交
  15. 11 10月, 2008 1 次提交
  16. 25 7月, 2008 2 次提交
  17. 23 7月, 2008 1 次提交
    • V
      x86: consolidate header guards · 77ef50a5
      Vegard Nossum 提交于
      This patch is the result of an automatic script that consolidates the
      format of all the headers in include/asm-x86/.
      
      The format:
      
      1. No leading underscore. Names with leading underscores are reserved.
      2. Pathname components are separated by two underscores. So we can
         distinguish between mm_types.h and mm/types.h.
      3. Everything except letters and numbers are turned into single
         underscores.
      Signed-off-by: NVegard Nossum <vegard.nossum@gmail.com>
      77ef50a5
  18. 22 7月, 2008 3 次提交
  19. 11 7月, 2008 1 次提交
  20. 27 5月, 2008 1 次提交
  21. 25 5月, 2008 1 次提交
  22. 20 5月, 2008 3 次提交
  23. 25 4月, 2008 1 次提交
    • A
      x86: introduce /dev/mem restrictions with a config option · ae531c26
      Arjan van de Ven 提交于
      This patch introduces a restriction on /dev/mem: Only non-memory can be
      read or written unless the newly introduced config option is set.
      
      The X server needs access to /dev/mem for the PCI space, but it doesn't need
      access to memory; both the file permissions and SELinux permissions of /dev/mem
      just make X effectively super-super powerful. With the exception of the
      BIOS area, there's just no valid app that uses /dev/mem on actual memory.
      Other popular users of /dev/mem are rootkits and the like.
      (note: mmap access of memory via /dev/mem was already not allowed since
      a really long time)
      
      People who want to use /dev/mem for kernel debugging can enable the config
      option.
      
      The restrictions of this patch have been in the Fedora and RHEL kernels for
      at least 4 years without any problems.
      Signed-off-by: NArjan van de Ven <arjan@linux.intel.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      ae531c26
  24. 17 4月, 2008 2 次提交
  25. 22 3月, 2008 1 次提交
    • C
      x86: fix {clear,copy}_user_page() declarations in page.h · f2f7abcb
      Chuck Lever 提交于
      Clean up: eliminate some compiler noise on x86 when building with strict
      warnings enabled, introduced by commit 345b904c.
      
      In file included from include2/asm/thread_info_64.h:12,
                       from include2/asm/thread_info.h:4,
                       from
      /home/cel/src/linux/nfs-2.6/include/linux/thread_info.h:35,
                       from
      /home/cel/src/linux/nfs-2.6/include/linux/preempt.h:9,
                       from
      /home/cel/src/linux/nfs-2.6/include/linux/spinlock.h:49,
                       from /home/cel/src/linux/nfs-2.6/include/linux/mmzone.h:7,
                       from /home/cel/src/linux/nfs-2.6/include/linux/gfp.h:4,
                       from /home/cel/src/linux/nfs-2.6/include/linux/slab.h:14,
                       from /home/cel/src/linux/nfs-2.6/fs/nfsd/nfs4acl.c:40:
      include2/asm/page.h:55: warning: `inline' is not at beginning of
      declaration
      include2/asm/page.h:61: warning: `inline' is not at beginning of
      declaration
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Cc: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      f2f7abcb
  26. 04 2月, 2008 1 次提交
  27. 30 1月, 2008 3 次提交