• Al Viro's avatar
    riscv: fix a nasty sigreturn bug... · 762df359
    Al Viro authored
    riscv has an equivalent of arm bug fixed by 653d48b2 ("arm: fix
    really nasty sigreturn bug"); if signal gets caught by an interrupt that
    hits when we have the right value in a0 (-513), *and* another signal
    gets delivered upon sigreturn() (e.g. included into the blocked mask for
    the first signal and posted while the handler had been running), the
    syscall restart logics will see regs->cause equal to EXC_SYSCALL (we are
    in a syscall, after all) and a0 already restored to its original value
    (-513, which happens to be -ERESTARTNOINTR) and assume that we need to
    apply the usual syscall restart logics.
    Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
    Fixes: e2c0cdfb ("RISC-V: User-facing API")
    Cc: stable@vger.kernel.org
    Link: https://lore.kernel.org/r/YxJEiSq%2FCGaL6Gm9@ZenIV/Signed-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
    762df359
signal.c 8.18 KB