Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1439867

[PATCH v2 4/6] common: DMA-mapping: add DMA_ATTR_PRIVILEGED_EXECUTABLE attribute

From Mitchel Humpherys <mitchelh@codeaurora.org>
Newsgroups linux.kernel
Subject [PATCH v2 4/6] common: DMA-mapping: add DMA_ATTR_PRIVILEGED_EXECUTABLE attribute
Date 2016-07-09 04:10 +0200
Message-ID <rSPSp-4T7-5@gated-at.bofh.it> (permalink)
References <rSPSp-4T7-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


This patch adds the DMA_ATTR_PRIVILEGED_EXECUTABLE attribute to the
DMA-mapping subsystem.

Some architectures require that writable mappings also be non-executable at
lesser-privileged levels of execution.  This attribute is used to indicate
to the DMA-mapping subsystem that it should do whatever is necessary to
ensure that the buffer is executable at an elevated privilege level (by
making it read-only at the lesser-privileged levels, for example).

Cc: linux-doc@vger.kernel.org
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
---
 Documentation/DMA-attributes.txt | 9 +++++++++
 include/linux/dma-attrs.h        | 1 +
 2 files changed, 10 insertions(+)

diff --git a/Documentation/DMA-attributes.txt b/Documentation/DMA-attributes.txt
index e8cf9cf873b3..6a22d4307008 100644
--- a/Documentation/DMA-attributes.txt
+++ b/Documentation/DMA-attributes.txt
@@ -126,3 +126,12 @@ means that we won't try quite as hard to get them.
 
 NOTE: At the moment DMA_ATTR_ALLOC_SINGLE_PAGES is only implemented on ARM,
 though ARM64 patches will likely be posted soon.
+
+DMA_ATTR_PRIVILEGED_EXECUTABLE
+------------------------------
+
+Some architectures require that writable mappings also be non-executable at
+lesser-privileged levels of execution.  This attribute is used to indicate
+to the DMA-mapping subsystem that it should do whatever is necessary to
+ensure that the buffer is executable at an elevated privilege level (by
+making it read-only at the lesser-privileged levels, for example).
diff --git a/include/linux/dma-attrs.h b/include/linux/dma-attrs.h
index 5246239a4953..8cf4dff6185b 100644
--- a/include/linux/dma-attrs.h
+++ b/include/linux/dma-attrs.h
@@ -19,6 +19,7 @@ enum dma_attr {
 	DMA_ATTR_SKIP_CPU_SYNC,
 	DMA_ATTR_FORCE_CONTIGUOUS,
 	DMA_ATTR_ALLOC_SINGLE_PAGES,
+	DMA_ATTR_PRIVILEGED_EXECUTABLE,
 	DMA_ATTR_MAX,
 };
 
-- 
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/6] Add support for privileged mappings Mitchel Humpherys <mitchelh@codeaurora.org> - 2016-07-09 04:10 +0200
  [PATCH v2 5/6] arm64/dma-mapping: Implement DMA_ATTR_PRIVILEGED_EXECUTABLE Mitchel Humpherys <mitchelh@codeaurora.org> - 2016-07-09 04:10 +0200
    Re: [PATCH v2 5/6] arm64/dma-mapping: Implement  DMA_ATTR_PRIVILEGED_EXECUTABLE Robin Murphy <robin.murphy@arm.com> - 2016-07-11 17:10 +0200
  [PATCH v2 3/6] Revert "iommu/arm-smmu: Treat all device transactions as unprivileged" Mitchel Humpherys <mitchelh@codeaurora.org> - 2016-07-09 04:10 +0200
    Re: [PATCH v2 3/6] Revert "iommu/arm-smmu: Treat all device  transactions as unprivileged" Robin Murphy <robin.murphy@arm.com> - 2016-07-11 16:30 +0200
  [PATCH v2 4/6] common: DMA-mapping: add DMA_ATTR_PRIVILEGED_EXECUTABLE attribute Mitchel Humpherys <mitchelh@codeaurora.org> - 2016-07-09 04:10 +0200
    Re: [PATCH v2 4/6] common: DMA-mapping: add  DMA_ATTR_PRIVILEGED_EXECUTABLE attribute Robin Murphy <robin.murphy@arm.com> - 2016-07-11 16:50 +0200
  [PATCH v2 2/6] iommu/io-pgtable-arm: add support for the IOMMU_PRIV flag Mitchel Humpherys <mitchelh@codeaurora.org> - 2016-07-09 04:10 +0200
    Re: [PATCH v2 2/6] iommu/io-pgtable-arm: add support for the  IOMMU_PRIV flag Robin Murphy <robin.murphy@arm.com> - 2016-07-11 16:20 +0200
  [PATCH v2 1/6] iommu: add IOMMU_PRIV attribute Mitchel Humpherys <mitchelh@codeaurora.org> - 2016-07-09 04:10 +0200
    Re: [PATCH v2 1/6] iommu: add IOMMU_PRIV attribute Robin Murphy <robin.murphy@arm.com> - 2016-07-11 16:10 +0200
  [PATCH v2 6/6] dmaengine: pl330: Make sure microcode is privileged-executable Mitchel Humpherys <mitchelh@codeaurora.org> - 2016-07-09 04:10 +0200
    Re: [PATCH v2 6/6] dmaengine: pl330: Make sure microcode is  privileged-executable Robin Murphy <robin.murphy@arm.com> - 2016-07-11 17:30 +0200
  Re: [PATCH v2 0/6] Add support for privileged mappings Robin Murphy <robin.murphy@arm.com> - 2016-07-11 16:10 +0200
    Re: [PATCH v2 0/6] Add support for privileged mappings Jordan Crouse <jcrouse@codeaurora.org> - 2016-07-11 17:10 +0200

csiph-web