From patchwork Wed Jun 23 20:39:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 466098 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD4B5C49EA5 for ; Wed, 23 Jun 2021 20:39:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C3E7F610C7 for ; Wed, 23 Jun 2021 20:39:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230004AbhFWUmK (ORCPT ); Wed, 23 Jun 2021 16:42:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229929AbhFWUmG (ORCPT ); Wed, 23 Jun 2021 16:42:06 -0400 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B78F5C061787 for ; Wed, 23 Jun 2021 13:39:47 -0700 (PDT) Received: by mail-pj1-x1030.google.com with SMTP id x21-20020a17090aa395b029016e25313bfcso2112276pjp.2 for ; Wed, 23 Jun 2021 13:39:47 -0700 (PDT) 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 :mime-version:content-transfer-encoding; bh=9GYkjjOQZ6Rz1pEOIf9K4RSl8mgGGEOKk2i3NOWLjLA=; b=oEmyBdL/O6vMQ+qVWEiW1NRHGzhz4sEKTZMQ6lOUKhPz+NU9pA0qtKyPEmtPkPcJ/T GFg4CLQSRyolenFblesTc/xamKo1azEcNE2e7G52IG9ckEWLkNoNPIZH+lwGdOv+zkLs E2Gz8zf4zFisvYsNtwUM+ePjJm2AW2kZbXzeM= 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:mime-version:content-transfer-encoding; bh=9GYkjjOQZ6Rz1pEOIf9K4RSl8mgGGEOKk2i3NOWLjLA=; b=t7g19454Iw0R7NODZEmB0ZO/AI7SDyuc9RXiDfrkvTJphixiQ87InhjpGp74AUe64f /EHVaHDdb2ehf5/5pRbXN/PoNh9PQ+cRuv9CDzy3BqrhLnTgkZ3z36yBrO4OU3kgsSIx bKVBzl6wm2B4/feHTf/8CwLtU6IV4PIU1YoiRdARrpJq0xFaCYZI8nP7B3xXzn/k6Bom TN0/P5CF7NYJJYFbosg/t56VPrQ+T2oLUaovz9XJAXmlZEIcZFVyw0RSVkXHTasbrm5H 21BRoS0lQY+zPT6i4s/cS85vxpPo551O5STH1dkbRJDnt+/GYYQm5Ehhx3nhbuB8zA0o dCqQ== X-Gm-Message-State: AOAM532R3ecYIyFaVzZpS1MCzpm6P8fPvrT3Bcnv4WQoZEq8NqlSIBmy AvoPja771h/MFvnVmQmp7nM6DA== X-Google-Smtp-Source: ABdhPJyiQ1Dq5u49OR3fXAfm+2eccv3ffMdE+z4V+DWcE7R4TT5inmbnDGnEzFjPHHMnRccPE95hkw== X-Received: by 2002:a17:90a:a107:: with SMTP id s7mr11289459pjp.1.1624480787198; Wed, 23 Jun 2021 13:39:47 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id y15sm408790pjy.38.2021.06.23.13.39.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Jun 2021 13:39:45 -0700 (PDT) From: Kees Cook To: Greg Kroah-Hartman Cc: Kees Cook , stable@vger.kernel.org, Guillaume Tucker , David Laight , Arnd Bergmann , linux-kernel@vger.kernel.org, kernelci@groups.io, linux-kselftest@vger.kernel.org, linux-hardening@vger.kernel.org Subject: [PATCH 2/9] selftests/lkdtm: Fix expected text for CR4 pinning Date: Wed, 23 Jun 2021 13:39:29 -0700 Message-Id: <20210623203936.3151093-3-keescook@chromium.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210623203936.3151093-1-keescook@chromium.org> References: <20210623203936.3151093-1-keescook@chromium.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=856; h=from:subject; bh=BtO+LH6joKjiA1jPQ0OLj8i4wDaw/FKwTM5xGU6TBl4=; b=owEBbQKS/ZANAwAKAYly9N/cbcAmAcsmYgBg05wFD1/rNKnVPI48nDGJ/4Gf4RKsbn3ohaIJBJ1z W+hDT3uJAjMEAAEKAB0WIQSlw/aPIp3WD3I+bhOJcvTf3G3AJgUCYNOcBQAKCRCJcvTf3G3AJgPRD/ 9554BXu8baUchD9pqZuBakcbDtoPvR4mAfpwlKhZmDIAG1GjldVg2qs85A5/51LQ1mPCqv8HQUw/5y JucMju9+zN9hyC0j4+K+mz7kiWWsbTgpvRshpU9z89xohKpQO4RgwEhcJ80nVl+g6G7xtTBM9sZjDr ZsXxJE2vxcrsPc/Jk/ucVWI36iZw/JOrEwliKBaaoVEybyEbNPM9RoOGYTOaBJFPhencB0xSczI1YK ZoykQ09IfaXPfJG1cbYhdwyAU4Yo+oLY3VaWi47ELXLhwp9H4HbI0XpZBqNRlbK0Qd/YFnW614FjI/ f+piK+8e7mlAet+zuWdo9LrPQ84Q6toQSV2Y7YsksdVBY6ZVOfatpEDU3W4eKObM0234oE10xnAzJL nPeO610vI0wZ/OhmzHfwb/ybuomHS+e8L6MH0dYsOTU+5ON6bt8TgnX4clULypm89ihL9BrSEypG5c K+QqcbauDvH3EaLB0tP891W0aQ2f5He2M9QpqlvjIQiPWFHAHRmN5nHQTkWTxrY6sqW11nZll/OS1V +cHUbHbJWW5oiXsToLDOt9JBGoCUyqlqqde6vUoGyZZMU7kB1Cm98asIvoVCgcTFGXFaf3y48e4PrX MjdV0E8cknxC9Dr8pewPuwrhjptu/C8x3lPZeduzmOqHLbqxmVuUGORZ9rIA== X-Developer-Key: i=keescook@chromium.org; a=openpgp; fpr=A5C3F68F229DD60F723E6E138972F4DFDC6DC026 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org The error text for CR4 pinning changed. Update the test to match. Fixes: a13b9d0b9721 ("x86/cpu: Use pinning mask for CR4 bits needing to be 0") Cc: stable@vger.kernel.org Signed-off-by: Kees Cook --- tools/testing/selftests/lkdtm/tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/lkdtm/tests.txt b/tools/testing/selftests/lkdtm/tests.txt index 11ef159be0fd..a5fce7fd4520 100644 --- a/tools/testing/selftests/lkdtm/tests.txt +++ b/tools/testing/selftests/lkdtm/tests.txt @@ -11,7 +11,7 @@ CORRUPT_LIST_ADD list_add corruption CORRUPT_LIST_DEL list_del corruption STACK_GUARD_PAGE_LEADING STACK_GUARD_PAGE_TRAILING -UNSET_SMEP CR4 bits went missing +UNSET_SMEP pinned CR4 bits changed: DOUBLE_FAULT CORRUPT_PAC UNALIGNED_LOAD_STORE_WRITE From patchwork Wed Jun 23 20:39:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 466099 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35BEFC48BC2 for ; Wed, 23 Jun 2021 20:39:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1B9B8610C7 for ; Wed, 23 Jun 2021 20:39:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229881AbhFWUmF (ORCPT ); Wed, 23 Jun 2021 16:42:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229523AbhFWUmE (ORCPT ); Wed, 23 Jun 2021 16:42:04 -0400 Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0CC7AC06175F for ; Wed, 23 Jun 2021 13:39:47 -0700 (PDT) Received: by mail-pg1-x535.google.com with SMTP id u190so2777884pgd.8 for ; Wed, 23 Jun 2021 13:39:47 -0700 (PDT) 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 :mime-version:content-transfer-encoding; bh=h2E/emdsJT4/hSnBDyJfRLo21OxhdAolWugWFwmcmlQ=; b=W3ln4OJoSgh2tDYaZAkeBL1277kPHbjLgQzh5jp2lHmXWXDid6pL7ifbY/8JMhqBnS E7ljjEw7rDNL3pcvx7ES8rXIbycmwc5DlSBciCnxaHzzXxCJZJrIjzcmCdgTP3ZMG3h1 SvFAVic/oKTuJMlBmdCueWnPCoQBZ/kqG3otE= 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:mime-version:content-transfer-encoding; bh=h2E/emdsJT4/hSnBDyJfRLo21OxhdAolWugWFwmcmlQ=; b=Obzo3jRPyHw2GOi32QPKiYKv5QFK6L08DnrHGjd7JNs6CTAVPyKqUxC0bp8nGdAkQC vNYQY0uL9O9McbA66EfMZXWbcFHBe/vveHyhcHtN0Ne+oTfi0p04PN5rGxq5pgt/lceF ZlxuL8P1/eFkkQOBdCZl4H/V3vHx6SuieSWRYE9lMQxDrkMjll+8L0Yr9dlTTz3dJJLp OTnI2jWp6PgI8slmwnv0n+tfwc42SwBNgizY0fu3YTNHfe+dvalmhGU5e3g7dG/DoSA7 pLc4XTZ5J2AGMI+c+AtKCCE//nJGhMlz7Xb8nKbkCBMga63ptllIik7bsNipUuE+yysk xNzQ== X-Gm-Message-State: AOAM533PskxwgALm7Wj/YOgDTxspj5YQjT8DGtoUgxKfoyEoc8ivnXBq JAUnMUb2x0uCZ3dZ9ZNpBfBu2Q== X-Google-Smtp-Source: ABdhPJzu//ZPWLX4RFym3EWsld5xfBoKsgNiAcSmpIzhn3Zc80aAcR0fpGEdYQmR0b32cLTxprQFRw== X-Received: by 2002:a63:d003:: with SMTP id z3mr1232630pgf.210.1624480786581; Wed, 23 Jun 2021 13:39:46 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id c5sm5961432pjq.38.2021.06.23.13.39.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Jun 2021 13:39:45 -0700 (PDT) From: Kees Cook To: Greg Kroah-Hartman Cc: Kees Cook , Guillaume Tucker , David Laight , Arnd Bergmann , linux-kernel@vger.kernel.org, kernelci@groups.io, linux-kselftest@vger.kernel.org, linux-hardening@vger.kernel.org Subject: [PATCH 3/9] selftests/lkdtm: Fix expected text for free poison Date: Wed, 23 Jun 2021 13:39:30 -0700 Message-Id: <20210623203936.3151093-4-keescook@chromium.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210623203936.3151093-1-keescook@chromium.org> References: <20210623203936.3151093-1-keescook@chromium.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=948; h=from:subject; bh=7Z6rDIdXc6OEiqueR+KR4HSl76Pq0nn3txazVEELU2Y=; b=owEBbQKS/ZANAwAKAYly9N/cbcAmAcsmYgBg05wG3Bu0QsJe7x2Dvq5gEv1AswiiPcQny5ntqUEu USMIUZuJAjMEAAEKAB0WIQSlw/aPIp3WD3I+bhOJcvTf3G3AJgUCYNOcBgAKCRCJcvTf3G3AJsYqEA C06Fjzuf/YFUDtqs9XGLBFg8ytEwa9LuoVTEzEvqPRHMjLXpPtx0U+WDGizzYfKlE9cFl1/pMdd05j Wqbj0N7UjHFWwa0qWFNGrMl0TnxkVFLZfK0ATu8aHMg6WAaZeSIBkijJHxpo5Oucnw5eDyiMn+eaGC Ht8s39AluGZ9uMqV0Ra2HIUaMimP7PnwM71FZXQ0OT+HxNtj4uL3gQuImuMfFRr5eaUsFDRVMHbsDL SOQXpMm34N/lycRcZvd8dRinj3+tA+TMBrv9pydRg6n3Qgm/FBD0Te8TnASKtt2RedQpsuj72Ho+Fe 4Lxv2yQ7inHYJbkrl9GAYOEDY1W7zQOj6yYUgutI6/919Zt3bs0Ml6CYaGCAtuu3evX9uhSdvR1ZPt NvglZf1dMNUGJZ3qeib24mKTek1QAcTJzvswlV+JxLBaCxAFtvMelCA7re6G/OO/84EEg4yKGtJxEp VmAjYgmqw3ZJbfB9PBCNgi89vQuhA85JuyGLqta9lTeu1U76SWF2IdUCctfcGnAAlcVtMBGLwiYPN5 Ajj52D8lA1Mcl9Wa0N98/YLkIynMA9A5evXOM/0x1WQ8C2gnVipNq6pk4+u1OvkX2Kf7XOzp4+lVqO Ap6O16W38xSAf6o1xen1nRrRpc1Um5d/6PNVEObh//+D2Moh51HKm+vbrBCg== X-Developer-Key: i=keescook@chromium.org; a=openpgp; fpr=A5C3F68F229DD60F723E6E138972F4DFDC6DC026 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Freed memory poisoning can be tested a few ways, so update the expected text to reflect the non-Oopsing alternative. Signed-off-by: Kees Cook --- tools/testing/selftests/lkdtm/tests.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/lkdtm/tests.txt b/tools/testing/selftests/lkdtm/tests.txt index a5fce7fd4520..a94d4d8eeb5c 100644 --- a/tools/testing/selftests/lkdtm/tests.txt +++ b/tools/testing/selftests/lkdtm/tests.txt @@ -17,9 +17,9 @@ CORRUPT_PAC UNALIGNED_LOAD_STORE_WRITE #OVERWRITE_ALLOCATION Corrupts memory on failure #WRITE_AFTER_FREE Corrupts memory on failure -READ_AFTER_FREE +READ_AFTER_FREE call trace:|Memory correctly poisoned #WRITE_BUDDY_AFTER_FREE Corrupts memory on failure -READ_BUDDY_AFTER_FREE +READ_BUDDY_AFTER_FREE call trace:|Memory correctly poisoned SLAB_FREE_DOUBLE SLAB_FREE_CROSS SLAB_FREE_PAGE From patchwork Wed Jun 23 20:39:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 466097 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7EE7FC49EB9 for ; Wed, 23 Jun 2021 20:39:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6CB62610C7 for ; Wed, 23 Jun 2021 20:39:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230015AbhFWUmL (ORCPT ); Wed, 23 Jun 2021 16:42:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229945AbhFWUmG (ORCPT ); Wed, 23 Jun 2021 16:42:06 -0400 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EAB1EC0617A8 for ; Wed, 23 Jun 2021 13:39:48 -0700 (PDT) Received: by mail-pj1-x102c.google.com with SMTP id k5so2187588pjj.1 for ; Wed, 23 Jun 2021 13:39:48 -0700 (PDT) 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 :mime-version:content-transfer-encoding; bh=weOFYHnAt9XHzyijtFN46zZa/bge4PQn7pFxvS+uscM=; b=PINKBfWpr3gvTyJ0eFnAv65n6MifZbR/apDoNhNeYQq+pb7Y+nHfI6/29jpyhKRsrA kSmtPGNKM36+xWmlgXqHNtUo2kVWovxkLqFL92N+B8M0nbpRfCD32Nat5OMJ3EJp3QwV KrPvrHdngyt40imWa1hgx+IPHVy1nFGR4oZAI= 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:mime-version:content-transfer-encoding; bh=weOFYHnAt9XHzyijtFN46zZa/bge4PQn7pFxvS+uscM=; b=FMDvhpVD3pJZk1sZqRnlZ8yXtXt+kyCqCyKJx7MbQP1GRv+CGHXeofR/sE+DRBIIbc IZcNhDIJhLxctxWT9nZWThcNNZIChs6uY/qWjtEzuIhzLfTwO3hgfObvkKvgFWYPgAF5 aHyBBgPdYKXJi5pXj5RqXec0+WD1onDnjbzlnbKSna2yawxnSGKpoT3E8wb/6DY8oCqh HpLEYiiXyOAFe3I2OMRcXdnhi1ZKZFGt8QZLelwU/C1/NHqx3lVskEeXG41xtnEbzxuE Nc0sU9sCu5sdWrPV/OAQ8YzyXXCZvoWmZWVyfyO6RnEt+WYwns5HzpWgp3mh2M2+HAVh CysA== X-Gm-Message-State: AOAM531N6cEfnPZCHNcU3g4/eq28MqWB7aExbYu+xYgeUw22FZVJafhr aV3uO260oPr9b+wWaFvUs+TimA== X-Google-Smtp-Source: ABdhPJx1ypcWLUnUHJBbnBIjhX9m3ZNAxwtdnMUAu2WOpDwAvnSgoGuRx7tr0mmBARqaMdXFPQlhRQ== X-Received: by 2002:a17:902:c789:b029:110:4933:71ce with SMTP id w9-20020a170902c789b0290110493371cemr1194211pla.56.1624480788561; Wed, 23 Jun 2021 13:39:48 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id f5sm640523pfe.79.2021.06.23.13.39.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Jun 2021 13:39:45 -0700 (PDT) From: Kees Cook To: Greg Kroah-Hartman Cc: Kees Cook , stable@vger.kernel.org, Guillaume Tucker , David Laight , Arnd Bergmann , linux-kernel@vger.kernel.org, kernelci@groups.io, linux-kselftest@vger.kernel.org, linux-hardening@vger.kernel.org Subject: [PATCH 4/9] lkdtm/bugs: XFAIL UNALIGNED_LOAD_STORE_WRITE Date: Wed, 23 Jun 2021 13:39:31 -0700 Message-Id: <20210623203936.3151093-5-keescook@chromium.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210623203936.3151093-1-keescook@chromium.org> References: <20210623203936.3151093-1-keescook@chromium.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=821; h=from:subject; bh=Ug1zxBYqfqGVjk6HZPE+S2IQ++k8iErOOapO5olSeEg=; b=owEBbQKS/ZANAwAKAYly9N/cbcAmAcsmYgBg05wGnJvmDSLi1MPOx05nkNSD/27SmvDUPYKaSZ+b ABK1bYKJAjMEAAEKAB0WIQSlw/aPIp3WD3I+bhOJcvTf3G3AJgUCYNOcBgAKCRCJcvTf3G3AJhiJEA Ciux3+IGOay7Jw49WbIkgIv0TxSZgcO90q+vD3qxYri5Kve5Gl362F2aW0FCOlOtxfzOnGmC53o+vL mnCazUpoqn0dW/Y15W4dfOo+HoN5/Afr2nMEj2cwPYh7e2v3kQ2/JK4gaqP9mMDegUGCvWynQbQq54 md3YCttGo14SuaAMF9Wgo60xgxde5gIvQadm2WfvXU0BLyeZBBQb/iHJb8A06PBRzIBP06Nu+NmVVS 4gjNsMrbg6ltVcNDZ67UJ4sjzuFEP2hO+bd3d6/D/d7os59xJd11AHlpBYfk1gCBMC4wl/ZHgbOsaY ew49zKobbo1qt1K8F7Yct3U3IZZ9e2Ny/XCdM/rQMR0KlGYK/LXREO8mEubV2DBQzQidihoy2cFwBk 5gEjXn+w2QmsY5GXkuCXxsRXVw90q9IyT0Qt6kyJ44vqmTKpUFpcarqthBP1/2nXx243B73YaVCB12 6nd+koQb1m5NQNvzwZ8i/jObt5py/ucSDlpCVQ/PCl3NUt9sRB0S8MRNKXxgEJuNMGGs/BUSoYK5AE 51LAiLpudvJPuDuLgHUfzx1Ig+tAVem+P/7WoryLM/rDXtXqsXoyyHzBPcZGczV6nPm7xCwdkviySP adfzxjhgaQrqToXPyTkus9c6NYZDhVyUcK6oihTYUAjfRzEQc+F7f3grbaNA== X-Developer-Key: i=keescook@chromium.org; a=openpgp; fpr=A5C3F68F229DD60F723E6E138972F4DFDC6DC026 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org When built under CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS, this test is expected to fail (i.e. not trip an exception). Fixes: 46d1a0f03d66 ("selftests/lkdtm: Add tests for LKDTM targets") Cc: stable@vger.kernel.org Signed-off-by: Kees Cook --- drivers/misc/lkdtm/bugs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/misc/lkdtm/bugs.c b/drivers/misc/lkdtm/bugs.c index 0e8254d0cf0b..9ff02bdf3153 100644 --- a/drivers/misc/lkdtm/bugs.c +++ b/drivers/misc/lkdtm/bugs.c @@ -161,6 +161,9 @@ void lkdtm_UNALIGNED_LOAD_STORE_WRITE(void) if (*p == 0) val = 0x87654321; *p = val; + + if (IS_ENABLED(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)) + pr_err("XFAIL: arch has CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS\n"); } void lkdtm_SOFTLOCKUP(void) From patchwork Wed Jun 23 20:39:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 466096 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E579EC48BC2 for ; Wed, 23 Jun 2021 20:39:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C92A4611AD for ; Wed, 23 Jun 2021 20:39:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229959AbhFWUmM (ORCPT ); Wed, 23 Jun 2021 16:42:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229994AbhFWUmJ (ORCPT ); Wed, 23 Jun 2021 16:42:09 -0400 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 943E3C0613A4 for ; Wed, 23 Jun 2021 13:39:50 -0700 (PDT) Received: by mail-pl1-x630.google.com with SMTP id d1so1144773plg.6 for ; Wed, 23 Jun 2021 13:39:50 -0700 (PDT) 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 :mime-version:content-transfer-encoding; bh=u4Wq1GvZOIjkJl+9Sb3C5gljEm3KHr7dyOq9Nh1kENs=; b=XFDgiA11BlqOZ/s5qZFq8MJlNVnoxfK5CVNFc1wQ+SamMB7fnUnMUUgxxrmEowQujn tChT4z4jt7Dod0HMLYvUcQ5smxaJewfSB0bx0ip0qzErWVrXCz873TRrhXNwq1WgYPh2 J+XbSmnSUcAJVg4aI04DD6Q+X3GDjnShhd/c0= 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:mime-version:content-transfer-encoding; bh=u4Wq1GvZOIjkJl+9Sb3C5gljEm3KHr7dyOq9Nh1kENs=; b=NqAH2PnehEge+qgAxvdbSm4NfsALm/FOwNRBolBH2bDPyQfjRnGKsKGMugXOTX4UC3 F1qw8ioRLm+P37d++4QihBPIWH0qmYDZUhdJrsI1WP3STRIYDt53U5vxeLFg+n+ogQvL A03p9d3FQkhiSgxCkuZdEiHRDdEeAuRpo7qCy38NXJxoCNiA9EVXgTya1w8S6PW3J+Cd ns6qNz7+AKPjnBHaQdAvxvPzMDeZl34hmOzdtCmC4cqy7Y2e4dCt30rXvoDikqCWzX7B GUsk30XCwRuiOa52vQVuEGpKLLmb059phW1+0Fir56CevX5I7QbTwSJJicDRhYWtLFQJ NGDg== X-Gm-Message-State: AOAM532j8ubMa8iuvaGi2Z/4es87x5AvEBFkLpQof6U9IRTjzA6cT4vQ o2rww6i6zBhf6J1gEH2lrrrdnw== X-Google-Smtp-Source: ABdhPJwaRWpJV0oWeW72e7h8k40qI2L5xwkI1YI4az/SGTiOAfGJgoe0c1chphXJsHy1G3dgvqSphQ== X-Received: by 2002:a17:90b:33c6:: with SMTP id lk6mr11521139pjb.6.1624480790156; Wed, 23 Jun 2021 13:39:50 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id y39sm644828pfa.119.2021.06.23.13.39.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Jun 2021 13:39:48 -0700 (PDT) From: Kees Cook To: Greg Kroah-Hartman Cc: Kees Cook , stable@vger.kernel.org, Guillaume Tucker , David Laight , Arnd Bergmann , linux-kernel@vger.kernel.org, kernelci@groups.io, linux-kselftest@vger.kernel.org, linux-hardening@vger.kernel.org Subject: [PATCH 6/9] lkdtm: Enable DOUBLE_FAULT on all architectures Date: Wed, 23 Jun 2021 13:39:33 -0700 Message-Id: <20210623203936.3151093-7-keescook@chromium.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210623203936.3151093-1-keescook@chromium.org> References: <20210623203936.3151093-1-keescook@chromium.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=910; h=from:subject; bh=QfRkdXxwpbuwCkU2UJjVNaH2YmtWo4KLL9a8FrnsAOg=; b=owEBbQKS/ZANAwAKAYly9N/cbcAmAcsmYgBg05wGyZpmYK4bGS71//ZU4B8K/PYzebIRU4wL+IO5 4o7WiviJAjMEAAEKAB0WIQSlw/aPIp3WD3I+bhOJcvTf3G3AJgUCYNOcBgAKCRCJcvTf3G3AJirXD/ 9ZdemyXHPgslPcJgT1bRYzqMUwNSL97PXErHRLjYgDkmORiRviHSACWq7BdCf9JHLl+jBeflXOPLZQ AbximpuX/FoB9FKsrHW7PAqWDi25hrM8UFNh/Qru8hNicn5W1byfOBVo36lG7+/+4QKrrpMorYPEsA om3e7YlG5GsVrovAHUHMNWJ5WMcPZAvZJb0D7ESVcVjxhzmYoqccFGJIJpbNQU+MnoaLTs9Iu3PRuV 3q3nzAZIENHOUMQTihH7jEog+oudsw6O4yKRlYsP1+dKYm8HI2+1PBjkUcEx4gmBuvcCOfyaYseu0j 1bdozFFNR+T/Ji8v5ry2S6p/fsoMQTItw57w7xCT/tqZHcpMgddcxy+/QcdE5VnE0oW4Zc3ySiZWZB xfyGeUzLdRHPzcKdIYqflNCMw1VQSUoQNoV/Z6ImPROiSRYk+w0173YAlUNgSjTsP2CV96lhqelPSi RtjbNSRaB0FmDCi5+P0jaXa3lKOxnR4XAOyunOMRds0qwSeGiPWU+a8MWj1dWlDzZWoAgiqHO32CQK 62fMew6TMBnOwvUSFXRq7J8zdEMNoiTO+jF+UhnChwpGrid6O+oLnFe/cjuzWYp5rICy/d03T4yBKD mSq+hoWr7vvnEQpgPh92VHycKploZOSBWMAcAaolOJlskbK4P3hc9IVdTRog== X-Developer-Key: i=keescook@chromium.org; a=openpgp; fpr=A5C3F68F229DD60F723E6E138972F4DFDC6DC026 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Where feasible, I prefer to have all tests visible on all architectures, but to have them wired to XFAIL. DOUBLE_FAIL was set up to XFAIL, but wasn't actually being added to the test list. Fixes: cea23efb4de2 ("lkdtm/bugs: Make double-fault test always available") Cc: stable@vger.kernel.org Signed-off-by: Kees Cook --- drivers/misc/lkdtm/core.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/misc/lkdtm/core.c b/drivers/misc/lkdtm/core.c index 645b31e98c77..2c89fc18669f 100644 --- a/drivers/misc/lkdtm/core.c +++ b/drivers/misc/lkdtm/core.c @@ -178,9 +178,7 @@ static const struct crashtype crashtypes[] = { CRASHTYPE(STACKLEAK_ERASING), CRASHTYPE(CFI_FORWARD_PROTO), CRASHTYPE(FORTIFIED_STRSCPY), -#ifdef CONFIG_X86_32 CRASHTYPE(DOUBLE_FAULT), -#endif #ifdef CONFIG_PPC_BOOK3S_64 CRASHTYPE(PPC_SLB_MULTIHIT), #endif From patchwork Wed Jun 23 20:39:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 466095 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 69A34C49EA6 for ; Wed, 23 Jun 2021 20:39:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 51FF16135C for ; Wed, 23 Jun 2021 20:39:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230001AbhFWUmN (ORCPT ); Wed, 23 Jun 2021 16:42:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229975AbhFWUmI (ORCPT ); Wed, 23 Jun 2021 16:42:08 -0400 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DF8BC0617AE for ; Wed, 23 Jun 2021 13:39:50 -0700 (PDT) Received: by mail-pj1-x102b.google.com with SMTP id s17-20020a17090a8811b029016e89654f93so4547919pjn.1 for ; Wed, 23 Jun 2021 13:39:50 -0700 (PDT) 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 :mime-version:content-transfer-encoding; bh=Pz31bWQ9kj3qQxfwbW4zNhCR6wU6ct/Uhdf374m05ZM=; b=bVah6ky5q1Oyu9Bp7zUuTiUXvq5aoO9izpLs3ix4WNWc7MmO6OWAc+KUoYmrjiaT8q Y45rQu0/kDD5K2LbPpN/5KIewbmXUkAd2EISHTAOFbWVbLTMpd4QC9MtGZcqXQMtn+Zt G9ATsaYiGlyYF4qtjGeUvi+nh3DWNzahK7ysY= 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:mime-version:content-transfer-encoding; bh=Pz31bWQ9kj3qQxfwbW4zNhCR6wU6ct/Uhdf374m05ZM=; b=S4F6QrcIf4kavwrzew2efMlr2oZjnr7QVGBP/gcIoQUI06wSopexf0bq6b23ZAVaAT RXHVmkCLd2rPQosl3+VNYEHgM+bmtgOekzGMcfVfIKK0zAHJDYhUMIBRDkm4qps9QDwi dKmGC9DHbegkX0AB5Zvma9qFdDdnsAtQBcQF/GL/IYklyS54CVK9hDdJ+akMvdrNLoJM QF2TSWMeGTFAdEgZiF7WuQhYe5F8wB+9q5Dj+mikGwLTQ3SNCAmgUok1gF1u63vgR0pM NngrKR9iftnU645a9VPMZq86QX1z4cnTxIS78/GkmMlf7+7T8fo/+8ZaN+tRJimZiSOT 7VOQ== X-Gm-Message-State: AOAM532GfUebi6o8PjQiQd+pbeL+DgJ3mzIfgGn5zD2Y5PY+CoOyX26e xBBjWvf9VODZu5dRZdctuBVNSA== X-Google-Smtp-Source: ABdhPJyseZfK6ymKJ1p5VaH3usDgxd6X9v2WJaXwac+1vU0OCFOx4hrbbiaiMbNuXL3Niss8HQPHiA== X-Received: by 2002:a17:902:c409:b029:122:5537:95a6 with SMTP id k9-20020a170902c409b0290122553795a6mr1169407plk.11.1624480789847; Wed, 23 Jun 2021 13:39:49 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id k9sm11010pgq.27.2021.06.23.13.39.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Jun 2021 13:39:48 -0700 (PDT) From: Kees Cook To: Greg Kroah-Hartman Cc: Kees Cook , kernelci@groups.io, Guillaume Tucker , David Laight , Arnd Bergmann , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-hardening@vger.kernel.org Subject: [PATCH 8/9] selftests/lkdtm: Enable various testable CONFIGs Date: Wed, 23 Jun 2021 13:39:35 -0700 Message-Id: <20210623203936.3151093-9-keescook@chromium.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210623203936.3151093-1-keescook@chromium.org> References: <20210623203936.3151093-1-keescook@chromium.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=938; h=from:subject; bh=mdLx0vJytUGz90du5cztVKVI/zg4LXTq/ivSPE9DL2U=; b=owEBbQKS/ZANAwAKAYly9N/cbcAmAcsmYgBg05wH6iQBLxV7pGZqSa7Oe0Zz9JY7N80557pAMpGH Y/TrfFmJAjMEAAEKAB0WIQSlw/aPIp3WD3I+bhOJcvTf3G3AJgUCYNOcBwAKCRCJcvTf3G3AJi9cD/ 4pY9gsJ0RUllyeaqn5C+w1B8pZc3dk6y9Dg4l5Uj+b4YJtlbDih3/wCb8cgUm0wo1sPAVse8PVeE+G J4Sepi+DP76OW+fuC4Ytf2zJST1Y47xdldZ2r3QAeduXBlCrGyLdziGma1HEeDRRcIUPq0G4lZvUJG g2aAhicvvMuGZsafw3WrOkiOkrMjYOM7eY/YHfv0UD34kHI9AnhzU+ZYbilOTxSdLbBzsJ3RtYnSiT HXLwCW+7YT8qQs8+fCMTtYTRfnGHG/FYYHosthcrUVjpE55x9l/l22JYd5tqpqGT0Iaz98Y4yKdZH0 ty/hAVob66L0hVjQHp624rqU0nXd0xr9Q+Y2fmc3DS3/HMrrhlMo7nhsVUOSf98/G2l5ldSjdxl/hm 9B9TTY2DyCxTsDOeSkAOVHA0RzE2g4Lhf7P41ConRrs0nI5RYrL6dR8vA/nfxf93yxGtGeUEWkeWL4 x4mbMwUUjJM7duARlmqNJZqYvVSviR2nFf+HpIfC2nNzgGJ0IbvQan66MFQSZIIrmPoJ+Q7JzPmwF5 QXVnAcFsH8h3ZGw4oEdrafr4BjLrvrVDrnTh+PUFvAKpoFWhXKuVsi0TIX45xjUIcHQcvScoXdCJQu +pDKxVhxnnFHoI+JA16YzjmHm6J7XzIApnpp4hoOhvym/RPNV771Bfqw1FXg== X-Developer-Key: i=keescook@chromium.org; a=openpgp; fpr=A5C3F68F229DD60F723E6E138972F4DFDC6DC026 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Add a handful of LKDTM-testable features that depend on certain CONFIGs so that they are visible in logs for CI systems that run the selftests. Others could be added, but may be seen as having too high a trade-off for general testing. Cc: kernelci@groups.io Suggested-by: Guillaume Tucker Signed-off-by: Kees Cook --- tools/testing/selftests/lkdtm/config | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/testing/selftests/lkdtm/config b/tools/testing/selftests/lkdtm/config index d874990e442b..849799bcfa95 100644 --- a/tools/testing/selftests/lkdtm/config +++ b/tools/testing/selftests/lkdtm/config @@ -1 +1,7 @@ CONFIG_LKDTM=y +CONFIG_DEBUG_LIST=y +CONFIG_SLAB_FREELIST_HARDENED=y +CONFIG_FORTIFY_SOURCE=y +CONFIG_HARDENED_USERCOPY=y +# CONFIG_HARDENED_USERCOPY_FALLBACK is not set +CONFIG_RANDOMIZE_KSTACK_OFFSET_DEFAULT=y