All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH v3 0/3] physmem: Have flaview API check bus permission from MemTxAttrs argument
@ 2021-12-15 18:24 Philippe Mathieu-Daudé
  2021-12-15 18:24 ` [RFC PATCH v3 1/3] hw/intc/arm_gicv3: Check for !MEMTX_OK instead of MEMTX_ERROR Philippe Mathieu-Daudé
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-12-15 18:24 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, David Hildenbrand, Jason Wang, Li Qiang,
	Qiuhao Li, Peter Xu, Alexander Bulekov, qemu-arm, Gerd Hoffmann,
	Stefan Hajnoczi, Edgar E . Iglesias, Paolo Bonzini,
	Philippe Mathieu-Daudé

This series aim to kill a recent class of bug, the infamous
"DMA reentrancy" issues found by Alexander while fuzzing.

Introduce the 'memory' field in MemTxAttrs, allowing to restrict
a controller to memories (and not devices).

If a transaction permission is not allowed (for example access
to device), we return the specific MEMTX_BUS_ERROR.

Permissions are checked in after the flatview is resolved, and
before the access is done, in a new function: flatview_access_allowed().

Since v2 [1]:
- Addressed review comments:
  - reword arm_gicv3 description (pm215)
  - merged patches 3/4/5 (peterx & dhildenb)
  - simplify flatview_access_allowed() logic (stefanha)
  - drop MEMTXPERM enum and reword following AMBA terminology (edgar)

Since v1 ("hw: Forbid DMA write accesses to MMIO regions") [2]:
- rewrite based on Peter / Stefan feedbacks

Based on "hw: Let the DMA API take a MemTxAttrs argument" [3].

Based-on: <20210702092439.989969-1-philmd@redhat.com>

[1] https://www.mail-archive.com/qemu-devel@nongnu.org/msg831168.html
[2] https://www.mail-archive.com/qemu-block@nongnu.org/msg72924.html
[3] https://www.mail-archive.com/qemu-devel@nongnu.org/msg820359.html

Philippe Mathieu-Daudé (3):
  hw/intc/arm_gicv3: Check for !MEMTX_OK instead of MEMTX_ERROR
  softmmu/physmem: Simplify flatview_write and
    address_space_access_valid
  softmmu/physmem: Introduce MemTxAttrs::memory field and
    MEMTX_BUS_ERROR

 include/exec/memattrs.h    |  9 +++++++
 hw/intc/arm_gicv3_redist.c |  4 +--
 softmmu/physmem.c          | 54 +++++++++++++++++++++++++++++++-------
 3 files changed, 55 insertions(+), 12 deletions(-)

-- 
2.33.1




^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2022-01-25 11:57 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-15 18:24 [RFC PATCH v3 0/3] physmem: Have flaview API check bus permission from MemTxAttrs argument Philippe Mathieu-Daudé
2021-12-15 18:24 ` [RFC PATCH v3 1/3] hw/intc/arm_gicv3: Check for !MEMTX_OK instead of MEMTX_ERROR Philippe Mathieu-Daudé
2022-01-19 17:34   ` Philippe Mathieu-Daudé via
2022-01-20 10:53     ` Peter Maydell
2021-12-15 18:24 ` [RFC PATCH v3 2/3] softmmu/physmem: Simplify flatview_write and address_space_access_valid Philippe Mathieu-Daudé
2021-12-15 18:24 ` [RFC PATCH v3 3/3] softmmu/physmem: Introduce MemTxAttrs::memory field and MEMTX_BUS_ERROR Philippe Mathieu-Daudé
2021-12-17 19:46   ` Richard Henderson
2021-12-17 22:34   ` Peter Maydell
2021-12-17 23:18     ` Philippe Mathieu-Daudé
2021-12-18  2:07       ` Richard Henderson
2021-12-18 11:26         ` Philippe Mathieu-Daudé
2022-01-24 16:16   ` Stefan Hajnoczi
2022-01-24 16:30 ` [RFC PATCH v3 0/3] physmem: Have flaview API check bus permission from MemTxAttrs argument Stefan Hajnoczi
2022-01-24 16:50   ` Alexander Bulekov
2022-01-25 11:51     ` Stefan Hajnoczi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.