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 AE9B9156230 for ; Wed, 16 Apr 2025 14:18:43 +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=1744813123; cv=none; b=GsBlSe0oaAwFKSYB953rxlY0U1WwqzZOXeIXLwT3oZpYgsamoIvyiUzsB9FXJVvuabMuqDHm9w8w0jkU0xCT0TLELxTfEyOJt2zOK4JcR0HGiACVELMd18G0BQYesStjHFiV2Ehrj9IaS0K/3Vog9Forw+9EwrVdKGzwyZfw9F8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744813123; c=relaxed/simple; bh=vwbw8OtkFBGy2ujL6d8dVdo7/eeYhFfAxO4aKBM9m5Y=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=IvfDsAQV9lgqJfxL10CYXWGsMdDNrixOS14K0f5fpUPtR0MOzHbfcfrpCzROWHuAZCqRTqMlBYXfEJbXgN+5vR4UqWMoIJLmX/2SDeMkpTMCtlr25DWneObs9hmavjYY2MZGLwvjC72qZhLzJ18UdXzyjGXwWP7Zn/gY7cY6v74= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=T9WpjHke; 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="T9WpjHke" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 140A9C4CEE2; Wed, 16 Apr 2025 14:18:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1744813123; bh=vwbw8OtkFBGy2ujL6d8dVdo7/eeYhFfAxO4aKBM9m5Y=; h=From:To:Cc:Subject:Date:Reply-to:From; b=T9WpjHkedo5iisEIRFgpyOjUlwAHBE1bCWqX/WgdSONYQHzoiUrEyF5C3TvfNIk7p Cjg2j1Vt4a+Xf/3ryGXsG0M0IWI5Ly5475ksqnP0N2hC4D0HvZvBWL0ZZcQLf5MZBo 4O7bbVnWpt7X3dycjwdols8aCxlnOc9++42Ou19g= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-22124: md/md-bitmap: fix wrong bitmap_limit for clustermd when write sb Date: Wed, 16 Apr 2025 16:13:35 +0200 Message-ID: <2025041629-CVE-2025-22124-4561@gregkh> X-Mailer: git-send-email 2.49.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=2871; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=vwbw8OtkFBGy2ujL6d8dVdo7/eeYhFfAxO4aKBM9m5Y=; b=owGbwMvMwCRo6H6F97bub03G02pJDOn/d52dOWtl6yOHXXst/xWzOn+0eHFK7X+Z+/QChvXlU 62XiPSzd8SyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBEDOYyzK++f0J8y08nZZU/ s1/M32Nd/Xp3SBzDgotXXSU2PbJ9UBNscENkmt4PE+eblwA= 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/md-bitmap: fix wrong bitmap_limit for clustermd when write sb In clustermd, separate write-intent-bitmaps are used for each cluster node: 0 4k 8k 12k ------------------------------------------------------------------- | idle | md super | bm super [0] + bits | | bm bits[0, contd] | bm super[1] + bits | bm bits[1, contd] | | bm super[2] + bits | bm bits [2, contd] | bm super[3] + bits | | bm bits [3, contd] | | | So in node 1, pg_index in __write_sb_page() could equal to bitmap->storage.file_pages. Then bitmap_limit will be calculated to 0. md_super_write() will be called with 0 size. That means the first 4k sb area of node 1 will never be updated through filemap_write_page(). This bug causes hang of mdadm/clustermd_tests/01r1_Grow_resize. Here use (pg_index % bitmap->storage.file_pages) to make calculation of bitmap_limit correct. The Linux kernel CVE team has assigned CVE-2025-22124 to this issue. Affected and fixed versions =========================== Issue introduced in 6.11 with commit ab99a87542f194f28e2364a42afbf9fb48b1c724 and fixed in 6.14.2 with commit bc3a9788961631359527763d7e1fcf26554c7cb1 Issue introduced in 6.11 with commit ab99a87542f194f28e2364a42afbf9fb48b1c724 and fixed in 6.15-rc1 with commit 6130825f34d41718c98a9b1504a79a23e379701e Issue introduced in 6.6.44 with commit 655cc01889fa9b65441922565cddee64af49e6d6 Issue introduced in 6.10.3 with commit 5600d6013c634c2b6b6c6c55c8ecb50c3a6211f2 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-2025-22124 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-bitmap.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/bc3a9788961631359527763d7e1fcf26554c7cb1 https://git.kernel.org/stable/c/6130825f34d41718c98a9b1504a79a23e379701e