• Mark Rutland's avatar
    arm64: fix SSBS sanitization · edfc0266
    Mark Rutland authored
    [ Upstream commit f54dada8 ]
    
    In valid_user_regs() we treat SSBS as a RES0 bit, and consequently it is
    unexpectedly cleared when we restore a sigframe or fiddle with GPRs via
    ptrace.
    
    This patch fixes valid_user_regs() to account for this, updating the
    function to refer to the latest ARM ARM (ARM DDI 0487D.a). For AArch32
    tasks, SSBS appears in bit 23 of SPSR_EL1, matching its position in the
    AArch32-native PSR format, and we don't need to translate it as we have
    to for DIT.
    
    There are no other bit assignments that we need to account for today.
    As the recent documentation describes the DIT bit, we can drop our
    comment regarding DIT.
    
    While removing SSBS from the RES0 masks, existing inconsistent
    whitespace is corrected.
    
    Fixes: d71be2b6 ("arm64: cpufeature: Detect SSBS and advertise to userspace")
    Signed-off-by: default avatarMark Rutland <mark.rutland@arm.com>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
    Cc: Will Deacon <will.deacon@arm.com>
    Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
    Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    edfc0266
ptrace.c 41.5 KB