Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp2571779rwj; Mon, 19 Dec 2022 06:21:12 -0800 (PST) X-Google-Smtp-Source: AMrXdXvrNdfI4cBjg2rlyG+aX6YP1w/9s+OlClKwY9YttXD+tiWH81OYfmMPItRLoTf6Gc83jxKt X-Received: by 2002:a17:906:8d86:b0:7cd:ffd:51f2 with SMTP id ry6-20020a1709068d8600b007cd0ffd51f2mr20683566ejc.57.1671459672086; Mon, 19 Dec 2022 06:21:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671459672; cv=none; d=google.com; s=arc-20160816; b=rySO5NxGylU5pTBum30Tk7gToS7smcutXpkagpJXRRg45N8QOz9Vrl7uFiNfxrmqR1 /UVVe1RZJPmPowbdXd5hJoVhKrG7CLRxDl8cZpTsUaFOzwTuFkRjLpNS82aaIB7K2wJI w1r2NKCt7HwOfQSRuEH1cwC9k9BMcCifZNa/mEUeWrv4Hylj5a0jd50YUq2h3KvvOiEB ZNH49wCvfLeSiLWU2ikGBiD1JbudO2bDmak4LFv8XSA1B5lU78WIvbfHZxgXSnkkg8ij gx5UVDVZL7JyliFQAyHo2Yk8VBt6U1k349L97A4o2PKHbKxw0YJD9jAqHRZFTIePS2NU AwlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=6wRbMMeXtTvfCbZJJJTglfnt7xRdpJs1iadlSbJZcKM=; b=Yv4O5LnN7jvHXYUHQI+UYZcmPU44tN/rlMjhN7ZHn/8Njf0FKX1wKEWzLpaz+6w22s EVc8olknp1B12higCWdglmPzyAyS2QcYQ4WUU74BKgunD/QywsrAvqszu9RH60Rvn+fD iLTzU1YzNZvL5ghVBvgO0wWo+uy6ZnXUOz8Sz+HZYfnSRnOzS5WBPB92TawRfI8r2IGH Niqpss2+MJfrmYu/z6JhMaSa2lMxD5rWkuMqnxl++s5nw8WjWSxHTaXNKQwkUSl9Dy9T DAQTBJrC/dDv8CG7gEPckk2CwAAjl/4QUjZNTD458fKZ1fzueBykj2rEDwVQ8i5rNHnP pg2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=HgejK6BM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=zx2c4.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d14-20020a170906370e00b007be3aa82544si6874326ejc.937.2022.12.19.06.20.54; Mon, 19 Dec 2022 06:21:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=HgejK6BM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231869AbiLSOAc (ORCPT + 70 others); Mon, 19 Dec 2022 09:00:32 -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> X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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