1. 22 5月, 2020 1 次提交
  2. 20 5月, 2020 1 次提交
    • K
      arm64: Fix PTRACE_SYSEMU semantics · 1cf6022b
      Keno Fischer 提交于
      Quoth the man page:
      ```
             If the tracee was restarted by PTRACE_SYSCALL or PTRACE_SYSEMU, the
             tracee enters syscall-enter-stop just prior to entering any system
             call (which will not be executed if the restart was using
             PTRACE_SYSEMU, regardless of any change made to registers at this
             point or how the tracee is restarted after this stop).
      ```
      
      The parenthetical comment is currently true on x86 and powerpc,
      but not currently true on arm64. arm64 re-checks the _TIF_SYSCALL_EMU
      flag after the syscall entry ptrace stop. However, at this point,
      it reflects which method was used to re-start the syscall
      at the entry stop, rather than the method that was used to reach it.
      Fix that by recording the original flag before performing the ptrace
      stop, bringing the behavior in line with documentation and x86/powerpc.
      
      Fixes: f086f674 ("arm64: ptrace: add support for syscall emulation")
      Cc: <stable@vger.kernel.org> # 5.3.x-
      Signed-off-by: NKeno Fischer <keno@juliacomputing.com>
      Acked-by: NWill Deacon <will@kernel.org>
      Tested-by: NSudeep Holla <sudeep.holla@arm.com>
      Tested-by: NBin Lu <Bin.Lu@arm.com>
      [catalin.marinas@arm.com: moved 'flags' bit masking]
      [catalin.marinas@arm.com: changed 'flags' type to unsigned long]
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      1cf6022b
  3. 15 5月, 2020 2 次提交
  4. 14 5月, 2020 4 次提交
  5. 11 5月, 2020 1 次提交
  6. 07 5月, 2020 1 次提交
    • M
      arm64: hugetlb: avoid potential NULL dereference · 027d0c71
      Mark Rutland 提交于
      The static analyzer in GCC 10 spotted that in huge_pte_alloc() we may
      pass a NULL pmdp into pte_alloc_map() when pmd_alloc() returns NULL:
      
      |   CC      arch/arm64/mm/pageattr.o
      |   CC      arch/arm64/mm/hugetlbpage.o
      |                  from arch/arm64/mm/hugetlbpage.c:10:
      | arch/arm64/mm/hugetlbpage.c: In function ‘huge_pte_alloc’:
      | ./arch/arm64/include/asm/pgtable-types.h:28:24: warning: dereference of NULL ‘pmdp’ [CWE-690] [-Wanalyzer-null-dereference]
      | ./arch/arm64/include/asm/pgtable.h:436:26: note: in expansion of macro ‘pmd_val’
      | arch/arm64/mm/hugetlbpage.c:242:10: note: in expansion of macro ‘pte_alloc_map’
      |     |arch/arm64/mm/hugetlbpage.c:232:10:
      |     |./arch/arm64/include/asm/pgtable-types.h:28:24:
      | ./arch/arm64/include/asm/pgtable.h:436:26: note: in expansion of macro ‘pmd_val’
      | arch/arm64/mm/hugetlbpage.c:242:10: note: in expansion of macro ‘pte_alloc_map’
      
      This can only occur when the kernel cannot allocate a page, and so is
      unlikely to happen in practice before other systems start failing.
      
      We can avoid this by bailing out if pmd_alloc() fails, as we do earlier
      in the function if pud_alloc() fails.
      
      Fixes: 66b3923a ("arm64: hugetlb: add support for PTE contiguous bit")
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      Reported-by: NKyrill Tkachov <kyrylo.tkachov@arm.com>
      Cc: <stable@vger.kernel.org> # 4.5.x-
      Cc: Will Deacon <will@kernel.org>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      027d0c71
  7. 04 5月, 2020 2 次提交
  8. 01 5月, 2020 2 次提交
    • M
      KVM: arm64: Fix 32bit PC wrap-around · 0225fd5e
      Marc Zyngier 提交于
      In the unlikely event that a 32bit vcpu traps into the hypervisor
      on an instruction that is located right at the end of the 32bit
      range, the emulation of that instruction is going to increment
      PC past the 32bit range. This isn't great, as userspace can then
      observe this value and get a bit confused.
      
      Conversly, userspace can do things like (in the context of a 64bit
      guest that is capable of 32bit EL0) setting PSTATE to AArch64-EL0,
      set PC to a 64bit value, change PSTATE to AArch32-USR, and observe
      that PC hasn't been truncated. More confusion.
      
      Fix both by:
      - truncating PC increments for 32bit guests
      - sanitizing all 32bit regs every time a core reg is changed by
        userspace, and that PSTATE indicates a 32bit mode.
      
      Cc: stable@vger.kernel.org
      Acked-by: NWill Deacon <will@kernel.org>
      Signed-off-by: NMarc Zyngier <maz@kernel.org>
      0225fd5e
    • V
      arm64: vdso: Add -fasynchronous-unwind-tables to cflags · 1578e5d0
      Vincenzo Frascino 提交于
      On arm64 linux gcc uses -fasynchronous-unwind-tables -funwind-tables
      by default since gcc-8, so now the de facto platform ABI is to allow
      unwinding from async signal handlers.
      
      However on bare metal targets (aarch64-none-elf), and on old gcc,
      async and sync unwind tables are not enabled by default to avoid
      runtime memory costs.
      
      This means if linux is built with a baremetal toolchain the vdso.so
      may not have unwind tables which breaks the gcc platform ABI guarantee
      in userspace.
      
      Add -fasynchronous-unwind-tables explicitly to the vgettimeofday.o
      cflags to address the ABI change.
      
      Fixes: 28b1a824 ("arm64: vdso: Substitute gettimeofday() with C implementation")
      Cc: Will Deacon <will@kernel.org>
      Reported-by: NSzabolcs Nagy <szabolcs.nagy@arm.com>
      Signed-off-by: NVincenzo Frascino <vincenzo.frascino@arm.com>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      1578e5d0
  9. 30 4月, 2020 8 次提交
  10. 29 4月, 2020 1 次提交
  11. 28 4月, 2020 4 次提交
  12. 25 4月, 2020 1 次提交
    • F
      arm64: dts: imx8m: Fix AIPS reg properties · 921a6845
      Fabio Estevam 提交于
      Commit dc3efc6f ("arm64: dts: imx8m: fix aips dts node") caused several
      dtc warnings like these when building with W=1:
      
      arch/arm64/boot/dts/freescale/imx8mm.dtsi:265.23-542.5: Warning (simple_bus_reg): /soc@0/bus@30000000: simple-bus unit address format error, expected "301f0000"
      arch/arm64/boot/dts/freescale/imx8mm.dtsi:544.23-602.5: Warning (simple_bus_reg): /soc@0/bus@30400000: simple-bus unit address format error, expected "305f0000"
      arch/arm64/boot/dts/freescale/imx8mm.dtsi:604.23-862.5: Warning (simple_bus_reg): /soc@0/bus@30800000: simple-bus unit address format error, expected "309f0000"
      arch/arm64/boot/dts/freescale/imx8mm.dtsi:864.23-909.5: Warning (simple_bus_reg): /soc@0/bus@32c00000: simple-bus unit address format error, expected "32df0000"
      
      Fix them by using the correct address base and size in the AIPS reg
      properties.
      
      Fixes: dc3efc6f ("arm64: dts: imx8m: fix aips dts node")
      Signed-off-by: NFabio Estevam <festevam@gmail.com>
      Signed-off-by: NShawn Guo <shawnguo@kernel.org>
      921a6845
  13. 23 4月, 2020 5 次提交
  14. 21 4月, 2020 2 次提交
  15. 20 4月, 2020 1 次提交
  16. 19 4月, 2020 4 次提交