Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp294091pxy; Wed, 5 May 2021 02:19:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwhNhLbd/p3wSNFLLgY7C9qpHQUuqeWP1ndQXqFxAA1X9uxBc79Y1+Zs8n53oEI5h+wZ48T X-Received: by 2002:aa7:cb89:: with SMTP id r9mr31527226edt.245.1620206387071; Wed, 05 May 2021 02:19:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620206387; cv=none; d=google.com; s=arc-20160816; b=KpLOAs1OF9hFq+0Ketan2urJtTe0yM4qxGvZtrm+C8Z1Ga6mDd59/mu5uC7KOmSJ+9 M9RQ+cA9cGaQqNhqsTrTVvdUa1N3D80E9gCiWzpHv9fON5F0cQK2Js/6Wtk+lF05shAO 2R4/rZQJ19JoTteefqeDXxNZEgMcV4YOh844SXiCpf8QysR7gyu7b2qia9HSX9/b/e3h Lh+EqVjb76fdVDYHKeBh3ryLmPdUZTxpAB1BSa7eqihg09xsvf5myAASRtB0U+QRMJIK z3WqOreKaxqo4T79GewmmfMXpxoivLES01T0wNEB9eJgIkilj57R8O/6e7bOKcWuDmve iVrA== 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=jK0moekqG1xhMRv7+xXp4lJk9jp8uiNxobgiWKXh+5A=; b=akE8kDv9ltQ/mEAO+oJtLcVDlpQV1/1aaBN/eTJ4HfIxAXBfU8py3p8hNqyIm4ZPLI dY+6AF7y2VLOw1DGrMBZ2w7OKlq+Yolorz1ByVvbganRXxEDWsz8uEAPIbv4/TkaEdMS AV9iCgyeN5aG3dM61384+vX0OnSzUa1zU2RpXMiXQXO1th//WY1K4FbA3E5RfkPeAsWM wHHrL0VBJH33QlIKGpNP3ejH/kobZ2WEnDPXcJV0nOCQnie/RisdXFGDcrIgDM96XubO CmPsp+LAjpC/hjvcpHoVGlBENgsSmekZMJa8wrWtQ/fi3lnuyC3QJwrEHcVIdEi0E80n /RUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=jkvUVKoh; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 10si4947165edx.129.2021.05.05.02.19.22; Wed, 05 May 2021 02:19:47 -0700 (PDT) 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=@infradead.org header.s=desiato.20200630 header.b=jkvUVKoh; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231977AbhEEIit (ORCPT + 99 others); Wed, 5 May 2021 04:38:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231981AbhEEIio (ORCPT ); Wed, 5 May 2021 04:38:44 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5B5CC06174A; Wed, 5 May 2021 01:37:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=jK0moekqG1xhMRv7+xXp4lJk9jp8uiNxobgiWKXh+5A=; b=jkvUVKohOf8O1K994UUXsnu1Gj pAAaW1jnaye2Wb2MFj/ciaGL47PIcPViHLq0CnU333G/XawQNPK0MV6jmzZ4iyBgSQMki6+TDvuy3 hBUKvCswsLWem6snP55iS3jVqkke/+1gG137r3Igj/sdeN6oBGiR5ejHqcP/5OYtpMBlxQlB0WvYZ XUmLfDJtEqZ3rlw81tUS47E6aBsOEjpbYfbPZzqkON39WlzByDrdH6PpKXhyVLiOTqB/200jKL5pv RtP0WEXVcHu+1wVhJHtq1jJEiB5kNS5Dmu64OI+dtC1CWvHBIwfvdgtby5nCAAbOX0JIxQC66ZV60 1Vbtr6cA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1leD2B-000eI4-25; Wed, 05 May 2021 08:37:32 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 710D93001CD; Wed, 5 May 2021 10:37:29 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 57BA52D6DCEF9; Wed, 5 May 2021 10:37:29 +0200 (CEST) Date: Wed, 5 May 2021 10:37:29 +0200 From: Peter Zijlstra To: Kees Cook Cc: Rick Edgecombe , dave.hansen@intel.com, luto@kernel.org, linux-mm@kvack.org, x86@kernel.org, akpm@linux-foundation.org, linux-hardening@vger.kernel.org, kernel-hardening@lists.openwall.com, ira.weiny@intel.com, rppt@kernel.org, dan.j.williams@intel.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH RFC 0/9] PKS write protected page tables Message-ID: References: <20210505003032.489164-1-rick.p.edgecombe@intel.com> <202105042253.ECBBF6B6@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202105042253.ECBBF6B6@keescook> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 04, 2021 at 11:25:31PM -0700, Kees Cook wrote: > It looks like PKS-protected page tables would be much like the > RO-protected text pages in the sense that there is already code in > the kernel to do things to make it writable, change text, and set it > read-only again (alternatives, ftrace, etc). We don't actually modify text by changing the mapping at all. We modify through a writable (but not executable) temporary alias on the page (on x86). Once a mapping is RX it will *never* be writable again (until we tear it all down).