Skip to content

linux-user: return ENOMEM from madvise on unmapped ranges

Roi Klevansky qemu-devel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2linux-user: return ENOMEM from madvise on unmapped rangeslinux-user/mmap.c+6 -10 replies
2/2tests/tcg: add linux-user test for madvise returning ENOMEMtests/tcg/multiarch/linux/linux-madvise.c+43 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] linux-user: return ENOMEM from madvise on unmapped ranges

The kernel fails madvise() with ENOMEM when it is given a partially or a fully unmapped address range. qemu-user differed from this and returned 0 instead.

Patch 1 makes target_madvise() check the range with page_check_range() and potentially fail with ENOMEM while still giving precedence to advice specific errors.

Patch 2 adds test cases, calling madvise() with partially and fully unmapped address ranges.

Roi Klevansky (2):
linux-user: return ENOMEM from madvise on unmapped ranges tests/tcg: add linux-user test for madvise returning ENOMEM

 linux-user/mmap.c                         |  7 +++-
 tests/tcg/multiarch/linux/linux-madvise.c | 43 +++++++++++++++++++++++
 2 files changed, 49 insertions(+), 1 deletion(-)
Signature · 1 line
2.55.0