1. 17 4月, 2013 1 次提交
    • M
      s390/mm: protection exception PSW for aborted transaction · f752ac4d
      Martin Schwidefsky 提交于
      Protection exception usually are suppressing and the fault handler
      needs to rewind the PSW by the instruction length to get the correct
      fault address. Except for protection exceptions while the CPU is in
      the middle of a transaction. The CPU stores the transaction abort
      PSW at the start of the transaction, if the transaction is aborted
      the PSW is already correct and may not be modified by the fault
      handler.
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      f752ac4d
  2. 15 4月, 2013 1 次提交
    • M
      s390/kdump: Add PM notifier for kdump · b66ac63e
      Michael Holzheu 提交于
      For s390 the page table mapping for the crashkernel memory is removed to
      protect the pre-loaded kdump kernel and ramdisk. Because the crashkernel
      memory is not included in the page tables for suspend/resume it is not
      included in the suspend image. Therefore after resume the resumed system
      does no longer contain the pre-loaded kdump kernel and when kdump is
      triggered it fails.
      
      This patch adds a PM notifier that creates the page tables before suspend
      is done and removes them for resume. This ensures that the kdump kernel
      is included in the suspend image.
      Signed-off-by: NMichael Holzheu <holzheu@linux.vnet.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      b66ac63e
  3. 02 4月, 2013 2 次提交
    • H
      s390/mm: provide emtpy check_pgt_cache() function · 765a0cac
      Heiko Carstens 提交于
      All architectures need to provide a check_pgt_cache() function. The s390 one
      got lost somewhere.
      So reintroduce it to prevent future compile errors e.g. if Thomas Gleixner's
      idle loop rework patches get merged.
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      765a0cac
    • H
      s390/uaccess: fix page table walk · ea81531d
      Heiko Carstens 提交于
      When translating user space addresses to kernel addresses the follow_table()
      function had two bugs:
      
      - PROT_NONE mappings could be read accessed via the kernel mapping. That is
        e.g. putting a filename into a user page, then protecting the page with
        PROT_NONE and afterwards issuing the "open" syscall with a pointer to
        the filename would incorrectly succeed.
      
      - when walking the page tables it used the pgd/pud/pmd/pte primitives which
        with dynamic page tables give no indication which real level of page tables
        is being walked (region2, region3, segment or page table). So in case of an
        exception the translation exception code passed to __handle_fault() is not
        necessarily correct.
        This is not really an issue since __handle_fault() doesn't evaluate the code.
        Only in case of e.g. a SIGBUS this code gets passed to user space. If user
        space can do something sane with the value is a different question though.
      
      To fix these issues don't use any Linux primitives. Only walk the page tables
      like the hardware would do it, however we leave quite some checks away since
      we know that we only have full size page tables and each index is within bounds.
      
      In theory this should fix all issues...
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Reviewed-by: NGerald Schaefer <gerald.schaefer@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      ea81531d
  4. 21 3月, 2013 1 次提交
    • H
      s390/uaccess: fix clear_user_pt() · b7fef2dd
      Heiko Carstens 提交于
      The page table walker variant of clear_user() is supposed to copy the
      contents of the empty zero page to user space.
      However since 238ec4ef "[S390] zero page cache synonyms" empty_zero_page
      is not anymore the page itself but contains the pointer to the empty zero
      pages. Therefore the page table walker variant of clear_user() copied
      the address of the first empty zero page and afterwards more or less
      random data to user space instead of clearing the given user space range.
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      b7fef2dd
  5. 13 3月, 2013 1 次提交
  6. 11 3月, 2013 1 次提交
  7. 07 3月, 2013 3 次提交
  8. 05 3月, 2013 3 次提交
    • H
      s390/mm: fix flush_tlb_kernel_range() · f6a70a07
      Heiko Carstens 提交于
      Our flush_tlb_kernel_range() implementation calls __tlb_flush_mm() with
      &init_mm as argument. __tlb_flush_mm() however will only flush tlbs
      for the passed in mm if its mm_cpumask is not empty.
      
      For the init_mm however its mm_cpumask has never any bits set. Which in
      turn means that our flush_tlb_kernel_range() implementation doesn't
      work at all.
      
      This can be easily verified with a vmalloc/vfree loop which allocates
      a page, writes to it and then frees the page again. A crash will follow
      almost instantly.
      
      To fix this remove the cpumask_empty() check in __tlb_flush_mm() since
      there shouldn't be too many mms with a zero mm_cpumask, besides the
      init_mm of course.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      f6a70a07
    • H
      s390/mm: fix vmemmap size calculation · a7bb1ae7
      Heiko Carstens 提交于
      The size of the vmemmap must be a multiple of PAGES_PER_SECTION, since the
      common code always initializes the vmemmap in such pieces.
      So we must round up in order to not have a too small vmemmap.
      
      Fixes an IPL crash on 31 bit with more than 1920MB.
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      a7bb1ae7
    • M
      s390: critical section cleanup vs. machine checks · 6551fbdf
      Martin Schwidefsky 提交于
      The current machine check code uses the registers stored by the machine
      in the lowcore at __LC_GPREGS_SAVE_AREA as the registers of the interrupted
      context. The registers 0-7 of a user process can get clobbered if a machine
      checks interrupts the execution of a critical section in entry[64].S.
      
      The reason is that the critical section cleanup code may need to modify
      the PSW and the registers for the previous context to get to the end of a
      critical section. If registers 0-7 have to be replaced the relevant copy
      will be in the registers, which invalidates the copy in the lowcore. The
      machine check handler needs to explicitly store registers 0-7 to the stack.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      6551fbdf
  9. 04 3月, 2013 1 次提交
    • E
      fs: Limit sys_mount to only request filesystem modules. · 7f78e035
      Eric W. Biederman 提交于
      Modify the request_module to prefix the file system type with "fs-"
      and add aliases to all of the filesystems that can be built as modules
      to match.
      
      A common practice is to build all of the kernel code and leave code
      that is not commonly needed as modules, with the result that many
      users are exposed to any bug anywhere in the kernel.
      
      Looking for filesystems with a fs- prefix limits the pool of possible
      modules that can be loaded by mount to just filesystems trivially
      making things safer with no real cost.
      
      Using aliases means user space can control the policy of which
      filesystem modules are auto-loaded by editing /etc/modprobe.d/*.conf
      with blacklist and alias directives.  Allowing simple, safe,
      well understood work-arounds to known problematic software.
      
      This also addresses a rare but unfortunate problem where the filesystem
      name is not the same as it's module name and module auto-loading
      would not work.  While writing this patch I saw a handful of such
      cases.  The most significant being autofs that lives in the module
      autofs4.
      
      This is relevant to user namespaces because we can reach the request
      module in get_fs_type() without having any special permissions, and
      people get uncomfortable when a user specified string (in this case
      the filesystem type) goes all of the way to request_module.
      
      After having looked at this issue I don't think there is any
      particular reason to perform any filtering or permission checks beyond
      making it clear in the module request that we want a filesystem
      module.  The common pattern in the kernel is to call request_module()
      without regards to the users permissions.  In general all a filesystem
      module does once loaded is call register_filesystem() and go to sleep.
      Which means there is not much attack surface exposed by loading a
      filesytem module unless the filesystem is mounted.  In a user
      namespace filesystems are not mounted unless .fs_flags = FS_USERNS_MOUNT,
      which most filesystems do not set today.
      Acked-by: NSerge Hallyn <serge.hallyn@canonical.com>
      Acked-by: NKees Cook <keescook@chromium.org>
      Reported-by: NKees Cook <keescook@google.com>
      Signed-off-by: N"Eric W. Biederman" <ebiederm@xmission.com>
      7f78e035
  10. 28 2月, 2013 12 次提交
  11. 26 2月, 2013 1 次提交
  12. 25 2月, 2013 1 次提交
  13. 24 2月, 2013 3 次提交
  14. 23 2月, 2013 1 次提交
  15. 14 2月, 2013 8 次提交