Skip to content

multiboot: Fix buffer overflow on invalid kernels

Kevin Wolf qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 8 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5multiboot: Reject kernels exceeding the address spacehw/i386/multiboot.c+4 -05 replies
2/5multiboot: Check validity of mh_header_addrhw/i386/multiboot.c+4 -00 replies
3/5tests/multiboot: Test exit code for every qemu runtests/multiboot/run_test.sh+12 -120 replies
4/5tests/multiboot: Add tests for the a.out kludgetests/multiboot/Makefile tests/multiboot/aout_kludge.S tests/multiboot/aout_kludge.out +1 more+204 -80 replies
5/5tests/multiboot: Add .gitignoretests/multiboot/.gitignore+3 -02 replies

Reviews trailers per patch

2 of 5 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchEric BlakeJack Schwartz
SeriesR-b
1/5R-b
2/5
3/5
4/5
5/5R-b

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 0/5] multiboot: Fix buffer overflow on invalid kernels

Patch 1 fixes another Multiboot kernel validation bug that could cause QEMU to load the kernel image file into a too small buffer. Patch 2 adds another check to harden the code. The rest of the series adds Multiboot test cases for kernels using the a.out kludge, which is where the recent bugs were found.

Kevin Wolf (5):
multiboot: Reject kernels exceeding the address space
multiboot: Check validity of mh_header_addr tests/multiboot: Test exit code for every qemu run tests/multiboot: Add tests for the a.out kludge tests/multiboot: Add .gitignore

 hw/i386/multiboot.c             |   8 +++
 tests/multiboot/.gitignore      |   3 +
 tests/multiboot/Makefile        |  22 +++++--
 tests/multiboot/aout_kludge.S   | 138 ++++++++++++++++++++++++++++++++++++++++
 tests/multiboot/aout_kludge.out |  42 ++++++++++++
 tests/multiboot/run_test.sh     |  34 ++++++----
 6 files changed, 227 insertions(+), 20 deletions(-)
 create mode 100644 tests/multiboot/.gitignore
 create mode 100644 tests/multiboot/aout_kludge.S
 create mode 100644 tests/multiboot/aout_kludge.out
Signature · 1 line
2.13.6