1. 06 12月, 2019 1 次提交
  2. 29 11月, 2019 1 次提交
    • S
      Revert "arm64: dts: juno: add dma-ranges property" · 54fb3fe0
      Sudeep Holla 提交于
      This reverts commit 193d00a2.
      
      Commit 951d4885 ("of: Make of_dma_get_range() work on bus nodes")
      reworked the logic such that of_dma_get_range() works correctly
      starting from a bus node containing "dma-ranges".
      
      Since on Juno we don't have a SoC level bus node and "dma-ranges" is
      present only in the root node, we get the following error:
      
      OF: translation of DMA address(0) to CPU address failed node(/sram@2e000000)
      OF: translation of DMA address(0) to CPU address failed node(/uart@7ff80000)
      ...
      OF: translation of DMA address(0) to CPU address failed node(/mhu@2b1f0000)
      OF: translation of DMA address(0) to CPU address failed node(/iommu@2b600000)
      OF: translation of DMA address(0) to CPU address failed node(/iommu@2b600000)
      OF: translation of DMA address(0) to CPU address failed node(/iommu@2b600000)
      
      So let's fix it by dropping the "dma-ranges" property for now. This
      should be fine since it doesn't represent any kind of device-visible
      restriction; it was only there for completeness, and we've since given
      in to the assumption that missing "dma-ranges" implies a 1:1 mapping
      anyway.
      
      We can add it later with a proper SoC bus node and moving all the
      devices that belong there along with the "dma-ranges" if required.
      
      Fixes: 193d00a2 ("arm64: dts: juno: add dma-ranges property")
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: Liviu Dudau <liviu.dudau@arm.com>
      Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Acked-by: NRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
      54fb3fe0
  3. 27 11月, 2019 2 次提交
  4. 26 11月, 2019 1 次提交
  5. 25 11月, 2019 1 次提交
  6. 21 11月, 2019 3 次提交
    • C
      dma-mapping: drop the dev argument to arch_sync_dma_for_* · 56e35f9c
      Christoph Hellwig 提交于
      These are pure cache maintainance routines, so drop the unused
      struct device argument.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Suggested-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      56e35f9c
    • P
      arm64: uaccess: Remove uaccess_*_not_uao asm macros · e50be648
      Pavel Tatashin 提交于
      It is safer and simpler to drop the uaccess assembly macros in favour of
      inline C functions. Although this bloats the Image size slightly, it
      aligns our user copy routines with '{get,put}_user()' and generally
      makes the code a lot easier to reason about.
      
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Reviewed-by: NMark Rutland <mark.rutland@arm.com>
      Tested-by: NMark Rutland <mark.rutland@arm.com>
      Signed-off-by: NPavel Tatashin <pasha.tatashin@soleen.com>
      [will: tweaked commit message and changed temporary variable names]
      Signed-off-by: NWill Deacon <will@kernel.org>
      e50be648
    • P
      arm64: uaccess: Ensure PAN is re-enabled after unhandled uaccess fault · 94bb804e
      Pavel Tatashin 提交于
      A number of our uaccess routines ('__arch_clear_user()' and
      '__arch_copy_{in,from,to}_user()') fail to re-enable PAN if they
      encounter an unhandled fault whilst accessing userspace.
      
      For CPUs implementing both hardware PAN and UAO, this bug has no effect
      when both extensions are in use by the kernel.
      
      For CPUs implementing hardware PAN but not UAO, this means that a kernel
      using hardware PAN may execute portions of code with PAN inadvertently
      disabled, opening us up to potential security vulnerabilities that rely
      on userspace access from within the kernel which would usually be
      prevented by this mechanism. In other words, parts of the kernel run the
      same way as they would on a CPU without PAN implemented/emulated at all.
      
      For CPUs not implementing hardware PAN and instead relying on software
      emulation via 'CONFIG_ARM64_SW_TTBR0_PAN=y', the impact is unfortunately
      much worse. Calling 'schedule()' with software PAN disabled means that
      the next task will execute in the kernel using the page-table and ASID
      of the previous process even after 'switch_mm()', since the actual
      hardware switch is deferred until return to userspace. At this point, or
      if there is a intermediate call to 'uaccess_enable()', the page-table
      and ASID of the new process are installed. Sadly, due to the changes
      introduced by KPTI, this is not an atomic operation and there is a very
      small window (two instructions) where the CPU is configured with the
      page-table of the old task and the ASID of the new task; a speculative
      access in this state is disastrous because it would corrupt the TLB
      entries for the new task with mappings from the previous address space.
      
      As Pavel explains:
      
        | I was able to reproduce memory corruption problem on Broadcom's SoC
        | ARMv8-A like this:
        |
        | Enable software perf-events with PERF_SAMPLE_CALLCHAIN so userland's
        | stack is accessed and copied.
        |
        | The test program performed the following on every CPU and forking
        | many processes:
        |
        |	unsigned long *map = mmap(NULL, PAGE_SIZE, PROT_READ|PROT_WRITE,
        |				  MAP_SHARED | MAP_ANONYMOUS, -1, 0);
        |	map[0] = getpid();
        |	sched_yield();
        |	if (map[0] != getpid()) {
        |		fprintf(stderr, "Corruption detected!");
        |	}
        |	munmap(map, PAGE_SIZE);
        |
        | From time to time I was getting map[0] to contain pid for a
        | different process.
      
      Ensure that PAN is re-enabled when returning after an unhandled user
      fault from our uaccess routines.
      
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Reviewed-by: NMark Rutland <mark.rutland@arm.com>
      Tested-by: NMark Rutland <mark.rutland@arm.com>
      Cc: <stable@vger.kernel.org>
      Fixes: 338d4f49 ("arm64: kernel: Add support for Privileged Access Never")
      Signed-off-by: NPavel Tatashin <pasha.tatashin@soleen.com>
      [will: rewrote commit message]
      Signed-off-by: NWill Deacon <will@kernel.org>
      94bb804e
  7. 17 11月, 2019 6 次提交
  8. 14 11月, 2019 1 次提交
  9. 12 11月, 2019 2 次提交
  10. 11 11月, 2019 2 次提交
  11. 09 11月, 2019 7 次提交
  12. 08 11月, 2019 3 次提交
  13. 07 11月, 2019 9 次提交
  14. 06 11月, 2019 1 次提交