1. 09 Nov, 2012 4 commits
    • Will Deacon's avatar
      ARM: mm: introduce present, faulting entries for PAGE_NONE · 26ffd0d4
      Will Deacon authored
      PROT_NONE mappings apply the page protection attributes defined by _P000
      which translate to PAGE_NONE for ARM. These attributes specify an XN,
      RDONLY pte that is inaccessible to userspace. However, on kernels
      configured without support for domains, such a pte *is* accessible to
      the kernel and can be read via get_user, allowing tasks to read
      PROT_NONE pages via syscalls such as read/write over a pipe.
      
      This patch introduces a new software pte flag, L_PTE_NONE, that is set
      to identify faulting, present entries.
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      26ffd0d4
    • Will Deacon's avatar
      ARM: mm: introduce L_PTE_VALID for page table entries · dbf62d50
      Will Deacon authored
      For long-descriptor translation table formats, the ARMv7 architecture
      defines the last two bits of the second- and third-level descriptors to
      be:
      
      	x0b	- Invalid
      	01b	- Block (second-level), Reserved (third-level)
      	11b	- Table (second-level), Page (third-level)
      
      This allows us to define L_PTE_PRESENT as (3 << 0) and use this value to
      create ptes directly. However, when determining whether a given pte
      value is present in the low-level page table accessors, we only need to
      check the least significant bit of the descriptor, allowing us to write
      faulting, present entries which are required for PROT_NONE mappings.
      
      This patch introduces L_PTE_VALID, which can be used to test whether a
      pte should fault, and updates the low-level page table accessors
      accordingly.
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      dbf62d50
    • Will Deacon's avatar
      ARM: mm: don't use the access flag permissions mechanism for classic MMU · 0cbbbad6
      Will Deacon authored
      The simplified access permissions model is not used for the classic MMU
      translation regime, so ensure that it is turned off in the sctlr prior
      to turning on address translation for ARMv7.
      Acked-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      0cbbbad6
    • Will Deacon's avatar
      ARM: mm: use pteval_t to represent page protection values · 864aa04c
      Will Deacon authored
      When updating the page protection map after calculating the user_pgprot
      value, the base protection map is temporarily stored in an unsigned long
      type, causing truncation of the protection bits when LPAE is enabled.
      This effectively means that calls to mprotect() will corrupt the upper
      page attributes, clearing the XN bit unconditionally.
      
      This patch uses pteval_t to store the intermediate protection values,
      preserving the upper bits for 64-bit descriptors.
      
      Cc: stable@vger.kernel.org
      Acked-by: default avatarNicolas Pitre <nico@linaro.org>
      Acked-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      864aa04c
  2. 04 Nov, 2012 1 commit
  3. 03 Nov, 2012 15 commits
  4. 02 Nov, 2012 20 commits