[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/2] linux-user: Fix unaligned memory access in prlimit64 sys
From: |
Ilya Leoshkevich |
Subject: |
Re: [PATCH 1/2] linux-user: Fix unaligned memory access in prlimit64 syscall |
Date: |
Thu, 23 Feb 2023 23:24:50 +0100 |
User-agent: |
Evolution 3.46.3 (3.46.3-1.fc37) |
On Thu, 2023-02-23 at 23:17 +0100, Philippe Mathieu-Daudé wrote:
> On 23/2/23 22:58, Ilya Leoshkevich wrote:
> > 32-bit guests may enforce only 4-byte alignment for
> > target_rlimit64,
> > whereas 64-bit hosts normally require the 8-byte one. Therefore
> > accessing this struct directly is UB.
> >
> > Fix by adding a local copy.
>
> Shouldn't we fix that globally in __get_user/__put_user?
Do you mean replace tswapNN() usages with these functions
in syscall.c? This makes sense.
>
> > Fixes: 163a05a8398b ("linux-user: Implement prlimit64 syscall")
> > Reported-by: Richard Henderson <richard.henderson@linaro.org>
> > Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
> > ---
> > linux-user/syscall.c | 12 +++++++-----
> > 1 file changed, 7 insertions(+), 5 deletions(-)