Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932451AbdCFTKO (ORCPT ); Mon, 6 Mar 2017 14:10:14 -0500 Received: from mail-pg0-f41.google.com ([74.125.83.41]:33934 "EHLO mail-pg0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932426AbdCFTJz (ORCPT ); Mon, 6 Mar 2017 14:09:55 -0500 From: Kees Cook To: kernel-hardening@lists.openwall.com Cc: Kees Cook , Andrew Morton , Rik van Riel , "Paul E. McKenney" , Jakub Kicinski , Viresh Kumar , Ingo Molnar , Thomas Gleixner , Dmitry Vyukov , Olof Johansson , Peter Zijlstra , Josh Poimboeuf , linux-kernel@vger.kernel.org Subject: [PATCH 4/6] bug: Enable DEBUG_SG under BUG_ON_DATA_CORRUPTION Date: Mon, 6 Mar 2017 11:09:44 -0800 Message-Id: <1488827386-87193-5-git-send-email-keescook@chromium.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1488827386-87193-1-git-send-email-keescook@chromium.org> References: <1488827386-87193-1-git-send-email-keescook@chromium.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1083 Lines: 32 Similar to CONFIG_DEBUG_CREDENTIALS, CONFIG_DEBUG_SG already handles calling BUG, and performs inexpensive checks. This enables it under CONFIG_BUG_ON_DATA_CORRUPTION. Signed-off-by: Kees Cook --- lib/Kconfig.debug | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 009d6f8c7e5a..42c61cfe7d19 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -1267,7 +1267,7 @@ config DEBUG_PI_LIST config DEBUG_SG bool "Debug SG table operations" - depends on DEBUG_KERNEL + depends on DEBUG_KERNEL || BUG_ON_DATA_CORRUPTION help Enable this to turn on checks on scatter-gather tables. This can help find problems with drivers that do not properly initialize @@ -1995,6 +1995,7 @@ config BUG_ON_DATA_CORRUPTION bool "Trigger a BUG when data corruption is detected" select DEBUG_CREDENTIALS select DEBUG_LIST + select DEBUG_SG help This option enables several inexpensive data corruption checks. Most of these checks normally just WARN and try to further avoid -- 2.7.4