Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2302193pxb; Wed, 9 Feb 2022 15:36:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJxKMzbEfDa8rdRAIVzG4q5dKY/mOyph3BHZHMTnMTaoUnIuZCVoA5DRbW4/RT8/5jCVHzP6 X-Received: by 2002:a17:90a:8904:: with SMTP id u4mr6137297pjn.137.1644449818944; Wed, 09 Feb 2022 15:36:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644449818; cv=none; d=google.com; s=arc-20160816; b=lXe0xjBCzgb3PX68pHNk6dDd9VSXgxIZJbwWvmG6qWLbKbTEXexi8q9iUPyTskBkIZ z7lqxMKaeoOBHx1x29uKHxZI3ibxPrAT0t6QJBOhwsULdPwHz2d8IXFbRqJO0mYv2Omf S/JO47pPyNHgzv5I5pYI8RDSZFjQ6SOz00fiQ+lwDfpaQim9HmwCm7XacuK8LaKD4xhy X7TT+44VZPAJ4rix654tp5KVKUWonPqXtYt48f1zK5TUQVo+J4x/HLn/b4NR7vVKgwfJ Dst+k8rfcSGhdpSj78dhwcFWQ0QuxoQRceBVOmAa6gk59YAMk1VmHaTPnJbSMth8Lhru 1O9w== 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:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=x3NM7qJf17sdZEZoR8yr+EPWUC2fFF08xz1waj3n8wg=; b=HnAnt7IGS2dR4bPWmxNDZPDU6TI8oahIdt5nclvAsuwy1slTH/l1XAGCrW8j8MFWhb uglBDQ5xxXDoMwWNuASGEII4lm9bqbkMi7sXVbJiZvv3SehZcbVJmrv0U5bG3eR9DBqk 9+ZqaNOa2+eNKDksy6Z7x6amPe1KPUTWRKhipovZ+hgmb4vPjhtaduEnF6nnqCam7qaW TVz5kdgGCmXW5bUKTHpbaGiFBSqogl2o/TdEbf8GuXp9MNKGhC3f63bcjAoEuJfIVwZV hDitme9p/AhnlpvC+xXQbUE4ctH8HSlsKTA08MPrVHwVbqmIx0l1e3Pif1gq6RP/fsI2 CQyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="hUmdl/NX"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id m13si391369plx.308.2022.02.09.15.36.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 15:36:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="hUmdl/NX"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5BB23E0856DA; Wed, 9 Feb 2022 15:23:38 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234153AbiBIV4A (ORCPT + 99 others); Wed, 9 Feb 2022 16:56:00 -0500 Received: from gmail-smtp-in.l.google.com ([23.128.96.19]:48916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233832AbiBIVzw (ORCPT ); Wed, 9 Feb 2022 16:55:52 -0500 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 335EFDF8E3DC; Wed, 9 Feb 2022 13:55:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644443755; x=1675979755; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=cyA26yd1PlTgRBILEYh8lkKpW6JLK7FPHg1Hg2iCiiE=; b=hUmdl/NXm598+NQ2gNvv0VzJoFxlUZElIyTunvyrues4zxSjl6pmW2EI Ab0rBLPFCW6y2lUDXuULbLSb/g78ASfQlqxFuwNEVfu0NrdgQNumqu/Sp BAsUtAMu8D8Xe4MUawMMArnNpV+7RNIJ3ydG/UAtIp6N6WAoQeQBvhu7N iTZ3QCGBPOpZFybGdBU6WUVGJazdJ3u7rBrxRn2oeDu92hU3awzrtDmBD CIJ8fs8Pma5gyy0NJfpJB5Gy65ATYRl5xdjyZZXjrh4+QtvYNC+fgCbOb iZcDBtH9oWbajObvo4qjpD5f8fBwhlgWsdh5eRi4b8FAN/Ol2ybsoGPcW w==; X-IronPort-AV: E=McAfee;i="6200,9189,10253"; a="273893745" X-IronPort-AV: E=Sophos;i="5.88,356,1635231600"; d="scan'208";a="273893745" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2022 13:55:55 -0800 X-IronPort-AV: E=Sophos;i="5.88,356,1635231600"; d="scan'208";a="585735193" Received: from sanvery-mobl.amr.corp.intel.com (HELO [10.212.232.139]) ([10.212.232.139]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2022 13:55:53 -0800 Message-ID: <123f9a29-ddcd-13e5-68a1-22c6d938d76c@intel.com> Date: Wed, 9 Feb 2022 13:55:52 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH 14/35] mm: Introduce VM_SHADOW_STACK for shadow stack memory 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-cheng Yu References: <20220130211838.8382-1-rick.p.edgecombe@intel.com> <20220130211838.8382-15-rick.p.edgecombe@intel.com> From: Dave Hansen In-Reply-To: <20220130211838.8382-15-rick.p.edgecombe@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/30/22 13:18, Rick Edgecombe wrote: > A shadow stack PTE must be read-only and have _PAGE_DIRTY set. However, > read-only and Dirty PTEs also exist for copy-on-write (COW) pages. These > two cases are handled differently for page faults. Introduce > VM_SHADOW_STACK to track shadow stack VMAs. This is also a very appropriate place to remind folks that VM_WRITE is mutually exclusive with this flag. That's pretty important.