[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/2] linux-user: Fix siginfo_t contents when jumping to non-r
From: |
Peter Maydell |
Subject: |
Re: [PATCH 1/2] linux-user: Fix siginfo_t contents when jumping to non-readable pages |
Date: |
Fri, 5 Aug 2022 09:50:54 +0100 |
On Thu, 4 Aug 2022 at 19:50, Ilya Leoshkevich <iii@linux.ibm.com> wrote:
>
> When the first instruction of a translation block is located in a
> non-readable page, qemu-user fills siginfo_t correctly. For the other
> instructions the result is as if it were the first instruction, which
> is not correct.
>
> The reason is that the current logic expects translate_insn() hook to
> stop at the page boundary. This way only the first instruction can
> cause a SEGV. However, this is quite difficult to properly implement
> when the problematic instruction crosses a page boundary, and indeed
> the actual implementations do not do this. Note that this can also
> break self-modifying code detection when only bytes on the second page
> are modified, but this is outside of the scope of this patch.
Which guests do you observe this on ? I think we should indeed
fix this in the translators. More specifically, I think we should
get this correct already on Arm, and I would expect it to work
correctly on all the fixed-insn-width architectures, which can't
have page-crossing-insns to start with. x86 probably gets this wrong.
thanks
-- PMM