Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3295364pxk; Mon, 21 Sep 2020 09:56:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz91RHUkTBHZwMNObp6KR8KLCcMYEgl6pAeTVCHdoiVd7xXyS0MXEeYSGoyvODLbWQZWXYl X-Received: by 2002:a17:906:454e:: with SMTP id s14mr369396ejq.137.1600707394351; Mon, 21 Sep 2020 09:56:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600707394; cv=none; d=google.com; s=arc-20160816; b=gwVgnBfMUeIpn3u1vVkxQ9kRhlt8LKT9o695Xlm6zSM43Dge7PUOJgB4hMMDs5yyky 5xcaeLc9sjJANsQSn2BwBe/q07gHi3Z/Cv5Ok0HeXKp2Dn+EI0TG61GaLkvTRiNw5uJ4 Xm//uhkj2e26Oy5gWMIBa5r3HU1I/lhc4tNH5eg56XUI7xO3EwMzJPnymAyXvRPnO9SI HG9cjxKy/M4Aein6ikULxue9hy+YzTWyCcRmcyY5Zf39rjm+B3xzPlmEkQzgec3heHpM SQfqGLJrjhCuiz9feAiUnWa5/VRNKEuq0jh2Q+hw9nK95fDBMr2Hx26j4sXtFTbycbsg /NFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ObTRQy9qdyApBg5jDeAdIGO8HArdCHS742AdUiy9GeM=; b=lk/p2mJML0BcPAN0WPkQWFuVKQQp+S6znz9iw2SQGKVc6QIhhMZeiBBeLLvqTz4D7w vj2DUYSiJr95D1lrcrSKGn0O7IhHGQ3GSykrNzL54wordoq+xh2nNbWj1Y0+TPxbzLSR IbzKkfSwh57kmkm79SX//9KNpmj1hKUernLwDsEt/eABt0jbTMr0L1H/CGsU0t7LOKZm szLCaHQH/MPPovglkjUylhDvznmySihH+K699BC9KH17xC7JeRkWKMr9iPR/5b1klwAI LvZBqyv8oX8oHx9HLzCn/6WoSUEPl52JFtx/hdQYvDW09Jkr/a3V7mQgxthwoW8k6vWu /XWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=O979cFsW; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id fx6si8798858ejb.432.2020.09.21.09.56.11; Mon, 21 Sep 2020 09:56:34 -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=@kernel.org header.s=default header.b=O979cFsW; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729780AbgIUQzU (ORCPT + 99 others); Mon, 21 Sep 2020 12:55:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:52020 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727665AbgIUQpx (ORCPT ); Mon, 21 Sep 2020 12:45:53 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 474BE20874; Mon, 21 Sep 2020 16:45:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706752; bh=xdeqEMggzB4FvlJF3TTpzHbNj9IqrUdNiNTNJo4ZUfA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O979cFsWmcFiiAX8J8ddP3eBBXruGgC51G1JkGfI182QGoa8gLSZbybwqHUaeuXxw L/7TJortzon0n0AxiNn7fv8yUSiAas9TGsh6Ht38taoLPTwecx+6CfmZ+HOvxRyVXD iBaBJfaz5KRwssZM/ltx3jvLLp7JUSvYXF1Yqw3k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Branden Sherrell , Ard Biesheuvel , Sasha Levin Subject: [PATCH 5.8 080/118] efi: efibc: check for efivars write capability Date: Mon, 21 Sep 2020 18:28:12 +0200 Message-Id: <20200921162040.049943315@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162036.324813383@linuxfoundation.org> References: <20200921162036.324813383@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ard Biesheuvel [ Upstream commit 46908326c6b801201f1e46f5ed0db6e85bef74ae ] Branden reports that commit f88814cc2578c1 ("efi/efivars: Expose RT service availability via efivars abstraction") regresses UEFI platforms that implement GetVariable but not SetVariable when booting kernels that have EFIBC (bootloader control) enabled. The reason is that EFIBC is a user of the efivars abstraction, which was updated to permit users that rely only on the read capability, but not on the write capability. EFIBC is in the latter category, so it has to check explicitly whether efivars supports writes. Fixes: f88814cc2578c1 ("efi/efivars: Expose RT service availability via efivars abstraction") Tested-by: Branden Sherrell Link: https://lore.kernel.org/linux-efi/AE217103-C96F-4AFC-8417-83EC11962004@gmail.com/ Signed-off-by: Ard Biesheuvel Signed-off-by: Sasha Levin --- drivers/firmware/efi/efibc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/firmware/efi/efibc.c b/drivers/firmware/efi/efibc.c index 35dccc88ac0af..15a47539dc563 100644 --- a/drivers/firmware/efi/efibc.c +++ b/drivers/firmware/efi/efibc.c @@ -84,7 +84,7 @@ static int __init efibc_init(void) { int ret; - if (!efi_enabled(EFI_RUNTIME_SERVICES)) + if (!efivars_kobject() || !efivar_supports_writes()) return -ENODEV; ret = register_reboot_notifier(&efibc_reboot_notifier); -- 2.25.1