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 8037D1A3178 for ; Mon, 8 Dec 2025 01:12:28 +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=1765156348; cv=none; b=tXrT0FvIW66nv6A9XIYh4ZCm2fcClgROh8XTFRZ5ysbuAxZYhJrZzJYeStZtZ9HpzdSvUf2T9cYhC3LqhW/oMTX4f5ij3N4DPh/ZPUNs62R+CpzPT0dQPirn6Wou0WirBMsye9Aghq5DVURH+KpcXS+ZSqbjbTDWUKTMfvemKto= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765156348; c=relaxed/simple; bh=MEZ9WKGyzSUxpPf4vIuGRL88UauxEvPw09oJkhpSMlM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=RkGRPzG0xh/kc+p4aR7fo/25Iwxf6LpkHwW56vR3m/CkMZgOksh4g0YCq4YfLzxJ7enad0Sz3PQbWdRENu150sOdKbqRrdL0DiTXnfvwKoT4gHmKIE6Sl5VtScWwOm33CLyyiDNV72LPXrOyIL7KlRoLWk1vwdgyok44rkAte6Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=KzJ4cNCj; 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="KzJ4cNCj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5A328C4CEFB; Mon, 8 Dec 2025 01:12:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1765156348; bh=MEZ9WKGyzSUxpPf4vIuGRL88UauxEvPw09oJkhpSMlM=; h=From:To:Cc:Subject:Date:Reply-To:From; b=KzJ4cNCjYWbIpLvtlB7YbUB7WbeUqiLGop8/JNTqu8g/NOBgJ/SBvYyEL6grD1jbw KRvrasgbAGGXH8y+eVUlRUKA8aB++E15v/lMRPLmSXVlB/zFoScyAdjX1Tvk0lWvZh JJhk5ZPTwI9nGtRjCyx/78Kf50ouKnV/+DRe1JTk= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-50583: md/raid0, raid10: Don't set discard sectors for request queue Date: Mon, 8 Dec 2025 10:12:22 +0900 Message-ID: <2025120822-CVE-2022-50583-a25a@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=3834; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=tkknzoCYamIkO3FoB69oB1pMf3wKK9TNQf1QwrQvBQM=; b=owGbwMvMwCRo6H6F97bub03G02pJDJlmqt+kdc2vNf/LNPmh/nraz39z9/cLSFn0ba9cZ3LMd MWqeo9fHbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjCRoDkMC6Z+tP5Z+eFyWKyZ if6UksD21fbabxnmCueFTkrZvDzV2MUu893sVqOF67scAQ== 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/raid0, raid10: Don't set discard sectors for request queue It should use disk_stack_limits to get a proper max_discard_sectors rather than setting a value by stack drivers. And there is a bug. If all member disks are rotational devices, raid0/raid10 set max_discard_sectors. So the member devices are not ssd/nvme, but raid0/raid10 export the wrong value. It reports warning messages in function __blkdev_issue_discard when mkfs.xfs like this: [ 4616.022599] ------------[ cut here ]------------ [ 4616.027779] WARNING: CPU: 4 PID: 99634 at block/blk-lib.c:50 __blkdev_issue_discard+0x16a/0x1a0 [ 4616.140663] RIP: 0010:__blkdev_issue_discard+0x16a/0x1a0 [ 4616.146601] Code: 24 4c 89 20 31 c0 e9 fe fe ff ff c1 e8 09 8d 48 ff 4c 89 f0 4c 09 e8 48 85 c1 0f 84 55 ff ff ff b8 ea ff ff ff e9 df fe ff ff <0f> 0b 48 8d 74 24 08 e8 ea d6 00 00 48 c7 c6 20 1e 89 ab 48 c7 c7 [ 4616.167567] RSP: 0018:ffffaab88cbffca8 EFLAGS: 00010246 [ 4616.173406] RAX: ffff9ba1f9e44678 RBX: 0000000000000000 RCX: ffff9ba1c9792080 [ 4616.181376] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff9ba1c9792080 [ 4616.189345] RBP: 0000000000000cc0 R08: ffffaab88cbffd10 R09: 0000000000000000 [ 4616.197317] R10: 0000000000000012 R11: 0000000000000000 R12: 0000000000000000 [ 4616.205288] R13: 0000000000400000 R14: 0000000000000cc0 R15: ffff9ba1c9792080 [ 4616.213259] FS: 00007f9a5534e980(0000) GS:ffff9ba1b7c80000(0000) knlGS:0000000000000000 [ 4616.222298] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 4616.228719] CR2: 000055a390a4c518 CR3: 0000000123e40006 CR4: 00000000001706e0 [ 4616.236689] Call Trace: [ 4616.239428] blkdev_issue_discard+0x52/0xb0 [ 4616.244108] blkdev_common_ioctl+0x43c/0xa00 [ 4616.248883] blkdev_ioctl+0x116/0x280 [ 4616.252977] __x64_sys_ioctl+0x8a/0xc0 [ 4616.257163] do_syscall_64+0x5c/0x90 [ 4616.261164] ? handle_mm_fault+0xc5/0x2a0 [ 4616.265652] ? do_user_addr_fault+0x1d8/0x690 [ 4616.270527] ? do_syscall_64+0x69/0x90 [ 4616.274717] ? exc_page_fault+0x62/0x150 [ 4616.279097] entry_SYSCALL_64_after_hwframe+0x63/0xcd [ 4616.284748] RIP: 0033:0x7f9a55398c6b The Linux kernel CVE team has assigned CVE-2022-50583 to this issue. Affected and fixed versions =========================== Fixed in 6.0.16 with commit e80bef070699d2e791badefccb1ddabd6998d468 Fixed in 6.1.2 with commit 27e5d61a8e6919b5c0c6f473703ffea2acba862a Fixed in 6.2 with commit 8e1a2279ca2b0485cc379a153d02a9793f74a48f 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-2022-50583 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/raid0.c drivers/md/raid10.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/e80bef070699d2e791badefccb1ddabd6998d468 https://git.kernel.org/stable/c/27e5d61a8e6919b5c0c6f473703ffea2acba862a https://git.kernel.org/stable/c/8e1a2279ca2b0485cc379a153d02a9793f74a48f