From mboxrd@z Thu Jan 1 00:00:00 1970 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 768C71A4F2D for ; Wed, 26 Feb 2025 01:58:48 +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=1740535128; cv=none; b=f0Wst9RmTsXN6a5RtiIbIZv8bJ9Tyon9e3ED9E+ZnIhlvLwQdtGNdSksrqVb5/fbm0RJjVsSirK7d3Wx00xR2rU2a0Za/vdmfqr5pWTuyaji69HNm2ykeIAzsXml+HIazPRYOVD7jmS2p1zBnJGz+0tGK8m0k3k39xbQH8tbTKc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740535128; c=relaxed/simple; bh=JdeaL2nwpaS5lnOVfD/2sGkBP4yUrrHod0r0ADvteDE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=GoQNVDbJ2i7p9gm4NqMugVRQxAkwQSBXzUHlEk/ZRr5n8YAUqdgO1DogUAiyeobPlUBBDW71wjyvKdOjZqjf5JiXRJ7G0Ne71IdiuSGq0mHEzhytTvFDXkuUL/jewSKk2QTJexvI11wWiCinqyRPbca+/jbH0T+yz4BMtMVPMO0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ughImJ8C; 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="ughImJ8C" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4CDF5C4CEDD; Wed, 26 Feb 2025 01:58:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1740535128; bh=JdeaL2nwpaS5lnOVfD/2sGkBP4yUrrHod0r0ADvteDE=; h=From:To:Cc:Subject:Date:Reply-to:From; b=ughImJ8CTNSc76dR1qsT/8Brp2xxU0YIPI83yrJKmwI/RrQ3x8ABlTOY8As2CZAjU fgihqOdfZQNAWJ39Jw83/sgYSex/qPSg0zuwgJVMo6iEykvRDSfpA3o23I8Iy5CXgQ FjrlXx05OcFmEXiCLqT5xIpl0FukRXQZYmqT13XQ= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-49147: block: Fix the maximum minor value is blk_alloc_ext_minor() Date: Wed, 26 Feb 2025 02:55:52 +0100 Message-ID: <2025022608-CVE-2022-49147-7f2f@gregkh> X-Mailer: git-send-email 2.48.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=2600; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=JdeaL2nwpaS5lnOVfD/2sGkBP4yUrrHod0r0ADvteDE=; b=owGbwMvMwCRo6H6F97bub03G02pJDOn7Shw01gelbn5/v2lGAlvao0eFExaVl9RcbPA9fj0ve MaUK08aOmJZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAim2QYFrTcuX6UyaXgVph0 I9+uDczCb/lX2DEsWK3+O8Zvv/HKJzm/1yS+O9Tfu6CnHAA= 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: block: Fix the maximum minor value is blk_alloc_ext_minor() ida_alloc_range(..., min, max, ...) returns values from min to max, inclusive. So, NR_EXT_DEVT is a valid idx returned by blk_alloc_ext_minor(). This is an issue because in device_add_disk(), this value is used in: ddev->devt = MKDEV(disk->major, disk->first_minor); and NR_EXT_DEVT is '(1 << MINORBITS)'. So, should 'disk->first_minor' be NR_EXT_DEVT, it would overflow. The Linux kernel CVE team has assigned CVE-2022-49147 to this issue. Affected and fixed versions =========================== Issue introduced in 5.11 with commit 22ae8ce8b89241c94ac00c237752c0ffa37ba5ae and fixed in 5.15.33 with commit 5b9ac3727e4abb11c9cfbe9c0781fc05dfdd7cfb Issue introduced in 5.11 with commit 22ae8ce8b89241c94ac00c237752c0ffa37ba5ae and fixed in 5.16.19 with commit 0f8cf8f5ccbad25ed6828875b222dbab29d5c272 Issue introduced in 5.11 with commit 22ae8ce8b89241c94ac00c237752c0ffa37ba5ae and fixed in 5.17.2 with commit fbe2cc4525480ddd20c866bb5c0578071e01451a Issue introduced in 5.11 with commit 22ae8ce8b89241c94ac00c237752c0ffa37ba5ae and fixed in 5.18 with commit d1868328dec5ae2cf210111025fcbc71f78dd5ca 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-49147 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: block/genhd.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/5b9ac3727e4abb11c9cfbe9c0781fc05dfdd7cfb https://git.kernel.org/stable/c/0f8cf8f5ccbad25ed6828875b222dbab29d5c272 https://git.kernel.org/stable/c/fbe2cc4525480ddd20c866bb5c0578071e01451a https://git.kernel.org/stable/c/d1868328dec5ae2cf210111025fcbc71f78dd5ca