Received: by 10.223.185.116 with SMTP id b49csp1023605wrg; Fri, 16 Feb 2018 11:01:07 -0800 (PST) X-Google-Smtp-Source: AH8x227yyd0iSupaxmmRYbVz6RijbYPWGvhq4okckGCn4qB8w6u0WLraMS9/6EHi9zpVsct89p7V X-Received: by 2002:a17:902:a50b:: with SMTP id s11-v6mr1688538plq.440.1518807666954; Fri, 16 Feb 2018 11:01:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518807666; cv=none; d=google.com; s=arc-20160816; b=Ta3hWx28ciGnOqAzFnXeJG9uq12bXBUhm8+gFfg/pMMpyT9cDEBHrCxzJY1ySW9rV8 C9JwM5QG9Ydxrr/mxD6lJZilgTM2lgF7MLBCpHTOnDXBmiO3z2QIcldJ78PRDlJRaUcJ 5BV9Tpy2YemcPXPMqI1AG+tWiK69DMl/z8jBWFXIlpkqI1F4DESzNG/UXx+A3orR30K9 9SGpHQbgdnwRBZHdTA6j2Og0sAV+PdWsCzI5pi7pXZteFYKE2tfHP+YUuxyHEQMzWGXh toWx6ACnk2RY8dH0c4Aa5C7A8RBo/VBNPJJuTW9CmtxBw/8AA3FXDzdXY19rKBh2P/+F yDtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=tVN9KUvghzj6yTZSiTeHF5fTBWIP9R/6p8Naz606OGY=; b=OgdWv7qljliSoXwAL/fSuC9/pafPZP2toVDNKfN9elWHuJWvsA3lTcjdkpmzpBpt1G UCFCc7hvuwUe/5a9XoxpJS1WKIGEcR/ghAzcdAFAgH2oACm1SlqlwNl/4JspW5Yl0WHy Bj66Dhl6GtSj4jGixypvwTNPW2fb7w+b2ehgMvSnPXUVrdcsbsB2qmjXn5FO/MsqQr+f fN+pbXwQHEXPyzq0qPFQ331jAsPNb5Kua1JYYyk/rlynprPCmli3f4kOrJdm/P7y3Yd6 8Pbs+DKP7tTUPTPnod25paljg3MMTd2ZDfWgiu4jOooouCEKTD/CFF9vC5IWM7ARWfVF ILpg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d24-v6si12339plr.243.2018.02.16.11.00.52; Fri, 16 Feb 2018 11:01:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934594AbeBPKz5 (ORCPT + 99 others); Fri, 16 Feb 2018 05:55:57 -0500 Received: from mail.skyhub.de ([5.9.137.197]:48622 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933125AbeBPKzz (ORCPT ); Fri, 16 Feb 2018 05:55:55 -0500 X-Virus-Scanned: Nedap ESD1 at mail.skyhub.de Received: from mail.skyhub.de ([127.0.0.1]) by localhost (blast.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id j9_PqfIZ5zD1; Fri, 16 Feb 2018 11:55:54 +0100 (CET) Received: from pd.tnic (p200300EC2BCAF7004CA5CE08379D95D3.dip0.t-ipconnect.de [IPv6:2003:ec:2bca:f700:4ca5:ce08:379d:95d3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id F3EEC1EC028C; Fri, 16 Feb 2018 11:55:53 +0100 (CET) Date: Fri, 16 Feb 2018 11:55:48 +0100 From: Borislav Petkov To: Ard Biesheuvel Cc: Joe Konno , Matthew Garrett , Ingo Molnar , Andy Lutomirski , linux-efi@vger.kernel.org, Linux Kernel Mailing List , Jeremy Kerr , Andi Kleen , Tony Luck , Benjamin Drung , Peter Jones Subject: Re: [PATCH 0/2] efivars: reading variables can generate SMIs Message-ID: <20180216105548.GA29042@pd.tnic> References: <20180215182208.35003-1-joe.konno@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 16, 2018 at 10:41:45AM +0000, Ard Biesheuvel wrote: > On 15 February 2018 at 18:22, Joe Konno wrote: > > From: Joe Konno > > > > It was pointed out that normal, unprivileged users reading certain EFI > > variables (through efivarfs) can generate SMIs. Given these nodes are created > > with 0644 permissions, normal users could generate a lot of SMIs. By > > restricting permissions a bit (patch 1), we can make it harder for normal users > > to generate spurious SMIs. > > > > A normal user could generate lots of SMIs by reading the efivarfs in a trivial > > loop: > > > > ``` > > while true; do > > cat /sys/firmware/efi/evivars/* > /dev/null > > done > > ``` > > > > Patch 1 in this series limits read and write permissions on efivarfs to the > > owner/superuser. Group and world cannot access. > > > > Patch 2 is for consistency and hygiene. If we restrict permissions for either > > efivarfs or efi/vars, the other interface should get the same treatment. > > > > I am inclined to apply this as a fix, but I will give the x86 guys a > chance to respond as well. That stinking pile EFI never ceases to amaze me... Just one question: by narrowing permissions this way, aren't you breaking some userspace which reads those? And if you do, then that's a no-no. Which then would mean that you'd have to come up with some caching scheme to protect the firmware from itself. Or we could simply admit that EFI is a piece of crap, kill it and start anew, this time much more conservatively and not add a whole OS underneath the actual OS. -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.