https://github.com/torvalds/linux
Revision fbd63c08cdcca5fb1315aca3172b3c9c272cfb4f authored by Al Viro on 24 September 2021, 00:35:42 UTC, committed by Guo Ren on 15 October 2021, 23:20:12 UTC
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: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Guo Ren <guoren@kernel.org>
Cc: stable@vger.kernel.org
1 parent 64570fb
Raw File
Tip revision: fbd63c08cdcca5fb1315aca3172b3c9c272cfb4f authored by Al Viro on 24 September 2021, 00:35:42 UTC
csky: don't let sigreturn play with priveleged bits of status register
Tip revision: fbd63c0
README
Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.
back to top