From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754344AbdHUQIz (ORCPT ); Mon, 21 Aug 2017 12:08:55 -0400 Received: from mail-io0-f179.google.com ([209.85.223.179]:35635 "EHLO mail-io0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932099AbdHUQIv (ORCPT ); Mon, 21 Aug 2017 12:08:51 -0400 MIME-Version: 1.0 In-Reply-To: <20170821155913.7bmmy7zaihpd6s7h@hirez.programming.kicks-ass.net> References: <20170816110321.GC17270@leverpostej> <20170816125715.GB3384@codeblueprint.co.uk> <20170815223541.GA25778@remoulade> <20170817103514.GC27872@arm.com> <20170821103359.jt2xf2cx5wxjldau@hirez.programming.kicks-ass.net> <20170821140813.idloyrk4lowann3j@hirez.programming.kicks-ass.net> <6E0248C9-19AB-474E-A901-2A0422337DD0@amacapital.net> <20170821155913.7bmmy7zaihpd6s7h@hirez.programming.kicks-ass.net> From: Ard Biesheuvel Date: Mon, 21 Aug 2017 17:08:50 +0100 Message-ID: Subject: Re: [PATCH 3/3] x86/efi: Use efi_switch_mm() rather than manually twiddling with cr3 To: Peter Zijlstra Cc: Andy Lutomirski , Andy Lutomirski , Will Deacon , Mark Rutland , Matt Fleming , Sai Praneeth Prakhya , "linux-efi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , joeyli , Borislav Petkov , "Michael S. Tsirkin" , "Neri, Ricardo" , "Ravi V. Shankar" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21 August 2017 at 16:59, Peter Zijlstra wrote: > On Mon, Aug 21, 2017 at 08:23:10AM -0700, Andy Lutomirski wrote: >> > Ah, but only root can create per-cpu events or attach events to kernel >> > threads (with sensible paranoia levels). >> >> But this may not need to be percpu. If a non root user can trigger, say, an EFI variable read in their own thread context, boom. > > I was going by the proposed: "everything EFI in a kthread" model. But > yes, if that's not done, then you're quite right. > How does this work in cases where we need to call into UEFI from non-process context? Or at least from a context where current != EFI's kthread. We have EFI pstore code, for instance, that records panic data. Should we make an exception for those? I'm happy to have a stab at implementing the EFI kthread, but I'd like to get some of these details clarified first.