In the Linux kernel, the following vulnerability has been resolved:
PCI: kirin: Fix buffer overflow in kirinpcieparse_port()
Within kirinpcieparseport(), the pcie->numslots is compared to pcie->gpioidreset size (MAXPCISLOTS) which is correct and would lead to an overflow.
Thus, fix condition to pcie->numslots + 1 >= MAXPCISLOTS and move pcie->numslots increment below the if-statement to avoid out-of-bounds array access.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
[kwilczynski: commit log]
{ "vanir_signatures": [ { "id": "CVE-2024-47751-09966623", "signature_type": "Line", "target": { "file": "drivers/pci/controller/dwc/pcie-kirin.c" }, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@aeb0335971806e15ac91e838ca471936c8e7efd5", "digest": { "threshold": 0.9, "line_hashes": [ "314684259056089404521096407894173229556", "39630415274827562699757896989990629444", "324768294074943255350900825165472427628", "26429928997581743956518599598464846453", "263246966576043653686711087564039374098", "286454477255706716303058852157214673688", "310252693440375607717958327241321093145", "117874229324935439592778602086282714931" ] }, "deprecated": false, "signature_version": "v1" }, { "id": "CVE-2024-47751-2b4d97bf", "signature_type": "Line", "target": { "file": "drivers/pci/controller/dwc/pcie-kirin.c" }, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@a5f795f9412854df28e66679c5e6b68b0b79c229", "digest": { "threshold": 0.9, "line_hashes": [ "223396580389000372569369221580461171222", "117296631022619361073230541642502686002", "145355793475399773059515960117616434748", "37507966195846868092153243922723986624", "106750560963366628412629923356352182405", "163277694127076598932922264001151870087", "288709549660133719860316212838530789054", "326356385405096681775322360292318431146", "117874229324935439592778602086282714931" ] }, "deprecated": false, "signature_version": "v1" }, { "id": "CVE-2024-47751-53e970a2", "signature_type": "Function", "target": { "file": "drivers/pci/controller/dwc/pcie-kirin.c", "function": "kirin_pcie_parse_port" }, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@95248d7497bcbfe7deed4805469c6ff6ddd7f9d1", "digest": { "function_hash": "267699117966683719711502442628256000953", "length": 977.0 }, "deprecated": false, "signature_version": "v1" }, { "id": "CVE-2024-47751-718ce75d", "signature_type": "Function", "target": { "file": "drivers/pci/controller/dwc/pcie-kirin.c", "function": "kirin_pcie_parse_port" }, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6dcc5b49d6607a741a14122bf3105f3ac50d259e", "digest": { "function_hash": "35241813487124089988313054333776895300", "length": 933.0 }, "deprecated": false, "signature_version": "v1" }, { "id": "CVE-2024-47751-88c0e034", "signature_type": "Function", "target": { "file": "drivers/pci/controller/dwc/pcie-kirin.c", "function": "kirin_pcie_parse_port" }, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@a5f795f9412854df28e66679c5e6b68b0b79c229", "digest": { "function_hash": "267699117966683719711502442628256000953", "length": 977.0 }, "deprecated": false, "signature_version": "v1" }, { "id": "CVE-2024-47751-8e7e4555", "signature_type": "Line", "target": { "file": "drivers/pci/controller/dwc/pcie-kirin.c" }, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6dcc5b49d6607a741a14122bf3105f3ac50d259e", "digest": { "threshold": 0.9, "line_hashes": [ "223396580389000372569369221580461171222", "117296631022619361073230541642502686002", "145355793475399773059515960117616434748", "37507966195846868092153243922723986624", "106750560963366628412629923356352182405", "163277694127076598932922264001151870087", "288709549660133719860316212838530789054", "326356385405096681775322360292318431146", "117874229324935439592778602086282714931" ] }, "deprecated": false, "signature_version": "v1" }, { "id": "CVE-2024-47751-992ab476", "signature_type": "Function", "target": { "file": "drivers/pci/controller/dwc/pcie-kirin.c", "function": "kirin_pcie_parse_port" }, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c500a86693a126c9393e602741e348f80f1b0fc5", "digest": { "function_hash": "12942734857694880563608926559168432882", "length": 1138.0 }, "deprecated": false, "signature_version": "v1" }, { "id": "CVE-2024-47751-b53a7c47", "signature_type": "Function", "target": { "file": "drivers/pci/controller/dwc/pcie-kirin.c", "function": "kirin_pcie_parse_port" }, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@aeb0335971806e15ac91e838ca471936c8e7efd5", "digest": { "function_hash": "12942734857694880563608926559168432882", "length": 1138.0 }, "deprecated": false, "signature_version": "v1" }, { "id": "CVE-2024-47751-d28feaeb", "signature_type": "Line", "target": { "file": "drivers/pci/controller/dwc/pcie-kirin.c" }, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c500a86693a126c9393e602741e348f80f1b0fc5", "digest": { "threshold": 0.9, "line_hashes": [ "314684259056089404521096407894173229556", "39630415274827562699757896989990629444", "324768294074943255350900825165472427628", "26429928997581743956518599598464846453", "263246966576043653686711087564039374098", "286454477255706716303058852157214673688", "310252693440375607717958327241321093145", "117874229324935439592778602086282714931" ] }, "deprecated": false, "signature_version": "v1" }, { "id": "CVE-2024-47751-f9b5cb7d", "signature_type": "Line", "target": { "file": "drivers/pci/controller/dwc/pcie-kirin.c" }, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@95248d7497bcbfe7deed4805469c6ff6ddd7f9d1", "digest": { "threshold": 0.9, "line_hashes": [ "223396580389000372569369221580461171222", "117296631022619361073230541642502686002", "145355793475399773059515960117616434748", "37507966195846868092153243922723986624", "106750560963366628412629923356352182405", "163277694127076598932922264001151870087", "288709549660133719860316212838530789054", "326356385405096681775322360292318431146", "117874229324935439592778602086282714931" ] }, "deprecated": false, "signature_version": "v1" } ] }