Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp3402922pxb; Fri, 4 Feb 2022 07:52:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJwfH4zWtn7F7H02eLhf/DQ5lONMbp3ZfoDJ6TJRrC6BF1Yubx7Terp9lMisaV6tCuw9KP4r X-Received: by 2002:a17:902:eacc:: with SMTP id p12mr3841186pld.54.1643989979541; Fri, 04 Feb 2022 07:52:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643989979; cv=none; d=google.com; s=arc-20160816; b=wrpcFqdj9F1xvB+GdmQKVFTgp5ahlS8EeKPX1nsdRQyAvVAOH3nNN1fnk7ZhJFRozy Zae0FbxJtlelJpeEpZplxTw8SzZYk4UegLDgkXtBB50Jt91sMr7KUY61wVd9spBtg9lV 5yHyta/VD763YA94Lu7pF7qaMfPqE5aMEng1XzNIX2meqe0MWL+2fowt/1IO50JnCJcd nh3jutUNS6dDvpEXpqJUsJgeackfjc8imGrumqPjtbb3Pt6BixMcxxCLPklTtjauN9it 54PFh/3xJh173YqUwCsFUwbcCuT/Wu5XqJR1p3YyOR9vaa0aQxEywMdg7sILCy4efffH C/aQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:subject :from:references:cc:to:content-language:user-agent:mime-version:date :message-id:dkim-signature; bh=y7b7TO8VokthV+oTw1T+0bstUehed7v5bqgJ78lhwTc=; b=i9Ffof4PbTb5alx+HUbrzDQBs43fqU8FRJ6A5B4IHqrOpL+JNCZOGmH6C5TbndSKCl sPYNBumADgVCnRD0yikakzUjKFNaqgW1wkTvvA90Nb+s94C1mEiXcB/fI3YWdQC9pTXZ SQL4eRAeR54wGUF938A2idFlFHZmJOoVkakhLFRqA8anqV7xaTqeSZWu3BOQXyUAjYjZ LQRBO51naOTwFwIO+tbM4Dw41VnMp2MT2AT1L93wATyf3inGKoGZFFMfzVwhinhLwrLC hWrn4nOB0WpESwG6adMvB4qRqCPD/fOQOURj3MT+W6P/wl/i+bEBKwh7Y5TddUAr1XLx qbWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=leB0RL3G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i15si2358686pgo.387.2022.02.04.07.52.48; Fri, 04 Feb 2022 07:52:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=leB0RL3G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355847AbiBCWmk (ORCPT + 99 others); Thu, 3 Feb 2022 17:42:40 -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-kernel@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.