Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1589362pxb; Thu, 4 Feb 2021 17:49:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJwP6psWYHkvmUOes1f331oKFip8RP4N0kfefM6PbAoT2bZF2+ru39Iv4wxM4J8qqCH5RHnC X-Received: by 2002:aa7:c755:: with SMTP id c21mr1346275eds.47.1612489740698; Thu, 04 Feb 2021 17:49:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612489740; cv=none; d=google.com; s=arc-20160816; b=LbOR3YwGCQqUKFJhnv8Shwm5kGlbyP4PZkCPFVJ6ta96KzVdIJIs0Y5sXVaUQ31Ppl PhNybqWRQAjFmWJclTjro3g4QLjeWoecDwNUq64QVLZCeDRUNr3vPBJr7T06bhZ/REhS Hg7iLmxpXlxo1WcuSxPAbSmzn7uOcmT+xgqI/i/srxK3+04lMCL3Ei30P0jSY4hWx+Xy RAgMRFWtIbKhKtd+KOS5xHzvlw+eAkhvK8Y6ojmoEGNWOK+Mhn9exEmZ/s9i7PuYhsdk YhzTxTkJzWnOnx06/ZsR2LkSMEDvbXhp6AnzXU+Vw8bGiBGYvBQji9JokgRdsbgiITS1 9QeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=MzlCpCkLmxVsznheZI3EKTdR1f5kwqDGSaj2tE3igtU=; b=lF/wLZoK1LTya0qnC6r7H+Uu4nLDpv7hBnM8HZ23SgpoiBMPmW/MRMahdkcEGu3owZ UcfNsESzr1OQgc1HEwnTcJXBsWoeBv/VymwrRIB+41dsNZ5Z51yRb6WYlL6VqioSpLxK Cx7LmXLC+Mpj2OkuH0o5TvkyABTPYt5tyl0Z070g17MqcW5m/1BmlAdK0hT1nn4XRxQ5 CeegUTD0DZ/iKDOXvnGXzNH6yf8am3MofE1ydznROZnRJ5vWTShGggnQwpy39wrRmWXl waoApON/jr4uJKrRJi/IrIy/c368hC8th8VV9Bg21ZCk1i4jmJKCnFnHLgvS5hzyowAO bL9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Gvshsbpw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o5si4071064edz.447.2021.02.04.17.48.36; Thu, 04 Feb 2021 17:49:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Gvshsbpw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240151AbhBDUcc (ORCPT + 99 others); Thu, 4 Feb 2021 15:32:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240195AbhBDUaj (ORCPT ); Thu, 4 Feb 2021 15:30:39 -0500 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F513C0617A7 for ; Thu, 4 Feb 2021 12:29:58 -0800 (PST) Received: by mail-pl1-x632.google.com with SMTP id s15so2367088plr.9 for ; Thu, 04 Feb 2021 12:29:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=MzlCpCkLmxVsznheZI3EKTdR1f5kwqDGSaj2tE3igtU=; b=Gvshsbpw/2T8JIx2xC/Yj1b2gosWPoRbQqc9xnkQx6kZGmYOkUDhIB27gDkHZnhhkP YdNd6b0Qa3SsOJVZqFNbXe8+62GV0NeDEla1b6JqwqrIG28L1AlU7jaybevMTho6JcaU mRQIoa+gy6PKrbFD08moLs/Jau2larhRyAN+o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=MzlCpCkLmxVsznheZI3EKTdR1f5kwqDGSaj2tE3igtU=; b=enlVubUi+GMWwfu1HJlhyvU/AlAIDQWf8GNlAcCiqfjx0wfnCYQQyIdPQx8sk4Amet jaLQepdWlaKpHym/RLdWaFZzkT8QKe0MNI2/dftwcBfakmKSIf/x84ofL7TX51nIYHzJ A9XWod4hOGeh4OzdVIzFQfb/la8Bd10GyXgzUKd9tNRZOIggP2alhRWgdIY9wTc/eNzb 7P/ExuXDCNitYdOadj7KqlBAxBy9binBKwJwnLQ2PxRyk28vFpQyCKwFTRfjAtdYnmb/ vbaV9k3S2PzaIF1Z+f33gvJg8Wmf2HLoC6kPi8QkgSFFeo/g8DdLRdxjAfWYS1d80vir qBrQ== X-Gm-Message-State: AOAM531yW5aYg6ENxhn3yguPAYUGw4IeqUUO2SODaU9NixysV+LmNTNS p/D+bqiPFc2L3I1ZrzlBcX26vQ== X-Received: by 2002:a17:90b:949:: with SMTP id dw9mr788298pjb.20.1612470598230; Thu, 04 Feb 2021 12:29:58 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id j1sm6846456pfr.78.2021.02.04.12.29.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Feb 2021 12:29:57 -0800 (PST) Date: Thu, 4 Feb 2021 12:29:56 -0800 From: Kees Cook To: Yu-cheng Yu 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 , "Ravi V. Shankar" , Vedvyas Shanbhogue , Dave Martin , Weijiang Yang , Pengfei Xu Subject: Re: [PATCH v19 20/25] x86/cet/shstk: User-mode shadow stack support Message-ID: <202102041229.237544D@keescook> References: <20210203225547.32221-1-yu-cheng.yu@intel.com> <20210203225547.32221-21-yu-cheng.yu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210203225547.32221-21-yu-cheng.yu@intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 03, 2021 at 02:55:42PM -0800, Yu-cheng Yu wrote: > Introduce basic shadow stack enabling/disabling/allocation routines. > A task's shadow stack is allocated from memory with VM_SHSTK flag and has > a fixed size of min(RLIMIT_STACK, 4GB). > > Signed-off-by: Yu-cheng Yu Reviewed-by: Kees Cook -- Kees Cook