From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932461AbdDDWMc (ORCPT ); Tue, 4 Apr 2017 18:12:32 -0400 Received: from mail-pg0-f50.google.com ([74.125.83.50]:35340 "EHLO mail-pg0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932315AbdDDWM1 (ORCPT ); Tue, 4 Apr 2017 18:12:27 -0400 From: Kees Cook To: Ingo Molnar Cc: Kees Cook , Peter Zijlstra , "Paul E. McKenney" , Kalle Valo , Andrew Morton , Rik van Riel , Jakub Kicinski , Viresh Kumar , Andy Shevchenko , Geert Uytterhoeven , Olof Johansson , Chris Wilson , George Spelvin , Thomas Gleixner , Josh Poimboeuf , David Windsor , linux-kernel@vger.kernel.org, kernel-hardening@lists.openwall.com Subject: [PATCH v2 5/7] bug: Enable DEBUG_SG under BUG_ON_DATA_CORRUPTION Date: Tue, 4 Apr 2017 15:12:16 -0700 Message-Id: <1491343938-75336-6-git-send-email-keescook@chromium.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1491343938-75336-1-git-send-email-keescook@chromium.org> References: <1491343938-75336-1-git-send-email-keescook@chromium.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 9a1b6b56cef4..45bfc0be38fc 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -1268,7 +1268,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 @@ -1998,6 +1998,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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kees Cook Date: Tue, 4 Apr 2017 15:12:16 -0700 Message-Id: <1491343938-75336-6-git-send-email-keescook@chromium.org> In-Reply-To: <1491343938-75336-1-git-send-email-keescook@chromium.org> References: <1491343938-75336-1-git-send-email-keescook@chromium.org> Subject: [kernel-hardening] [PATCH v2 5/7] bug: Enable DEBUG_SG under BUG_ON_DATA_CORRUPTION To: Ingo Molnar Cc: Kees Cook , Peter Zijlstra , "Paul E. McKenney" , Kalle Valo , Andrew Morton , Rik van Riel , Jakub Kicinski , Viresh Kumar , Andy Shevchenko , Geert Uytterhoeven , Olof Johansson , Chris Wilson , George Spelvin , Thomas Gleixner , Josh Poimboeuf , David Windsor , linux-kernel@vger.kernel.org, kernel-hardening@lists.openwall.com List-ID: 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 9a1b6b56cef4..45bfc0be38fc 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -1268,7 +1268,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 @@ -1998,6 +1998,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