On Mon, May 13, 2024 at 09:19:39PM -0600, Yang Shi wrote:
Do you mean not using the unprivileged LDTR as in get_user()? You don'tThat said, I'm not keen on this kernel workaround. If openjdk decides toI noticed futex does replace insns. IIUC, the below sequence should
improve some security and goes for PROT_EXEC-only mappings of its text
sections, the above trick will no longer work.
can do the trick for exec-only, right?
disable privileged
read insn with ldxr
enable privileged
even need an LDXR, just plain LDR but with the extable entry etc.
However, with PIE we got proper execute-only permission (not the kind of
fake one where we disabled the PTE_USER bit while keeping PTE_UXN as 0).
So the futex-style approach won't work unless we changed the PIE_E1
entry for _PAGE_EXECONLY to be PIE_R by the kernel.