Message ID | 20250108103250.3188419-1-kevin.brodsky@arm.com (mailing list archive) |
---|---|
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9DE2EE77188 for <linux-arm-kernel@archiver.kernel.org>; Wed, 8 Jan 2025 10:36:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=0c45fBRzeK4+DNOGld4/dExcGN4T3dHYhPREShodZ+Y=; b=G1b//HFG2HVR6ckY2zo9vSYfif cOjQdnfzl38D6+PzgdWZOEt+dZSL+xraraOyFhmEko/3jCpurKUM2TUyIQAw2DVMjejix11HUhbpA 1qipYjg0J8/J3GZks79mpY0XMlgGK4NVoIB4LqQDdlQKQWyJLTQOnH6Ow6cezjzaJKW6jchmxQxSM zfSgMwQA8Wl1701n5pCNXQboVfcUlBrbtJzd0Z5HAPtyKHGw7t0txSzGtvgnoCofGns79NcOForWy IlwFmvN876tdaCWeDcSdWG4ZN2Q7h623x/XbZsiGjRJk2FFcIp9igcvT8GICNaIOIuj6e/2wkIE2U dShfhhjQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tVTQH-000000080pJ-3Jv5; Wed, 08 Jan 2025 10:36:25 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tVTO8-00000007zwg-33v7 for linux-arm-kernel@lists.infradead.org; Wed, 08 Jan 2025 10:34:14 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2EBEE13D5; Wed, 8 Jan 2025 02:34:38 -0800 (PST) Received: from e123572-lin.arm.com (e123572-lin.cambridge.arm.com [10.1.194.54]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id EB6A03F673; Wed, 8 Jan 2025 02:34:06 -0800 (PST) From: Kevin Brodsky <kevin.brodsky@arm.com> To: linux-hardening@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Kevin Brodsky <kevin.brodsky@arm.com>, Andrew Morton <akpm@linux-foundation.org>, Mark Brown <broonie@kernel.org>, Catalin Marinas <catalin.marinas@arm.com>, Dave Hansen <dave.hansen@linux.intel.com>, Jann Horn <jannh@google.com>, Jeff Xu <jeffxu@chromium.org>, Joey Gouly <joey.gouly@arm.com>, Kees Cook <kees@kernel.org>, Linus Walleij <linus.walleij@linaro.org>, Andy Lutomirski <luto@kernel.org>, Marc Zyngier <maz@kernel.org>, Peter Zijlstra <peterz@infradead.org>, Pierre Langlois <pierre.langlois@arm.com>, Quentin Perret <qperret@google.com>, "Mike Rapoport (IBM)" <rppt@kernel.org>, Ryan Roberts <ryan.roberts@arm.com>, Thomas Gleixner <tglx@linutronix.de>, Will Deacon <will@kernel.org>, Matthew Wilcox <willy@infradead.org>, Qi Zheng <zhengqi.arch@bytedance.com>, linux-arm-kernel@lists.infradead.org, x86@kernel.org Subject: [RFC PATCH v2 00/15] pkeys-based page table hardening Date: Wed, 8 Jan 2025 10:32:35 +0000 Message-ID: <20250108103250.3188419-1-kevin.brodsky@arm.com> X-Mailer: git-send-email 2.47.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250108_023412_859780_0CD491CF X-CRM114-Status: GOOD ( 38.87 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
pkeys-based page table hardening
|
expand
|
One of the sticker things in the x86 attempt to do the same thing was context switching, both between normal tasks and in/out of exceptions and interrupts. The easiest place this manifested for us was code chunk like this: kpkeys_set_level(KPKEYS_LVL_PGTABLES); // modify page tables here kpkeys_restore_pkey_reg(); We had to make sure that we didn't get preempted and context switch over to some other task that _wasn't_ doing page table manipulation while page table writes were allowed. On x86, we had to basically start context-switching the kernel pkey register the same way we do GPRs. How is SYS_POR_EL0 being context switched?