Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a1c1affa authored by Kees Cook's avatar Kees Cook Committed by Satya Tangirala
Browse files

UPSTREAM: bug: Provide toggle for BUG on data corruption



(cherry-picked from de54ebbe26bb371a6f1fbc0593372232f04e3107)

The kernel checks for cases of data structure corruption under some
CONFIGs (e.g. CONFIG_DEBUG_LIST). When corruption is detected, some
systems may want to BUG() immediately instead of letting the system run
with known corruption.  Usually these kinds of manipulation primitives can
be used by security flaws to gain arbitrary memory write control. This
provides a new config CONFIG_BUG_ON_DATA_CORRUPTION and a corresponding
macro CHECK_DATA_CORRUPTION for handling these situations. Notably, even
if not BUGing, the kernel should not continue processing the corrupted
structure.

This is inspired by similar hardening by Syed Rameez Mustafa in MSM
kernels, and in PaX and Grsecurity, which is likely in response to earlier
removal of the BUG calls in commit 924d9add ("list debugging: use
WARN() instead of BUG()").

Change-Id: I02cc09992374da631163ab483af1a8eb4a035206
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Acked-by: default avatarSteven Rostedt <rostedt@goodmis.org>
Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Acked-by: default avatarRik van Riel <riel@redhat.com>
Signed-off-by: default avatarSatya Tangirala <satyat@google.com>
parent 844db414
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment