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 C780A10A1E for ; Tue, 9 Dec 2025 00:03:38 +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=1765238618; cv=none; b=fZUlgQt36ltBvumzyHNF3YlFPYp18rEqliXDWLu04b+q5dE7345dyRqYuC5/jmc386JGLZj3fCnJlz9KX4rNjidroxpbXUlNYF+tA4SH8yWzaYK8VqNjYHwh9PHYErRb2LUCaTvKQ/pAKRtIrEGBtn9DpAkLrdY1V0IyDZBspL8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765238618; c=relaxed/simple; bh=SeRcDuQUE8iEb3jn+A7I6wKLXFQ1Mwq3XIA/hE4/C04=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=HrP1zS5M4wHcaflcacKLO1/WtRK4kjS2fhuvqemlKRA7Qk8kOt+n1pgxpsmBZBexR8fZMhqQVZO4fijc0p0SXIiml1iNPSlOCcLG66QD1xlX8rcuN6qg+Te4JI4mnjHA5z5ZiHpDewdL7CJX9od/iGs56OmhvYNUoIDngMkQnuk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=K3DAa46W; 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="K3DAa46W" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 666B2C4CEF1; Tue, 9 Dec 2025 00:03:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1765238618; bh=SeRcDuQUE8iEb3jn+A7I6wKLXFQ1Mwq3XIA/hE4/C04=; h=From:To:Cc:Subject:Date:Reply-To:From; b=K3DAa46WHc2ERZ0Z28AVPD63C+30DFnr4EMUqSps1I8SXbcWsPd+Hrfj4BAdAXExg pLCkklTx7gbnRAuPJBYCXVEM5YZp8o+8zSM5327vwqLsy+DGGGVZQvkVr8p+6/K3H0 nU6ubQ/i/ztHt8f1ZNvlXyJ/ZZgqMj/wzlPC27Uc= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-53791: md: fix warning for holder mismatch from export_rdev() Date: Tue, 9 Dec 2025 09:02:12 +0900 Message-ID: <2025120941-CVE-2023-53791-a2ea@gregkh> X-Mailer: git-send-email 2.52.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3616; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=0+cerwBLPC7k18g9kLvlfLZRpLxrp64wloNWhUG+R0I=; b=owGbwMvMwCRo6H6F97bub03G02pJDJnmaU//uAZrvpe2cv3UFbhJlYVr1ZWD7brddTLzvfeof Vy142lzRywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAEwkvJ9hwaFrHPe9Fpof+DDX No5hO2dtLVNLEcP8WDGV7wy75VIO1978ffzng3fhpfuXAAA= 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: fix warning for holder mismatch from export_rdev() Commit a1d767191096 ("md: use mddev->external to select holder in export_rdev()") fix the problem that 'claim_rdev' is used for blkdev_get_by_dev() while 'rdev' is used for blkdev_put(). However, if mddev->external is changed from 0 to 1, then 'rdev' is used for blkdev_get_by_dev() while 'claim_rdev' is used for blkdev_put(). And this problem can be reporduced reliably by following: New file: mdadm/tests/23rdev-lifetime devname=${dev0##*/} devt=`cat /sys/block/$devname/dev` pid="" runtime=2 clean_up_test() { pill -9 $pid echo clear > /sys/block/md0/md/array_state } trap 'clean_up_test' EXIT add_by_sysfs() { while true; do echo $devt > /sys/block/md0/md/new_dev done } remove_by_sysfs(){ while true; do echo remove > /sys/block/md0/md/dev-${devname}/state done } echo md0 > /sys/module/md_mod/parameters/new_array || die "create md0 failed" add_by_sysfs & pid="$pid $!" remove_by_sysfs & pid="$pid $!" sleep $runtime exit 0 Test cmd: ./test --save-logs --logdir=/tmp/ --keep-going --dev=loop --tests=23rdev-lifetime Test result: ------------[ cut here ]------------ WARNING: CPU: 0 PID: 960 at block/bdev.c:618 blkdev_put+0x27c/0x330 Modules linked in: multipath md_mod loop CPU: 0 PID: 960 Comm: test Not tainted 6.5.0-rc2-00121-g01e55c376936-dirty #50 RIP: 0010:blkdev_put+0x27c/0x330 Call Trace: export_rdev.isra.23+0x50/0xa0 [md_mod] mddev_unlock+0x19d/0x300 [md_mod] rdev_attr_store+0xec/0x190 [md_mod] sysfs_kf_write+0x52/0x70 kernfs_fop_write_iter+0x19a/0x2a0 vfs_write+0x3b5/0x770 ksys_write+0x74/0x150 __x64_sys_write+0x22/0x30 do_syscall_64+0x40/0x90 entry_SYSCALL_64_after_hwframe+0x63/0xcd Fix the problem by recording if 'rdev' is used as holder. The Linux kernel CVE team has assigned CVE-2023-53791 to this issue. Affected and fixed versions =========================== Issue introduced in 6.5 with commit a1d7671910965ca9f8f0377e7e3bfd1179fba4d8 and fixed in 6.5.5 with commit 99fcd427178d0f58f5520f8f01df727f8eaeb2c7 Issue introduced in 6.5 with commit a1d7671910965ca9f8f0377e7e3bfd1179fba4d8 and fixed in 6.6 with commit 99892147f028d711f9d40fefad4f33632593864c 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-2023-53791 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/md.h 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/99fcd427178d0f58f5520f8f01df727f8eaeb2c7 https://git.kernel.org/stable/c/99892147f028d711f9d40fefad4f33632593864c