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 42759152DFF for ; Wed, 3 Apr 2024 17:33:50 +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=1712165631; cv=none; b=IeW26USexZlNzKUDzK5oIX7W3xBKats2SRspvIgsBusx+VlNYmIplYYPR59Viza2xQLmsJkPhQtgR3WbAfjISoINJp/3+wM9Hp9hVQ/j5ZxokFvaVEOHxN7xaNclui/EeZ0G48+UwchOqQT+kFrU2+OR9nk0PUW5KB+tlC208FA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712165631; c=relaxed/simple; bh=UFh24MHhotrF7JXNXXQFEm4xESOlqpFRdQmCclx8LOA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=S8cCw91Dkks4ocRJSHe594Oo/yqWPybAr463DY4jLqnFeKKhNrscZc8r93uw1e6T1WdWaHKoHrhSG7Fl8dwBXcQSO9m+ZZdV25SNaFc3QBOg/qa8HFrKui3gM2B0zgQmZ4zPK1vBrT5OVdCxkrStSEaeKTaKEo6x+n1i3g2shnI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=yVcO8+5n; 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="yVcO8+5n" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4F201C43399; Wed, 3 Apr 2024 17:33:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1712165630; bh=UFh24MHhotrF7JXNXXQFEm4xESOlqpFRdQmCclx8LOA=; h=From:To:Cc:Subject:Date:Reply-to:From; b=yVcO8+5nEvmzAfE7e9n6qjtSSHyqk+ZgYw4iX7rP72VKbVF2g1A2feU2UmQBYGCC4 5nzm7B9PD942hrgIDBTxncGV7k3cJhln+Sr3mnjtGP9ohQce1FS9P8ykbcNUvm36Fg Kr6eieDtDwAK/HHxsyGQOXJv/N8xb/+cEoPe7/WI= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-26756: md: Don't register sync_thread for reshape directly Date: Wed, 3 Apr 2024 19:31:23 +0200 Message-ID: <2024040303-CVE-2024-26756-135f@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=3019; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=UFh24MHhotrF7JXNXXQFEm4xESOlqpFRdQmCclx8LOA=; b=owGbwMvMwCRo6H6F97bub03G02pJDGm8kyK2H9lYIlj/1Gn6GqEi73suK3cfnvDBrmxnQ9/qm z8lDP9c6ohlYRBkYpAVU2T5so3n6P6KQ4pehranYeawMoEMYeDiFICJhBYzzNN2b5n9qCrDQjOs pyF1h02+lqSMNMP84tPfvA79W3qxunYxx4M979Zo3i+eAwA= 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 register sync_thread for reshape directly Currently, if reshape is interrupted, then reassemble the array will register sync_thread directly from pers->run(), in this case 'MD_RECOVERY_RUNNING' is set directly, however, there is no guarantee that md_do_sync() will be executed, hence stop_sync_thread() will hang because 'MD_RECOVERY_RUNNING' can't be cleared. Last patch make sure that md_do_sync() will set MD_RECOVERY_DONE, however, following hang can still be triggered by dm-raid test shell/lvconvert-raid-reshape.sh occasionally: [root@fedora ~]# cat /proc/1982/stack [<0>] stop_sync_thread+0x1ab/0x270 [md_mod] [<0>] md_frozen_sync_thread+0x5c/0xa0 [md_mod] [<0>] raid_presuspend+0x1e/0x70 [dm_raid] [<0>] dm_table_presuspend_targets+0x40/0xb0 [dm_mod] [<0>] __dm_destroy+0x2a5/0x310 [dm_mod] [<0>] dm_destroy+0x16/0x30 [dm_mod] [<0>] dev_remove+0x165/0x290 [dm_mod] [<0>] ctl_ioctl+0x4bb/0x7b0 [dm_mod] [<0>] dm_ctl_ioctl+0x11/0x20 [dm_mod] [<0>] vfs_ioctl+0x21/0x60 [<0>] __x64_sys_ioctl+0xb9/0xe0 [<0>] do_syscall_64+0xc6/0x230 [<0>] entry_SYSCALL_64_after_hwframe+0x6c/0x74 Meanwhile mddev->recovery is: MD_RECOVERY_RUNNING | MD_RECOVERY_INTR | MD_RECOVERY_RESHAPE | MD_RECOVERY_FROZEN Fix this problem by remove the code to register sync_thread directly from raid10 and raid5. And let md_check_recovery() to register sync_thread. The Linux kernel CVE team has assigned CVE-2024-26756 to this issue. Affected and fixed versions =========================== Issue introduced in 2.6.17 with commit f67055780caa and fixed in 6.7.7 with commit 13b520fb62b7 Issue introduced in 2.6.17 with commit f67055780caa and fixed in 6.8 with commit ad39c08186f8 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-26756 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 drivers/md/raid10.c drivers/md/raid5.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/13b520fb62b772e408f9b79c5fe18ad414e90417 https://git.kernel.org/stable/c/ad39c08186f8a0f221337985036ba86731d6aafe