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 35C73153518 for ; Wed, 3 Apr 2024 17:33:57 +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=1712165637; cv=none; b=rtperVobt0z7SQhh8NWzW5rR6oTo3IBFArarBkpfe+LjDYc8jlfKoD2CxKQ22JJJd+nRS9vPnpuiGCeuGGQOLhWTrvP5b5ACCiMWMS94ydbZcWNId0GYoVE6GRcEuL3I83/vm47aDuDk0YY5tLwGzNWxnEj8GFP1bzM6ivD3+M4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712165637; c=relaxed/simple; bh=QTem4Lb9s38RUXJrZaTHnRS1hVo/7eXLppImqag6jN0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=t/gizAVuYEw/JJnnXPeBK7/J+BDCPoFNW6ssa94KXLtLHFLWyDR+XYS+LvTyHDnygzld/MclcUu0KHEuq/RVwUfbmX/GRYYJwHQ0w/fHmR5k85TEpMfejGKp83fnpYAL23mJ9aQCX9sApoN390oNVV2Fp1ZTrw+8B//3I3ZNzTE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=v31sHaY8; 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="v31sHaY8" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AE708C433F1; Wed, 3 Apr 2024 17:33:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1712165637; bh=QTem4Lb9s38RUXJrZaTHnRS1hVo/7eXLppImqag6jN0=; h=From:To:Cc:Subject:Date:Reply-to:From; b=v31sHaY84xiK9yz0SXoiMFrNVHO/hSX+jwc8bAff6rgbWvK+2Usdx+eMQTJ6im9P2 2Xh4VmN1GIpMGZkWHPCbQMqtmUNQ7krFPRjJRzhvR5QjNnvhmCaBkayRY/fliqX5NS jumCT74tc2RcaM02j9xihhv+T0ZYqWxKbZlxCI3Y= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-26758: md: Don't ignore suspended array in md_check_recovery() Date: Wed, 3 Apr 2024 19:31:25 +0200 Message-ID: <2024040304-CVE-2024-26758-dcc3@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=2832; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=QTem4Lb9s38RUXJrZaTHnRS1hVo/7eXLppImqag6jN0=; b=owGbwMvMwCRo6H6F97bub03G02pJDGm8kyICngoVR7FMP3NIbMNT1tsreXQ/r5+wKEDYRc+zK Oji9eN3O2JZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAiHr8Z5uesn9m1a/eEGN2l 7WmGfFO64vOtnRgWXPxjuEBq8evJvMf4zu9/tv++XNaOJwA= 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: md: Don't ignore suspended array in md_check_recovery() mddev_suspend() never stop sync_thread, hence it doesn't make sense to ignore suspended array in md_check_recovery(), which might cause sync_thread can't be unregistered. After commit f52f5c71f3d4 ("md: fix stopping sync thread"), following hang can be triggered by test shell/integrity-caching.sh: 1) suspend the array: raid_postsuspend mddev_suspend 2) stop the array: raid_dtr md_stop __md_stop_writes stop_sync_thread set_bit(MD_RECOVERY_INTR, &mddev->recovery); md_wakeup_thread_directly(mddev->sync_thread); wait_event(..., !test_bit(MD_RECOVERY_RUNNING, &mddev->recovery)) 3) sync thread done: md_do_sync set_bit(MD_RECOVERY_DONE, &mddev->recovery); md_wakeup_thread(mddev->thread); 4) daemon thread can't unregister sync thread: md_check_recovery if (mddev->suspended) return; -> return directly md_read_sync_thread clear_bit(MD_RECOVERY_RUNNING, &mddev->recovery); -> MD_RECOVERY_RUNNING can't be cleared, hence step 2 hang; This problem is not just related to dm-raid, fix it by ignoring suspended array in md_check_recovery(). And follow up patches will improve dm-raid better to frozen sync thread during suspend. The Linux kernel CVE team has assigned CVE-2024-26758 to this issue. Affected and fixed versions =========================== Issue introduced in 3.0 with commit 68866e425be2 and fixed in 6.7.7 with commit a55f0d6179a1 Issue introduced in 3.0 with commit 68866e425be2 and fixed in 6.8 with commit 1baae052cccd 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-26758 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/md/md.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/a55f0d6179a19c6b982e2dc344d58c98647a3be0 https://git.kernel.org/stable/c/1baae052cccd08daf9a9d64c3f959d8cdb689757