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 D06CD2153FB for ; Fri, 22 Aug 2025 16:01:42 +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=1755878502; cv=none; b=C7ziznJvLiuPiao0dGRogjAnTiEcVVI96/Bbklqgv26AwXza13OtRmw3eiFWYYWKXFCF6S9/W9W4jSzJsHljLr5mgQy++LvKY2Ekm3sQgZZ8AQh3S6znD49l6P39DvJe1u8dFtOJHw+KB/vkv0/hJ1dEpjBHzQR6ss9Zpww8uF8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755878502; c=relaxed/simple; bh=WXbjzfCT5dGDYbdbY7Er335xUtFkTalMkj6elgtViBw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=kt05awyuMWoa1QHFB7p36IXF5LHDr7YgMZq2SkkltoyOcXQeYBL18/smYjtwofkXpb2sCjufaErkt6gfiyfQV7mze+sR+JhA7phD0+ft0vW3dOPNdcvMnT1UyvBDJBN07dcvPEdlFQ44mG2qKAwYnwb3TPisZgRUKDaP1v5/qDY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=BlvhxAtZ; 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="BlvhxAtZ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3E012C4CEED; Fri, 22 Aug 2025 16:01:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1755878502; bh=WXbjzfCT5dGDYbdbY7Er335xUtFkTalMkj6elgtViBw=; h=From:To:Cc:Subject:Date:Reply-to:From; b=BlvhxAtZMJdRtWDyrifRqkS51DLT6OayOG1RcQeV1ynmDjF8+MRP40J3fb66r+ook 8swFq01p3iE9IWS4epYaTeRbiUwjHzaln+y1Wv0BOCZrWXTkookMtRenZ7NbrXOLia Fc+mi7grYYyK+j3FeNJL4Tzqrl+mGmjFBX0Ywtuw= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-38621: md: make rdev_addable usable for rcu mode Date: Fri, 22 Aug 2025 18:00:30 +0200 Message-ID: <2025082229-CVE-2025-38621-763f@gregkh> X-Mailer: git-send-email 2.50.1 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=2776; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=ize/dDGRW4T/z3t6n/9Ayb+sn1IC9slDBZ+Q9Nhj1lw=; b=owGbwMvMwCRo6H6F97bub03G02pJDBkrpsje3WJ2wyuldZ+BR+P8q7VGEh27BR+snR11Y56jV Y5NRcesjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZjIvDaGOZxRHtaMTwM77prP jXow7fWtx/uj5jPMU2kR3/ncRmXCtKsR5gdFlQ0UT7xkBQA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: md: make rdev_addable usable for rcu mode Our testcase trigger panic: BUG: kernel NULL pointer dereference, address: 00000000000000e0 ... Oops: Oops: 0000 [#1] SMP NOPTI CPU: 2 UID: 0 PID: 85 Comm: kworker/2:1 Not tainted 6.16.0+ #94 PREEMPT(none) Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.1-2.fc37 04/01/2014 Workqueue: md_misc md_start_sync RIP: 0010:rdev_addable+0x4d/0xf0 ... Call Trace: md_start_sync+0x329/0x480 process_one_work+0x226/0x6d0 worker_thread+0x19e/0x340 kthread+0x10f/0x250 ret_from_fork+0x14d/0x180 ret_from_fork_asm+0x1a/0x30 Modules linked in: raid10 CR2: 00000000000000e0 ---[ end trace 0000000000000000 ]--- RIP: 0010:rdev_addable+0x4d/0xf0 md_spares_need_change in md_start_sync will call rdev_addable which protected by rcu_read_lock/rcu_read_unlock. This rcu context will help protect rdev won't be released, but rdev->mddev will be set to NULL before we call synchronize_rcu in md_kick_rdev_from_array. Fix this by using READ_ONCE and check does rdev->mddev still alive. The Linux kernel CVE team has assigned CVE-2025-38621 to this issue. Affected and fixed versions =========================== Issue introduced in 6.7 with commit bc08041b32abe6c9824f78735bac22018eabfc06 and fixed in 6.16.1 with commit b5fbe940862339cdcc34dea7a057ad18d18fa137 Issue introduced in 6.7 with commit bc08041b32abe6c9824f78735bac22018eabfc06 and fixed in 6.17-rc1 with commit 13017b427118f4311471ee47df74872372ca8482 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-38621 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/b5fbe940862339cdcc34dea7a057ad18d18fa137 https://git.kernel.org/stable/c/13017b427118f4311471ee47df74872372ca8482