Skip to content

add mitigation against buffer overflows

Michael S. Tsirkin qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4oslib: rework anonimous RAM allocationutil/oslib-posix.c+10 -20 replies
2/4oslib: allocate PROT_NONE pages on top of RAMutil/oslib-posix.c+4 -41 reply
3/4exec: allocate PROT_NONE pages on top of RAMexec.c+39 -30 replies
4/4exec: factor out duplicate mmap codeexec.c include/qemu/mmap-alloc.h util/Makefile.objs +2 more+77 -621 reply

Reviews trailers per patch

None of the 4 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchPaolo Bonzini
SeriesR-b A-b
1/4
2/4
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [Qemu-devel] [PATCH repost 0/4] add mitigation against buffer overflows

Multiple places in QEMU map guest memory, then access it directly. Unfortunately since we are using C, there's always a chance that we'll miss a bounds check when we do this. This has a potential to corrupt QEMU memory.

As a mitigation strategy against such exploits, allocate a page in HVA space on top of each RAM chunk with PROT_NONE protection.

Buffer overflows will now cause QEMU to crash.

This is a repost, combining separate patches into a single series. No changes to patches themselves.

Michael S. Tsirkin (4):
oslib: rework anonimous RAM allocation
oslib: allocate PROT_NONE pages on top of RAM
exec: allocate PROT_NONE pages on top of RAM
exec: factor out duplicate mmap code

 include/qemu/mmap-alloc.h | 10 +++++++++
 exec.c                    | 19 ++++++++++++-----
 util/mmap-alloc.c         | 52 +++++++++++++++++++++++++++++++++++++++++++++++
 util/oslib-posix.c        | 20 ++++--------------
 util/Makefile.objs        |  2 +-
 5 files changed, 81 insertions(+), 22 deletions(-)
 create mode 100644 include/qemu/mmap-alloc.h
 create mode 100644 util/mmap-alloc.c
Signature · 1 line
MST