From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 64F82C6379F for ; Sun, 19 Feb 2023 20:47:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231552AbjBSUrX (ORCPT ); Sun, 19 Feb 2023 15:47:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230520AbjBSUrW (ORCPT ); Sun, 19 Feb 2023 15:47:22 -0500 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA3751632E for ; Sun, 19 Feb 2023 12:47:21 -0800 (PST) Received: by mail-pj1-x102d.google.com with SMTP id cp9so462914pjb.0 for ; Sun, 19 Feb 2023 12:47:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=in-reply-to:content-disposition:mime-version:references:subject:cc :to:from:date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=EQwHKFAOnqqVUFe2laozm23usPDD0BYqQFbDjsfGGZ0=; b=cMqm3sf+CmIV57EOrdFSH0Y6quW1uWdpJcrFTd2t38yjyfvYHAp87tnscm0cD4ruFl v7qL2TLj0IqBM7k0klpcJ9znFuXEQiRHtOHi3tlHnL14nRlrX+q4Wk3TqWjm4O4KDzjW jUhoMrl2bUhJOv+E5HJY1Zph4VZoAfhujd/fs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:subject:cc :to:from:date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=EQwHKFAOnqqVUFe2laozm23usPDD0BYqQFbDjsfGGZ0=; b=pLGHtURu8dS9vp7/DO03xz7AAan+oqIeV2metBtoYq/Gi3FvuikYwDUVALZK2FhTHe hXl8I21LPPgzlLsg/tuDq6ZFXjAAYI0CV61gtRibMouAPjbeB6CgGPxQBWb+RUyahqH5 caQANGvRN1j77jTNhEiZotwlL5EKBOyMbZ+FBZkRxUd+ny7ANl5xBEZ0YCl8OQpVGMUL xqqJGYkbyDtAxrAQhe+VudfJWWAzUNnmcw6d35SY4xvGDQWt1qlY7VQLSUQlHd5lxBwm TCgJnv2VviIROyI5i0ml3gCEielrZsC/o9PjpuzaeBTqXpSm7hqSMfujv+kZe0odH510 DQxA== X-Gm-Message-State: AO0yUKUyULqHzgRp4BOiTL5emwF2Jt5GmPGK7HEREEBKXyxzJqX2JZj1 C/gt2bBBCy5ahFVKjY2oefDmyg== X-Google-Smtp-Source: AK7set/hFIrWVTPTKDhOCxl9WJjZkcr/+hEi3oT24AxwvFiqzEXI+5JP9z5meWKExDOcc6n6nMbzbA== X-Received: by 2002:a05:6a20:6929:b0:c7:2086:634b with SMTP id q41-20020a056a20692900b000c72086634bmr14963415pzj.18.1676839641160; Sun, 19 Feb 2023 12:47:21 -0800 (PST) Received: from www.outflux.net (198-0-35-241-static.hfc.comcastbusiness.net. [198.0.35.241]) by smtp.gmail.com with ESMTPSA id 65-20020a630044000000b004f2c088328bsm1020035pga.43.2023.02.19.12.47.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Feb 2023 12:47:20 -0800 (PST) Message-ID: <63f28ad8.630a0220.b1efe.14e5@mx.google.com> X-Google-Original-Message-ID: <202302191245.@keescook> Date: Sun, 19 Feb 2023 12:47:20 -0800 From: Kees Cook To: Rick Edgecombe Cc: x86@kernel.org, "H . Peter Anvin" , Thomas Gleixner , Ingo Molnar , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org, Arnd Bergmann , Andy Lutomirski , Balbir Singh , Borislav Petkov , Cyrill Gorcunov , Dave Hansen , Eugene Syromiatnikov , Florian Weimer , "H . J . Lu" , Jann Horn , Jonathan Corbet , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pavel Machek , Peter Zijlstra , Randy Dunlap , Weijiang Yang , "Kirill A . Shutemov" , John Allen , kcc@google.com, eranian@google.com, rppt@kernel.org, jamorris@linux.microsoft.com, dethoma@microsoft.com, akpm@linux-foundation.org, Andrew.Cooper3@citrix.com, christina.schimpe@intel.com, david@redhat.com, debug@rivosinc.com, Yu-cheng Yu Subject: Re: [PATCH v6 37/41] selftests/x86: Add shadow stack test References: <20230218211433.26859-1-rick.p.edgecombe@intel.com> <20230218211433.26859-38-rick.p.edgecombe@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230218211433.26859-38-rick.p.edgecombe@intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org On Sat, Feb 18, 2023 at 01:14:29PM -0800, Rick Edgecombe wrote: > Add a simple selftest for exercising some shadow stack behavior: > - map_shadow_stack syscall and pivot > - Faulting in shadow stack memory > - Handling shadow stack violations > - GUP of shadow stack memory > - mprotect() of shadow stack memory > - Userfaultfd on shadow stack memory > > Since this test exercises a recently added syscall manually, it needs > to find the automatically created __NR_foo defines. Per the selftest > documentation, KHDR_INCLUDES can be used to help the selftest Makefile's > find the headers from the kernel source. This way the new selftest can > be built inside the kernel source tree without installing the headers > to the system. So also add KHDR_INCLUDES as described in the selftest > docs, to facilitate this. > > Tested-by: Pengfei Xu > Tested-by: John Allen > Co-developed-by: Yu-cheng Yu > Signed-off-by: Yu-cheng Yu > Signed-off-by: Rick Edgecombe I'll get some test hardware and run this myself too, but overall, ignoring the lack of kselftest_harness.h, it looks good: Reviewed-by: Kees Cook -- Kees Cook