Commit 234c12e7 authored by Kees Cook's avatar Kees Cook Committed by Amit Pundir
Browse files

UPSTREAM: bug: Provide toggle for BUG on data corruption



(cherry-picked from de54ebbe)

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: I4cdfa9fbebe32a990a111d051e4ec4e421f77a09
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>
Signed-off-by: default avatarAmit Pundir <amit.pundir@linaro.org>
parent a54e75c1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment