From patchwork Tue Apr 4 22:12:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 9662713 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 788056032D for ; Tue, 4 Apr 2017 22:13:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 69E202838E for ; Tue, 4 Apr 2017 22:13:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5CCC22858B; Tue, 4 Apr 2017 22:13:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.wl.linuxfoundation.org (Postfix) with SMTP id 7C8882838E for ; Tue, 4 Apr 2017 22:13:36 +0000 (UTC) Received: (qmail 26576 invoked by uid 550); 4 Apr 2017 22:12:46 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Delivered-To: mailing list kernel-hardening@lists.openwall.com Received: (qmail 26288 invoked from network); 4 Apr 2017 22:12:38 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=UEKYXSLbW1IDLfoKaoUMJO7lxsF917ijKO13sMrExc4=; b=GI0naq5BpbOJS9CuvsSSIOryA9rwa1/Jfcj30NmKmECvwCHi3jcy5hIlUR+5kH50Qt J/LOdpDRgcUEQ1C62KNoaN1D88jht2BmcnioagfjNadRL3Uqhv59XQHTTgtfGmoJGsG3 7eV6Ppog041NS7hDAoYFVbZMYFVDJD+/16Tig= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=UEKYXSLbW1IDLfoKaoUMJO7lxsF917ijKO13sMrExc4=; b=jjQnvU0RBC6NQ8FK2q3pVRjfbT7gLo0+0TY/6LMUo9lExx72oM9iyJde82JBIj2UGP eaLI5wB4w7R/VnAIXS8zMEx5e/PLghp2tFG86G0E2jVDtlJjBQuVRjl5UkRB64qmd6yu XgjkgUfoCn7B22u+awuk0QPX9qZs5tPrlZsip+aNpOXJVhX6sGG3q4S3A7fjd0JrWRSY EX5GgEaiqMmMfPeW2DOBHtnP0/2OraN89we87nxaFDa+2ItrXEQrzXk2me1nG69fU1BG A/ECkR5COeCI0F+dUklAgSy1cG/ry2wdyytqdKcM8l+VRFUm3xJ5vDPchMCo64A/aCTA JF5A== X-Gm-Message-State: AFeK/H1zgbtmm1JkGbOM3GwS5MqBtS4HVbiM9T1gaX3+1ZPA/MEOsYcgJ3n8xW7U99JB2ZWb X-Received: by 10.98.78.8 with SMTP id c8mr25084747pfb.155.1491343946702; Tue, 04 Apr 2017 15:12:26 -0700 (PDT) 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 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> Subject: [kernel-hardening] [PATCH v2 5/7] bug: Enable DEBUG_SG under BUG_ON_DATA_CORRUPTION X-Virus-Scanned: ClamAV using ClamSMTP 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