Skip to content
Commit fbd63c08 authored by Al Viro's avatar Al Viro Committed by Guo Ren
Browse files

csky: don't let sigreturn play with priveleged bits of status register



csky restore_sigcontext() blindly overwrites regs->sr with the value
it finds in sigcontext.  Attacker can store whatever they want in there,
which includes things like S-bit.  Userland shouldn't be able to set
that, or anything other than C flag (bit 0).

Do the same thing other architectures with protected bits in flags
register do - preserve everything that shouldn't be settable in
user mode, picking the rest from the value saved is sigcontext.

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarGuo Ren <guoren@kernel.org>
Cc: stable@vger.kernel.org
parent 64570fbc
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment