Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 24A3F6EB59 for ; Wed, 17 Apr 2024 10:30:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713349836; cv=none; b=QCmqeXUjQ+/uFtyY9GlEY/964o5KcWZPLKaDsntXWEebQ+yYpxhCSNiGqCFzRH6WVUcbalzjw6bVAD/sO+VjcKwPMjo6kfOekJoIOKCDtA0lrUjiUYwgA2aKPB0MsGbq2mNHlpmeg4i+ltF2HeQSvnFT0dyFbd2+rluGPFt4uHw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713349836; c=relaxed/simple; bh=+tqe9A5U/jvD56TJZ2VK6GJwhl+9w82WaO6E8kw/W/s=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=NIZUI2tRhz9stpkScBHkLyQdaeJJfpQAAwyv70yJ1zG1qLTLSeDi1qmc991fzx7DaeZKdRdg+fmLgmpHypZOJCC7UG0Xi1QyVr3MWJ2NjhwXu1cJS6bH0r1J1Z7yNGPwylSf9SzsodObDSXDmYWhOz3xx68GqKTktmFe+5W8uH4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=v7IZGX4J; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="v7IZGX4J" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 450E3C072AA; Wed, 17 Apr 2024 10:30:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1713349835; bh=+tqe9A5U/jvD56TJZ2VK6GJwhl+9w82WaO6E8kw/W/s=; h=From:To:Cc:Subject:Date:Reply-to:From; b=v7IZGX4JbMhDvixDmPbszmUowmuG7OzrELdNRHfekuZVYTGo4mk7vjw5fKUSxqvhO 1osQDgUUcvDQ4OdiUpaN0DIfmLN82OKNpmLeRFG1wkpXVJkTT3kvKmE5ZNJZwAXNDJ XxSeZIzyR1TCKm5aTwpe9Gks/RwH16+G6B3nTA0I= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-26899: block: fix deadlock between bd_link_disk_holder and partition scan Date: Wed, 17 Apr 2024 12:29:14 +0200 Message-ID: <2024041745-CVE-2024-26899-3f41@gregkh> X-Mailer: git-send-email 2.44.0 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=2855; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=+tqe9A5U/jvD56TJZ2VK6GJwhl+9w82WaO6E8kw/W/s=; b=owGbwMvMwCRo6H6F97bub03G02pJDGnyS2LXTwlStjnfsf7P5Kgq4xbDoGqJY3Kf7t2W3592q u++3PafHbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjCR5kcMCyacWzE56A6L/9qg 1pWvgrdcZd8jo88wz2K/i8bqp0E7T+/zPXvMdGZT1YXGZgA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: block: fix deadlock between bd_link_disk_holder and partition scan 'open_mutex' of gendisk is used to protect open/close block devices. But in bd_link_disk_holder(), it is used to protect the creation of symlink between holding disk and slave bdev, which introduces some issues. When bd_link_disk_holder() is called, the driver is usually in the process of initialization/modification and may suspend submitting io. At this time, any io hold 'open_mutex', such as scanning partitions, can cause deadlocks. For example, in raid: T1 T2 bdev_open_by_dev lock open_mutex [1] ... efi_partition ... md_submit_bio md_ioctl mddev_syspend -> suspend all io md_add_new_disk bind_rdev_to_array bd_link_disk_holder try lock open_mutex [2] md_handle_request -> wait mddev_resume T1 scan partition, T2 add a new device to raid. T1 waits for T2 to resume mddev, but T2 waits for open_mutex held by T1. Deadlock occurs. Fix it by introducing a local mutex 'blk_holder_mutex' to replace 'open_mutex'. The Linux kernel CVE team has assigned CVE-2024-26899 to this issue. Affected and fixed versions =========================== Issue introduced in 6.7 with commit 1b0a2d950ee2 and fixed in 6.7.11 with commit 1e5c5b0abaee Issue introduced in 6.7 with commit 1b0a2d950ee2 and fixed in 6.8.2 with commit 5a87c1f7993b Issue introduced in 6.7 with commit 1b0a2d950ee2 and fixed in 6.9-rc1 with commit 03f12122b20b 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-26899 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: block/holder.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/1e5c5b0abaee7b62a10b9707a62083b71ad21f62 https://git.kernel.org/stable/c/5a87c1f7993bc8ac358a3766bac5dc7126e01e98 https://git.kernel.org/stable/c/03f12122b20b6e6028e9ed69030a49f9cffcbb75