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 5AAF1C433F5 for ; Thu, 3 Feb 2022 22:42:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355673AbiBCWmj (ORCPT ); Thu, 3 Feb 2022 17:42:39 -0500 Received: from mga07.intel.com ([134.134.136.100]:43030 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233162AbiBCWmi (ORCPT ); Thu, 3 Feb 2022 17:42:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643928158; x=1675464158; h=message-id:date:mime-version:to:cc:references:from: subject:in-reply-to:content-transfer-encoding; bh=hy/RLCWe0cRSgQ/BO6pCCoutmThN1jchwoR0BruyloE=; b=leB0RL3GfKNKebEDBDo29GGL0HfgCF+KPiBZjDwfRijzdSsnExH+sW5/ T0lQe1FQfoqR6xZWySe56wulk2Ej5SaH2ctEvdk/N4B1lAdBknL/MB87P 0gvzYwLMZ786pAqLNbxx1Xf+lVt9faIkOCIYLfCf/By3JFxB5D96eT/ot 4SBI70Lu1vCOTmbafdV1furIdMZxDIRok6AbPwXvlGukayHUO/1OM6je4 rr2j6SGih/61dQB1fEglwU+q4PQ9vAwX5qboxM0acwMNQ0/W2Rm4oFjOR fCpIe3HSgCIBkb0UukhKR4CLZut8+4K35KujLqsIl0Hi8AfmET91MXWNI Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10247"; a="311573272" X-IronPort-AV: E=Sophos;i="5.88,340,1635231600"; d="scan'208";a="311573272" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Feb 2022 14:42:37 -0800 X-IronPort-AV: E=Sophos;i="5.88,340,1635231600"; d="scan'208";a="498307414" Received: from oshoron-mobl.amr.corp.intel.com (HELO [10.209.125.125]) ([10.209.125.125]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Feb 2022 14:42:35 -0800 Message-ID: Date: Thu, 3 Feb 2022 14:42:33 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Content-Language: en-US To: Rick Edgecombe , 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 , Kees Cook , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pavel Machek , Peter Zijlstra , Randy Dunlap , "Ravi V . Shankar" , Dave Martin , Weijiang Yang , "Kirill A . Shutemov" , joao.moreira@intel.com, John Allen , kcc@google.com, eranian@google.com Cc: Yu@linux.intel.com, Yu-cheng References: <20220130211838.8382-1-rick.p.edgecombe@intel.com> <20220130211838.8382-34-rick.p.edgecombe@intel.com> From: Dave Hansen Subject: Re: [PATCH 33/35] selftests/x86: Add map_shadow_stack syscall test In-Reply-To: <20220130211838.8382-34-rick.p.edgecombe@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org On 1/30/22 13:18, Rick Edgecombe wrote: > Add a simple selftest for exercising the new map_shadow_stack syscall. This is a good start for the selftest. But, it would be really nice to see a few additional smoke tests in here that are independent of the library support. For instance, it would be nice to have tests that: 1. Write to the shadow stack with normal instructions (and recover from the inevitable SEGV). Make sure the siginfo looks like we expect. 2. Corrupt the regular stack, or maybe just use a retpoline do induce a shadow stack exception. Ditto on checking the siginfo 3. Do enough CALLs that will likely trigger a fault and an on-demand shadow stack page allocation. That will test the *basics* and should be pretty simple to write.