From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B786BC4332F for ; Mon, 19 Dec 2022 14:00:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231389AbiLSOAd (ORCPT ); Mon, 19 Dec 2022 09:00:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231391AbiLSOAa (ORCPT ); Mon, 19 Dec 2022 09:00:30 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31EB75F99; Mon, 19 Dec 2022 06:00:27 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id CE273B80E2A; Mon, 19 Dec 2022 14:00:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6C245C433D2; Mon, 19 Dec 2022 14:00:23 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="HgejK6BM" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1671458420; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=6wRbMMeXtTvfCbZJJJTglfnt7xRdpJs1iadlSbJZcKM=; b=HgejK6BMq0N4ml/rRu/TDtyjhttfXCgIlN2NXXR2p1o2sj3OnrjxYnoeOMjRzqRk4N2fn6 fQrvufHW+YBiKMW9SlN4xC2eDy7z2x8/xTeh4GUvRXHjZ+aw10LPVIW9mMcfcL6NkunTrT EFdqiqoxd/vmc/VqTYvkcnj0JC/FAzA= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 10ad1dce (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 19 Dec 2022 14:00:20 +0000 (UTC) Date: Mon, 19 Dec 2022 15:00:17 +0100 From: "Jason A. Donenfeld" To: Johan Hovold Cc: Ard Biesheuvel , linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, Steev Klimaszewski , Bjorn Andersson , Andrew Halaney Subject: Re: [PATCH v2] efi: random: fix NULL-deref when refreshing seed Message-ID: References: <20221219101237.9872-1-johan+linaro@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20221219101237.9872-1-johan+linaro@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 19, 2022 at 11:12:37AM +0100, Johan Hovold wrote: > Do not try to refresh the RNG seed in case the firmware does not support > setting variables. > > This is specifically needed to prevent a NULL-pointer dereference on the > Lenovo X13s with some firmware revisions, or more generally, whenever > the runtime services have been disabled (e.g. efi=noruntime or with > PREEMPT_RT). > > Fixes: e7b813b32a42 ("efi: random: refresh non-volatile random seed when RNG is initialized") > Reported-by: Steev Klimaszewski > Reported-by: Bjorn Andersson > Tested-by: Andrew Halaney # sc8280xp-lenovo-thinkpad-x13s > Signed-off-by: Johan Hovold > --- > > Changes in v2 > - amend commit message with a comment on this being needed whenever the > runtime services have been disabled I'll queue up the one with the amended commit message. Jason