[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-arm] [Qemu-devel] [PATCHv2] target-arm/abi32: check for segfau
From: |
Peter Maydell |
Subject: |
Re: [Qemu-arm] [Qemu-devel] [PATCHv2] target-arm/abi32: check for segfault in do_kernel_trap |
Date: |
Fri, 6 Jan 2017 17:34:00 +0000 |
On 6 January 2017 at 16:21, Seraphime Kirkovski <address@hidden> wrote:
> Currently, the cmpxchg implementation tests whether the destination address
> is readable:
> - if it is, we read the value and continue with the comparison
> - if isn't, i.e. access to addr would segfault, we assume that src != dest
> rather than queuing a SIGSEGV.
>
> The same problem exists in the case where src == dest: the code doesn't
> check whether put_user_u32 succeeds.
>
> This fixes both problems by sending a SIGSEGV when the destination address
> is inaccessible.
>
> Signed-off-by: Seraphime Kirkovski <address@hidden>
> ---
>
> This accounts for Peter Maydell's remarks.
> The refactoring here extracts the cmpxchg code from do_kernel_trap in its own
> function.
As the patchew robot notes, our coding style wants braces on all
if() statements, even one-line ones. Other than that,
Reviewed-by: Peter Maydell <address@hidden>
thanks
-- PMM