Skip to content

linux-user: Fix unaligned memory access in prlimit64 syscall

Ilya Leoshkevich qemu-devel 3 versions – Applied

Status from this message: Applied to my linux-user-for-8.0 branch.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 3 repliesApplied
  2. v22 patches 2 repliesSuperseded
  3. v12 patches 4 repliesSuperseded

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/2linux-user: Fix unaligned memory access in prlimit64 syscalllinux-user/generic/target_resource.h linux-user/syscall.c+6 -63 replies
2/2tests/tcg/linux-test: Add linux-fork-trap testtests/tcg/multiarch/linux/linux-fork-trap.c+51 -00 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchRichard HendersonAlex BennéePhilippe Mathieu-DaudéLaurent Vivier
1/2R-b R-b
2/2R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v3 thread

Cover letter [PATCH v3 0/2] linux-user: Fix unaligned memory access in prlimit64 syscall

v2: https://lists.gnu.org/archive/html/qemu-devel/2023-02/msg07017.html
v2 -> v3: Fix __put_user() argument order mixup.
I tested v2 only against sh4, where the original problem was discovered, but it regresses aarch64.

v1: https://lists.gnu.org/archive/html/qemu-devel/2023-02/msg06999.html
v1 -> v2: Fix by using proper target_rlimit64 alignment (Richard).
Use __get_user() and __put_user() (Philippe - if I understood the suggestion correctly).

Hi,

Richard reported [1] that the new linux-fork-trap test was failing under UBSan [2], so it was excluded from the PR.

This is a resend of the test plus the fix for the additional issue that it uncovered.

[1] https://lists.gnu.org/archive/html/qemu-devel/2023-02/msg06130.html
[2] https://gitlab.com/qemu-project/qemu/-/jobs/3807471447#L5064

Best regards,
Ilya

Ilya Leoshkevich (2):
linux-user: Fix unaligned memory access in prlimit64 syscall tests/tcg/linux-test: Add linux-fork-trap test

 linux-user/generic/target_resource.h        |  4 +-
 linux-user/syscall.c                        |  8 ++--
 tests/tcg/multiarch/linux/linux-fork-trap.c | 51 +++++++++++++++++++++
 3 files changed, 57 insertions(+), 6 deletions(-)
 create mode 100644 tests/tcg/multiarch/linux/linux-fork-trap.c
Signature · 1 line
2.39.1