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 ED2B0E567 for ; Thu, 1 May 2025 14:18:10 +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=1746109091; cv=none; b=SzCIZN4VjXeCAyVyyINd12Zv1ALsh3BWSijOrkv56tmEh2fPNIel2iUb44F1UVSaxoWtjLu5oWkoaR+FLZ78XoudYFUR8J9a1mPgs1A4BMxgysLy8+flgXFQ+lmLcQUTupet9ORlxB0FUBJ4zzFCNR8+8TdtPHdMsSZdLV+gW6Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746109091; c=relaxed/simple; bh=0pgWXKY69omMbY8F5OvP/2jpxepzps8HsmLtTd9B2bU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=T+SuLgGoyweh/RD+htFyjYhZVdrL5s4OQ101NymTFTvON5KwijZ5oP8UnQ5XBS5rmqs/b+fjqn3L5vcV16brQqyVJUT1S0KwcFMpUahYiqBJqj3YsLMksuEiAJr5F3nq1v01qwJOMQIt9OoV72jriFj7W0Pz1qE8dC12D2cULjo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=jB7MpGip; 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="jB7MpGip" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5A029C4CEE3; Thu, 1 May 2025 14:18:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1746109090; bh=0pgWXKY69omMbY8F5OvP/2jpxepzps8HsmLtTd9B2bU=; h=From:To:Cc:Subject:Date:Reply-to:From; b=jB7MpGip0kqO1+MlWKSX7CPACXGUl3cTqReUvWkI81BxEQ2njfKnfnNUmepy1qjab HL1z+OE52hzuOgwgpSGO/Mk+Knb0tkO7e9sDmOMiV4NrOWjXD8BFTNuVHbdy98UpzA e23+KHsKM71IgP1L42znBxRynsKe79tON3mTcQQ0= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-49907: net: mdio: fix undefined behavior in bit shift for __mdiobus_register Date: Thu, 1 May 2025 16:11:37 +0200 Message-ID: <2025050103-CVE-2022-49907-f684@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=3776; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=kw1Sh3mpnJ6wLKmckn01lhzLNMRpSTn1i6PNxvh4Op8=; b=owGbwMvMwCRo6H6F97bub03G02pJDBnCDXsMIrT0Mw/Xh2/wn7fDza7lf9jRY+wa3gYH63K6v rSqvZnbEcvCIMjEICumyPJlG8/R/RWHFL0MbU/DzGFlAhnCwMUpABP5WMcwT+36zrSmwjl/Vz0K r8jmmPF9gfB9U4a5Qs2R5y3mpRuc6ja6tltu3X4Wvq0RAA== 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: net: mdio: fix undefined behavior in bit shift for __mdiobus_register Shifting signed 32-bit value by 31 bits is undefined, so changing significant bit to unsigned. The UBSAN warning calltrace like below: UBSAN: shift-out-of-bounds in drivers/net/phy/mdio_bus.c:586:27 left shift of 1 by 31 places cannot be represented in type 'int' Call Trace: dump_stack_lvl+0x7d/0xa5 dump_stack+0x15/0x1b ubsan_epilogue+0xe/0x4e __ubsan_handle_shift_out_of_bounds+0x1e7/0x20c __mdiobus_register+0x49d/0x4e0 fixed_mdio_bus_init+0xd8/0x12d do_one_initcall+0x76/0x430 kernel_init_freeable+0x3b3/0x422 kernel_init+0x24/0x1e0 ret_from_fork+0x1f/0x30 The Linux kernel CVE team has assigned CVE-2022-49907 to this issue. Affected and fixed versions =========================== Issue introduced in 2.6.28 with commit 4fd5f812c23c7deee6425f4a318e85c317cd1d6c and fixed in 4.9.333 with commit 20ed01a7b9af6e6a3c33761eebbb710ea6dd49b7 Issue introduced in 2.6.28 with commit 4fd5f812c23c7deee6425f4a318e85c317cd1d6c and fixed in 4.14.299 with commit 7006176a3c863e3e353ce1b8a349ef5bb1b9320e Issue introduced in 2.6.28 with commit 4fd5f812c23c7deee6425f4a318e85c317cd1d6c and fixed in 4.19.265 with commit a3fafc974be37319679f36dc4e7cca7db1e02973 Issue introduced in 2.6.28 with commit 4fd5f812c23c7deee6425f4a318e85c317cd1d6c and fixed in 5.4.224 with commit 4954b5359eb141499492fadfab891e28905509e2 Issue introduced in 2.6.28 with commit 4fd5f812c23c7deee6425f4a318e85c317cd1d6c and fixed in 5.10.154 with commit 634f066d02bdb22a26da7deb0c7617ab1a65fc9d Issue introduced in 2.6.28 with commit 4fd5f812c23c7deee6425f4a318e85c317cd1d6c and fixed in 5.15.78 with commit 985a88bf0b27193522bba7856b1763f428cef19d Issue introduced in 2.6.28 with commit 4fd5f812c23c7deee6425f4a318e85c317cd1d6c and fixed in 6.0.8 with commit 6ce6f8f8f6316da6f92afe7490bc2f0b654d68e0 Issue introduced in 2.6.28 with commit 4fd5f812c23c7deee6425f4a318e85c317cd1d6c and fixed in 6.1 with commit 40e4eb324c59e11fcb927aa46742d28aba6ecb8a 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-49907 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/net/phy/mdio_bus.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/20ed01a7b9af6e6a3c33761eebbb710ea6dd49b7 https://git.kernel.org/stable/c/7006176a3c863e3e353ce1b8a349ef5bb1b9320e https://git.kernel.org/stable/c/a3fafc974be37319679f36dc4e7cca7db1e02973 https://git.kernel.org/stable/c/4954b5359eb141499492fadfab891e28905509e2 https://git.kernel.org/stable/c/634f066d02bdb22a26da7deb0c7617ab1a65fc9d https://git.kernel.org/stable/c/985a88bf0b27193522bba7856b1763f428cef19d https://git.kernel.org/stable/c/6ce6f8f8f6316da6f92afe7490bc2f0b654d68e0 https://git.kernel.org/stable/c/40e4eb324c59e11fcb927aa46742d28aba6ecb8a