From patchwork Mon Mar 6 19:09:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 9607355 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 03039601D2 for ; Mon, 6 Mar 2017 19:10:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0D5A726BE9 for ; Mon, 6 Mar 2017 19:10:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0113B27B2F; Mon, 6 Mar 2017 19:10:25 +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 1ED8B26BE9 for ; Mon, 6 Mar 2017 19:10:24 +0000 (UTC) Received: (qmail 9430 invoked by uid 550); 6 Mar 2017 19:10:09 -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 9304 invoked from network); 6 Mar 2017 19:10:06 -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=/x+4htdYqFVjBCM4he4429sqA/7HyhmDxyEUo1UCQkQ=; b=miODdQAblW9vgNDhlD+dqG8qzYm/2CklY9dbZt8mYOdylaN2h8ukit3Ldep3JrDmf6 E+sH6JAadC+dauSaDlWK/hQsad5g2iMc03hnxoD7Fg+05CoJy1ZSlaYDvPNERuBwBDY6 NK8t01reaBTa6jDQt5KpUbQbJxePritpZeJ4Y= 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=/x+4htdYqFVjBCM4he4429sqA/7HyhmDxyEUo1UCQkQ=; b=qQj1vvoQ8uGZxdwQXvN3PqGFV+18sPbf/uwYiXN1QoyRqJJSI69M82FP0/sdVjIuu/ F/C8Wp2AY7tctOlhvPJOhQ8nYUEzwwYg+5GAQJI9FEsE4BIqazWkEIJDrQDasSkZ2gMc hjJvzrDrX4vyaOOPp+8GUbc8xMflFRAs/lPe89goapjo9XKtfJxR6Jhs7MXZJkGdJZIP XZdkUy1LHnAGRGdKaWKV2eaQ20xAuFQP40i+bio8MkRb5TSX8UiAGh4W5H1mfTCyeEgT qqb2H53ReyIScfJLXE75xiqd1OqYgsFLRRWK0v8+71dCbVvjoAPADya6o7ILGMUyo3QJ 5eHA== X-Gm-Message-State: AMke39l/DRBw7RSNcPGVI4YD0NYxFA9b53aefM4a0do9O65FowVX/+hvrlLJBb6Lu5NKa1km X-Received: by 10.99.152.65 with SMTP id l1mr22812371pgo.28.1488827394599; Mon, 06 Mar 2017 11:09:54 -0800 (PST) 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 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> Subject: [kernel-hardening] [PATCH 4/6] 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 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