In the Linux kernel, the following vulnerability has been resolved:
net: mdio: fix undefined behavior in bit shift for _mdiobusregister
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/mdiobus.c:586:27 left shift of 1 by 31 places cannot be represented in type 'int' Call Trace: <TASK> dumpstacklvl+0x7d/0xa5 dumpstack+0x15/0x1b ubsan_epilogue+0xe/0x4e __ubsanhandleshiftoutof_bounds+0x1e7/0x20c _mdiobusregister+0x49d/0x4e0 fixedmdiobusinit+0xd8/0x12d dooneinitcall+0x76/0x430 kernelinitfreeable+0x3b3/0x422 kernelinit+0x24/0x1e0 retfromfork+0x1f/0x30 </TASK>
{
"cna_assigner": "Linux",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/49xxx/CVE-2022-49907.json"
}"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-49907.json"
[
{
"signature_type": "Function",
"id": "CVE-2022-49907-2098785c",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4954b5359eb141499492fadfab891e28905509e2",
"signature_version": "v1",
"target": {
"function": "__mdiobus_register",
"file": "drivers/net/phy/mdio_bus.c"
},
"deprecated": false,
"digest": {
"function_hash": "281756815514538457550589287403491615082",
"length": 1771.0
}
},
{
"signature_type": "Function",
"id": "CVE-2022-49907-2a1a3201",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@40e4eb324c59e11fcb927aa46742d28aba6ecb8a",
"signature_version": "v1",
"target": {
"function": "__mdiobus_register",
"file": "drivers/net/phy/mdio_bus.c"
},
"deprecated": false,
"digest": {
"function_hash": "135041475339111035558805979870896733795",
"length": 2152.0
}
},
{
"signature_type": "Line",
"id": "CVE-2022-49907-3112db7a",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4954b5359eb141499492fadfab891e28905509e2",
"signature_version": "v1",
"target": {
"file": "drivers/net/phy/mdio_bus.c"
},
"deprecated": false,
"digest": {
"threshold": 0.9,
"line_hashes": [
"120042131344184739829018578145781946327",
"277104340285316801227383723375592697525",
"44332822080570864748122992933344195438",
"151760161954713287765636901820197938671"
]
}
},
{
"signature_type": "Line",
"id": "CVE-2022-49907-3378a312",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@40e4eb324c59e11fcb927aa46742d28aba6ecb8a",
"signature_version": "v1",
"target": {
"file": "drivers/net/phy/mdio_bus.c"
},
"deprecated": false,
"digest": {
"threshold": 0.9,
"line_hashes": [
"223312878131447504379328502867359367093",
"309522934762890180928382040824359918061",
"44332822080570864748122992933344195438",
"151760161954713287765636901820197938671"
]
}
},
{
"signature_type": "Line",
"id": "CVE-2022-49907-38612321",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@20ed01a7b9af6e6a3c33761eebbb710ea6dd49b7",
"signature_version": "v1",
"target": {
"file": "drivers/net/phy/mdio_bus.c"
},
"deprecated": false,
"digest": {
"threshold": 0.9,
"line_hashes": [
"120042131344184739829018578145781946327",
"277104340285316801227383723375592697525",
"44332822080570864748122992933344195438",
"151760161954713287765636901820197938671"
]
}
},
{
"signature_type": "Line",
"id": "CVE-2022-49907-5d13ff4c",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6ce6f8f8f6316da6f92afe7490bc2f0b654d68e0",
"signature_version": "v1",
"target": {
"file": "drivers/net/phy/mdio_bus.c"
},
"deprecated": false,
"digest": {
"threshold": 0.9,
"line_hashes": [
"223312878131447504379328502867359367093",
"309522934762890180928382040824359918061",
"44332822080570864748122992933344195438",
"151760161954713287765636901820197938671"
]
}
},
{
"signature_type": "Function",
"id": "CVE-2022-49907-828ac6f5",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6ce6f8f8f6316da6f92afe7490bc2f0b654d68e0",
"signature_version": "v1",
"target": {
"function": "__mdiobus_register",
"file": "drivers/net/phy/mdio_bus.c"
},
"deprecated": false,
"digest": {
"function_hash": "135041475339111035558805979870896733795",
"length": 2152.0
}
},
{
"signature_type": "Line",
"id": "CVE-2022-49907-845fa354",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@a3fafc974be37319679f36dc4e7cca7db1e02973",
"signature_version": "v1",
"target": {
"file": "drivers/net/phy/mdio_bus.c"
},
"deprecated": false,
"digest": {
"threshold": 0.9,
"line_hashes": [
"120042131344184739829018578145781946327",
"277104340285316801227383723375592697525",
"44332822080570864748122992933344195438",
"151760161954713287765636901820197938671"
]
}
},
{
"signature_type": "Function",
"id": "CVE-2022-49907-a349ed79",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@20ed01a7b9af6e6a3c33761eebbb710ea6dd49b7",
"signature_version": "v1",
"target": {
"function": "__mdiobus_register",
"file": "drivers/net/phy/mdio_bus.c"
},
"deprecated": false,
"digest": {
"function_hash": "58047868248724070977260497951804040643",
"length": 1279.0
}
},
{
"signature_type": "Function",
"id": "CVE-2022-49907-c179d1d3",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@634f066d02bdb22a26da7deb0c7617ab1a65fc9d",
"signature_version": "v1",
"target": {
"function": "__mdiobus_register",
"file": "drivers/net/phy/mdio_bus.c"
},
"deprecated": false,
"digest": {
"function_hash": "49852514686058961786758303671270751350",
"length": 1959.0
}
},
{
"signature_type": "Function",
"id": "CVE-2022-49907-c2dce64e",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@a3fafc974be37319679f36dc4e7cca7db1e02973",
"signature_version": "v1",
"target": {
"function": "__mdiobus_register",
"file": "drivers/net/phy/mdio_bus.c"
},
"deprecated": false,
"digest": {
"function_hash": "281756815514538457550589287403491615082",
"length": 1771.0
}
},
{
"signature_type": "Line",
"id": "CVE-2022-49907-f0e54211",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@634f066d02bdb22a26da7deb0c7617ab1a65fc9d",
"signature_version": "v1",
"target": {
"file": "drivers/net/phy/mdio_bus.c"
},
"deprecated": false,
"digest": {
"threshold": 0.9,
"line_hashes": [
"223312878131447504379328502867359367093",
"309522934762890180928382040824359918061",
"44332822080570864748122992933344195438",
"151760161954713287765636901820197938671"
]
}
}
]