Message ID | 20221024112935.061892355@linuxfoundation.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp391796wru; Mon, 24 Oct 2022 04:33:59 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6d9ZhN+F7OgwXVANXyFvZUkaXB+5s61U+ZsiyRVBW977ThT2GSEJejzQaICqDmBe3/rHTi X-Received: by 2002:a17:907:1c01:b0:78d:eb6e:3807 with SMTP id nc1-20020a1709071c0100b0078deb6e3807mr27189340ejc.481.1666611239385; Mon, 24 Oct 2022 04:33:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666611239; cv=none; d=google.com; s=arc-20160816; b=YaYryfNvsLy0nGAWE5kd5nq+FDEt00PDdXUV7vDgC7aFTFZ1Zm7a2MOhjHlK5wOLHZ ajvnakVekjeze0N6txOE6DO3edlCjA8Q3BOiTXUKOjAez0aVaIJEZm6y2prmvTEGIJYC 7PFwsXS/8hw8oL8Yk6l71+6NxVJ5ehsNLALc8mo6b5MIUn9CZQUFtuuh3e0XaCLg9YFA oRbITahV2LcliQM2Dxq+YB0P97B5k57V1msJLSnJ96K/zsaOwsG/dkZjNn3LG4MAsU/p XyFuUPLvadkCuncSmAnE3pjLZlN/HYt9EadSWPpYTayzKh97iASM1X2d1p1N6XPglq5L pf1Q== 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=RXDKwkX877ohUSqwYyoL7i3nFDeUbfKF1MyNHDNk0+A=; b=qmGvrzNzSs02NirX3S+oW2MbtVe35+j5QMMQJ6d4MXIm+A1jBoEuqPJxs9aFYFVcC/ AdTzNxjhizG91EY2GKNgJAgClJ8UW0AU/v0ICRuZnlBCeRFGbhAdkMLeRbjV1YUT7BKP ukX/hu96Bwaj3KK+Lj7qWFGaVZSqhpEn6LOx+8sEaqyGBN2AYzeQCVQ80tYGv/5zSzIm Tny4Qx8ZxQJDHNgVcg5Sxds7JCwxWAwhjHqbMyLl0GmwjJrSPQ8tVRffgVLejK7+7lPo isuTckV+acbtAJ4yvCjN4ohKij4u4dNsXj6XS+mSsSf5TZHraSkvDvtMUBmZS3RjVLU/ ekyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=o5n8MywC; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dr4-20020a170907720400b00782393c36cfsi3255516ejc.336.2022.10.24.04.33.33; Mon, 24 Oct 2022 04:33:59 -0700 (PDT) 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=@linuxfoundation.org header.s=korg header.b=o5n8MywC; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230291AbiJXLcT (ORCPT <rfc822;pwkd43@gmail.com> + 99 others); Mon, 24 Oct 2022 07:32:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230318AbiJXLcK (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 24 Oct 2022 07:32:10 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8859B55C42; Mon, 24 Oct 2022 04:32:00 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 5CD3661257; Mon, 24 Oct 2022 11:31:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6DDFEC433D7; Mon, 24 Oct 2022 11:31:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666611118; bh=SsxXhBXuJAX9mARv/xwRDQb187Z+68sqr4yjhTCIe70=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o5n8MywCFViw8R0/7bkRg7NkfWJAUBVH8qcI0X9lsOtnCBNoPS2zFloxXhCEd51K7 fKvP0Hplrn9dUYxZiEUZ6Bwl9Vjroa5AFjYdDVMoVE6XukEkcLRkY/T9ke0+50+mWX ujgx0lRHDZQyi6FYvsD8O1QCG21MFXtZGBPxq2gs= From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, stable@vger.kernel.org, =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= <amadeuszx.slawinski@linux.intel.com>, Ard Biesheuvel <ardb@kernel.org> Subject: [PATCH 6.0 16/20] efi: ssdt: Dont free memory if ACPI table was loaded successfully Date: Mon, 24 Oct 2022 13:31:18 +0200 Message-Id: <20221024112935.061892355@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112934.415391158@linuxfoundation.org> References: <20221024112934.415391158@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747568546599032092?= X-GMAIL-MSGID: =?utf-8?q?1747568546599032092?= |
Series |
None
|
|
Commit Message
Greg KH
Oct. 24, 2022, 11:31 a.m. UTC
From: Ard Biesheuvel <ardb@kernel.org> commit 4b017e59f01097f19b938f6dc4dc2c4720701610 upstream. Amadeusz reports KASAN use-after-free errors introduced by commit 3881ee0b1edc ("efi: avoid efivars layer when loading SSDTs from variables"). The problem appears to be that the memory that holds the new ACPI table is now freed unconditionally, instead of only when the ACPI core reported a failure to load the table. So let's fix this, by omitting the kfree() on success. Cc: <stable@vger.kernel.org> # v6.0 Link: https://lore.kernel.org/all/a101a10a-4fbb-5fae-2e3c-76cf96ed8fbd@linux.intel.com/ Fixes: 3881ee0b1edc ("efi: avoid efivars layer when loading SSDTs from variables") Reported-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> --- drivers/firmware/efi/efi.c | 2 ++ 1 file changed, 2 insertions(+)
--- a/drivers/firmware/efi/efi.c +++ b/drivers/firmware/efi/efi.c @@ -269,6 +269,8 @@ static __init int efivar_ssdt_load(void) acpi_status ret = acpi_load_table(data, NULL); if (ret) pr_err("failed to load table: %u\n", ret); + else + continue; } else { pr_err("failed to get var data: 0x%lx\n", status); }