Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp854085lqp; Thu, 23 May 2024 01:50:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXsDU15yG8c/zJ4vE3+bg3flu+aYUg8zRLx+jXYQ855fUwqkHFI9beomiftPpwKb4bxWWV4oFCZPQeGNW+w9kPflxh4FDTDDXeTwsqzIA== X-Google-Smtp-Source: AGHT+IHhORmA5oWFp5KrKnh/ebbIV5hg/vEpsvXxzKgUsNe8QLQXS9VQKgjx1BT7uxZ3SEIlb9YJ X-Received: by 2002:a50:d509:0:b0:572:6af5:1b61 with SMTP id 4fb4d7f45d1cf-57832a02739mr3529490a12.6.1716454258081; Thu, 23 May 2024 01:50:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716454258; cv=pass; d=google.com; s=arc-20160816; b=GFNZyKizo9qTc7gTI8vlrfFOgjrccmMOiCNVjdUkKVGpEZSDGvpcE6wHFDWXfAzbk4 dwTwIElhoHW6SGzWsZWiou0avobPOSS6f3hmCtjoKFhPl+j1iAf8g94fRt2e/Op0zVeT i4tXqLsHXGPw8pKG+4fNTxfwuHuQtxNIXjczdejeiGEZOlU0i13aktEVvQpmMaTfBGTu EtvB5B9jfRvGc0thc5ptrJbfQJ6R/upkiqLhPYInQ04MxQBvAlxBEoyfUrwrNdgzc9UQ BxdTdbFktG6GkaVHXy4L+zE8V1wTDLW3PiAFSmsprqmIPnDQ7lWeKy210W3MnsnBj6+7 RT7Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:date:message-id; bh=GBV64yhlY/7SFFQbhhCSgx+ep2bVWV7jsi1CUhx2JkQ=; fh=+zRBdMjlE/EYq1XuL6MwtrP0mTcfeAT4A31uAVwd1lI=; b=Cit4sTIK2jUn7CmPJfO3Gesiy+MoTmDqgCb1hLd5GpF/KHHXAZtCYFUmBTzgKv8gfi kRJHjlmfC54FBgfSJxoD1dC74PfY/R9KSnox2VYikQxXjrmZ6x5G3SvhKXE6kYmx16z1 EK+ttoCAY//nIPLtSvFKkvf4k0ouZKJzC4M6TWFEZnayBTzg7O56/VHNB4oMAskZpnH7 /jZVTCkOysnbk9zisUttNZ9TiaRcoIj+ZVHKv6gQVk/2YwEXFAxvMqPaUeY2CpFH1i7d vMHK7WDKFHiTCRtFrGGxlBRCoVeY7rEHgZl+WmKJ4OsXC8wB+ikzMcjxgN8G+4/j/oqZ dnPA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-187207-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187207-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-574ebfa52b7si10038092a12.362.2024.05.23.01.50.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 01:50:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-187207-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-187207-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187207-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id A3E641F25403 for ; Thu, 23 May 2024 08:50:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D061513C9DC; Thu, 23 May 2024 08:50:51 +0000 (UTC) Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E8D6646AF; Thu, 23 May 2024 08:50:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.255 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716454251; cv=none; b=CeVlGXdoQ0YqYsR/HqHu7cvLhUvVbU8bdsDlvGktJP/czlCyBvnjsmFhxctyLzFRHnXZ7lrb9J6tsyTuVsNzagR6xkSoEe6X/PKXvNuceA0OTghyBmLon0twCxOy1CVgPeCM53lI7V/Hkvlp0gL77zxbuptnCIzTIjNQDmwPfbw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716454251; c=relaxed/simple; bh=o6mR2MAS1+lUicCl6cB9aVJ9GHBKQb9Xgj8ZjykgBNU=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=Do80Yy+1JKbgGuUHcO1OyibezI1P8B/SMlW4vayaqmDkUVZCqcohN+V9BdIuGIbpJCUnc04OtRUvpDT17ywQswKJaG5go0cg6L/K2YNSnjNHD/meTJbiJ7Eu4PbJR6Aw1EQp/+DHF0xCPQKBPzSYeLVTShyDkixxYBMDjFMBEzk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.255 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.174]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4VlMH764r1z1S7Yv; Thu, 23 May 2024 16:46:59 +0800 (CST) Received: from canpemm500006.china.huawei.com (unknown [7.192.105.130]) by mail.maildlp.com (Postfix) with ESMTPS id 2362B14038F; Thu, 23 May 2024 16:50:39 +0800 (CST) Received: from [10.67.109.61] (10.67.109.61) by canpemm500006.china.huawei.com (7.192.105.130) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Thu, 23 May 2024 16:50:38 +0800 Message-ID: Date: Thu, 23 May 2024 16:50:18 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: CVE-2024-26650: platform/x86: p2sb: Allow p2sb_bar() calls during PCI device probe To: Michal Hocko CC: , Lee Jones , , , References: <20240326175007.1388794-18-lee@kernel.org> From: zhengzucheng In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To canpemm500006.china.huawei.com (7.192.105.130) 在 2024/5/22 3:31, Michal Hocko 写道: > This patch has been reverted in upstream by 03c6284df179 ("Revert > "drm/amd/amdgpu: Fix potential ioremap() memory leaks in > amdgpu_device_init()"") and based on the changelog the CVE should be > rejected. hi Michal Hocko This reverted patch was previously used to resolve CVE-2024-35928 ? so CVE-2024-35928 should be rejected? commit 03c6284df179de3a4a6e0684764b1c71d2a405e2 Author: Ma Jun Date:   Tue Mar 19 15:24:03 2024 +0800     Revert "drm/amd/amdgpu: Fix potential ioremap() memory leaks in amdgpu_device_init()"     This patch causes the following iounmap erorr and calltrace     iounmap: bad address 00000000d0b3631f     The original patch was unjustified because amdgpu_device_fini_sw() will     always cleanup the rmmio mapping.     This reverts commit eb4f139888f636614dab3bcce97ff61cefc4b3a7.     Signed-off-by: Ma Jun     Suggested-by: Christian König     Reviewed-by: Christian König     Signed-off-by: Alex Deucher > On Tue 26-03-24 17:50:16, Lee Jones wrote: >> Description >> =========== >> >> In the Linux kernel, the following vulnerability has been resolved: >> >> platform/x86: p2sb: Allow p2sb_bar() calls during PCI device probe >> >> p2sb_bar() unhides P2SB device to get resources from the device. It >> guards the operation by locking pci_rescan_remove_lock so that parallel >> rescans do not find the P2SB device. However, this lock causes deadlock >> when PCI bus rescan is triggered by /sys/bus/pci/rescan. The rescan >> locks pci_rescan_remove_lock and probes PCI devices. When PCI devices >> call p2sb_bar() during probe, it locks pci_rescan_remove_lock again. >> Hence the deadlock. >> >> To avoid the deadlock, do not lock pci_rescan_remove_lock in p2sb_bar(). >> Instead, do the lock at fs_initcall. Introduce p2sb_cache_resources() >> for fs_initcall which gets and caches the P2SB resources. At p2sb_bar(), >> refer the cache and return to the caller. >> >> Before operating the device at P2SB DEVFN for resource cache, check >> that its device class is PCI_CLASS_MEMORY_OTHER 0x0580 that PCH >> specifications define. This avoids unexpected operation to other devices >> at the same DEVFN. >> >> Tested-by Klara Modin >> >> The Linux kernel CVE team has assigned CVE-2024-26650 to this issue. >> >> >> Affected and fixed versions >> =========================== >> >> Issue introduced in 6.0 with commit 9745fb07474f and fixed in 6.1.76 with commit 2841631a0365 >> Issue introduced in 6.0 with commit 9745fb07474f and fixed in 6.6.15 with commit 847e1eb30e26 >> Issue introduced in 6.0 with commit 9745fb07474f and fixed in 6.7.3 with commit d281ac9a987c >> Issue introduced in 6.0 with commit 9745fb07474f and fixed in 6.8 with commit 5913320eb0b3 >> >> Please see https://www.kernel.org for a full list of currently supported >> kernel versions by the kernel community. >> >> Unaffected versions might change over time as fixes are backported to >> older supported kernel versions. The official CVE entry at >> https://cve.org/CVERecord/?id=CVE-2024-26650 >> will be updated if fixes are backported, please check that for the most >> up to date information about this issue. >> >> >> Affected files >> ============== >> >> The file(s) affected by this issue are: >> drivers/platform/x86/p2sb.c >> >> >> Mitigation >> ========== >> >> The Linux kernel CVE team recommends that you update to the latest >> stable kernel version for this, and many other bugfixes. Individual >> changes are never tested alone, but rather are part of a larger kernel >> release. Cherry-picking individual commits is not recommended or >> supported by the Linux kernel community at all. If however, updating to >> the latest release is impossible, the individual changes to resolve this >> issue can be found at these commits: >> https://git.kernel.org/stable/c/2841631a03652f32b595c563695d0461072e0de4 >> https://git.kernel.org/stable/c/847e1eb30e269a094da046c08273abe3f3361cf2 >> https://git.kernel.org/stable/c/d281ac9a987c553d93211b90fd4fe97d8eca32cd >> https://git.kernel.org/stable/c/5913320eb0b3ec88158cfcb0fa5e996bf4ef681b