[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <dcc1800c-cf0a-4d88-bc88-982f0709b382@intel.com>
Date: Thu, 9 Jan 2025 08:30:44 -0800
From: Dave Hansen <dave.hansen@...el.com>
To: Kevin Brodsky <kevin.brodsky@....com>, linux-hardening@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, Andrew Morton <akpm@...ux-foundation.org>,
Mark Brown <broonie@...nel.org>, Catalin Marinas <catalin.marinas@....com>,
Dave Hansen <dave.hansen@...ux.intel.com>, Jann Horn <jannh@...gle.com>,
Jeff Xu <jeffxu@...omium.org>, Joey Gouly <joey.gouly@....com>,
Kees Cook <kees@...nel.org>, Linus Walleij <linus.walleij@...aro.org>,
Andy Lutomirski <luto@...nel.org>, Marc Zyngier <maz@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Pierre Langlois <pierre.langlois@....com>,
Quentin Perret <qperret@...gle.com>, "Mike Rapoport (IBM)"
<rppt@...nel.org>, Ryan Roberts <ryan.roberts@....com>,
Thomas Gleixner <tglx@...utronix.de>, Will Deacon <will@...nel.org>,
Matthew Wilcox <willy@...radead.org>, Qi Zheng <zhengqi.arch@...edance.com>,
linux-arm-kernel@...ts.infradead.org, x86@...nel.org
Subject: Re: [RFC PATCH v2 00/15] pkeys-based page table hardening
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?
Powered by blists - more mailing lists