In the Linux kernel, the following vulnerability has been resolved:
net: dsa: mv88e6xxx: Correct check for empty list
Since commit a3c53be55c95 ("net: dsa: mv88e6xxx: Support multiple MDIO busses") mv88e6xxxdefaultmdiobus() has checked that the return value of listfirst_entry() is non-NULL.
This appears to be intended to guard against the list chip->mdios being empty. However, it is not the correct check as the implementation of listfirstentry is not designed to return NULL for empty lists.
Instead, use listfirstentryornull() which does return NULL if the list is empty.
Flagged by Smatch. Compile tested only.
{ "vanir_signatures": [ { "digest": { "length": 160.0, "function_hash": "203233610945123184426905941761799165166" }, "signature_version": "v1", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4c7f3950a9fd53a62b156c0fe7c3a2c43b0ba19b", "target": { "file": "drivers/net/dsa/mv88e6xxx/chip.c", "function": "mv88e6xxx_default_mdio_bus" }, "id": "CVE-2024-42224-13f24a51", "signature_type": "Function" }, { "digest": { "length": 160.0, "function_hash": "203233610945123184426905941761799165166" }, "signature_version": "v1", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2a2fe25a103cef73cde356e6d09da10f607e93f5", "target": { "file": "drivers/net/dsa/mv88e6xxx/chip.c", "function": "mv88e6xxx_default_mdio_bus" }, "id": "CVE-2024-42224-23c781d7", "signature_type": "Function" }, { "digest": { "length": 160.0, "function_hash": "203233610945123184426905941761799165166" }, "signature_version": "v1", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@aa03f591ef31ba603a4a99d05d25a0f21ab1cd89", "target": { "file": "drivers/net/dsa/mv88e6xxx/chip.c", "function": "mv88e6xxx_default_mdio_bus" }, "id": "CVE-2024-42224-2ec88937", "signature_type": "Function" }, { "digest": { "threshold": 0.9, "line_hashes": [ "104849155209274822835246680144119819487", "294508330053285657725659309714169178286", "240977897016023445538077381576257138484", "135700447302100620320721900419599315591", "208688922333758868521840081707838947381" ] }, "signature_version": "v1", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f75625db838ade28f032dacd0f0c8baca42ecde4", "target": { "file": "drivers/net/dsa/mv88e6xxx/chip.c" }, "id": "CVE-2024-42224-2feb05d9", "signature_type": "Line" }, { "digest": { "threshold": 0.9, "line_hashes": [ "104849155209274822835246680144119819487", "294508330053285657725659309714169178286", "240977897016023445538077381576257138484", "135700447302100620320721900419599315591", "208688922333758868521840081707838947381" ] }, "signature_version": "v1", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@3f25b5f1635449036692a44b771f39f772190c1d", "target": { "file": "drivers/net/dsa/mv88e6xxx/chip.c" }, "id": "CVE-2024-42224-38a25162", "signature_type": "Line" }, { "digest": { "length": 160.0, "function_hash": "203233610945123184426905941761799165166" }, "signature_version": "v1", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@3f25b5f1635449036692a44b771f39f772190c1d", "target": { "file": "drivers/net/dsa/mv88e6xxx/chip.c", "function": "mv88e6xxx_default_mdio_bus" }, "id": "CVE-2024-42224-3bc5d767", "signature_type": "Function" }, { "digest": { "length": 160.0, "function_hash": "203233610945123184426905941761799165166" }, "signature_version": "v1", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f75625db838ade28f032dacd0f0c8baca42ecde4", "target": { "file": "drivers/net/dsa/mv88e6xxx/chip.c", "function": "mv88e6xxx_default_mdio_bus" }, "id": "CVE-2024-42224-68f45e22", "signature_type": "Function" }, { "digest": { "threshold": 0.9, "line_hashes": [ "104849155209274822835246680144119819487", "294508330053285657725659309714169178286", "240977897016023445538077381576257138484", "135700447302100620320721900419599315591", "208688922333758868521840081707838947381" ] }, "signature_version": "v1", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@aa03f591ef31ba603a4a99d05d25a0f21ab1cd89", "target": { "file": "drivers/net/dsa/mv88e6xxx/chip.c" }, "id": "CVE-2024-42224-722bc3fe", "signature_type": "Line" }, { "digest": { "length": 160.0, "function_hash": "203233610945123184426905941761799165166" }, "signature_version": "v1", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@47d28dde172696031c880c5778633cdca30394ee", "target": { "file": "drivers/net/dsa/mv88e6xxx/chip.c", "function": "mv88e6xxx_default_mdio_bus" }, "id": "CVE-2024-42224-929af3f1", "signature_type": "Function" }, { "digest": { "threshold": 0.9, "line_hashes": [ "104849155209274822835246680144119819487", "294508330053285657725659309714169178286", "240977897016023445538077381576257138484", "135700447302100620320721900419599315591", "208688922333758868521840081707838947381" ] }, "signature_version": "v1", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2a2fe25a103cef73cde356e6d09da10f607e93f5", "target": { "file": "drivers/net/dsa/mv88e6xxx/chip.c" }, "id": "CVE-2024-42224-aef2472b", "signature_type": "Line" }, { "digest": { "threshold": 0.9, "line_hashes": [ "104849155209274822835246680144119819487", "294508330053285657725659309714169178286", "240977897016023445538077381576257138484", "135700447302100620320721900419599315591", "208688922333758868521840081707838947381" ] }, "signature_version": "v1", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@3bf8d70e1455f87856640c3433b3660a31001618", "target": { "file": "drivers/net/dsa/mv88e6xxx/chip.c" }, "id": "CVE-2024-42224-af4362ce", "signature_type": "Line" }, { "digest": { "threshold": 0.9, "line_hashes": [ "104849155209274822835246680144119819487", "294508330053285657725659309714169178286", "240977897016023445538077381576257138484", "135700447302100620320721900419599315591", "208688922333758868521840081707838947381" ] }, "signature_version": "v1", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@47d28dde172696031c880c5778633cdca30394ee", "target": { "file": "drivers/net/dsa/mv88e6xxx/chip.c" }, "id": "CVE-2024-42224-e5f05674", "signature_type": "Line" }, { "digest": { "threshold": 0.9, "line_hashes": [ "104849155209274822835246680144119819487", "294508330053285657725659309714169178286", "240977897016023445538077381576257138484", "135700447302100620320721900419599315591", "208688922333758868521840081707838947381" ] }, "signature_version": "v1", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4c7f3950a9fd53a62b156c0fe7c3a2c43b0ba19b", "target": { "file": "drivers/net/dsa/mv88e6xxx/chip.c" }, "id": "CVE-2024-42224-e7be356a", "signature_type": "Line" }, { "digest": { "length": 160.0, "function_hash": "203233610945123184426905941761799165166" }, "signature_version": "v1", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@3bf8d70e1455f87856640c3433b3660a31001618", "target": { "file": "drivers/net/dsa/mv88e6xxx/chip.c", "function": "mv88e6xxx_default_mdio_bus" }, "id": "CVE-2024-42224-fd021c30", "signature_type": "Function" } ] }