CVE-2024-36962

Source
https://nvd.nist.gov/vuln/detail/CVE-2024-36962
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-36962.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2024-36962
Downstream
Related
Published
2024-06-03T07:50:00Z
Modified
2025-10-15T11:22:45.972369Z
Severity
  • 6.2 (Medium) CVSS_V3 - CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H CVSS Calculator
Summary
net: ks8851: Queue RX packets in IRQ handler instead of disabling BHs
Details

In the Linux kernel, the following vulnerability has been resolved:

net: ks8851: Queue RX packets in IRQ handler instead of disabling BHs

Currently the driver uses localbhdisable()/localbhenable() in its IRQ handler to avoid triggering netrxaction() softirq on exit from netifrx(). The netrxaction() could trigger this driver .startxmit callback, which is protected by the same lock as the IRQ handler, so calling the .startxmit from netifrx() from the IRQ handler critical section protected by the lock could lead to an attempt to claim the already claimed lock, and a hang.

The localbhdisable()/localbhenable() approach works only in case the IRQ handler is protected by a spinlock, but does not work if the IRQ handler is protected by mutex, i.e. this works for KS8851 with Parallel bus interface, but not for KS8851 with SPI bus interface.

Remove the BH manipulation and instead of calling netifrx() inside the IRQ handler code protected by the lock, queue all the received SKBs in the IRQ handler into a queue first, and once the IRQ handler exits the critical section protected by the lock, dequeue all the queued SKBs and push them all into netifrx(). At this point, it is safe to trigger the netrxaction() softirq, since the netif_rx() call is outside of the lock that protects the IRQ handler.

References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
492337a4fbd1421b42df684ee9b34be2a2722540
Fixed
8a3ff43dcbab7c96f9e8cf2bd1049ab8d6e59545
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
cba376eb036c2c20077b41d47b317d8218fe754f
Fixed
ae87f661f3c1a3134a7ed86ab69bf9f12af88993
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
49d5d70538b6b8f2a3f8f1ac30c1f921d4a0929b
Fixed
7e2901a2a9195da76111f351584bf77552a038f0
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
be0384bf599cf1eb8d337517feeb732d71f75a6f
Fixed
e0863634bf9f7cf36291ebb5bfa2d16632f79c49

Affected versions

v6.*

v6.1.87
v6.1.88
v6.1.89
v6.1.90
v6.6.28
v6.6.29
v6.6.30
v6.8.7
v6.8.8
v6.8.9
v6.9-rc3
v6.9-rc4
v6.9-rc5
v6.9-rc6

Database specific

vanir_signatures

[
    {
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7e2901a2a9195da76111f351584bf77552a038f0",
        "signature_version": "v1",
        "target": {
            "file": "drivers/net/ethernet/micrel/ks8851_common.c",
            "function": "ks8851_irq"
        },
        "digest": {
            "length": 1575.0,
            "function_hash": "238196980030960181379076135340328349498"
        },
        "deprecated": false,
        "signature_type": "Function",
        "id": "CVE-2024-36962-2e695f5a"
    },
    {
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8a3ff43dcbab7c96f9e8cf2bd1049ab8d6e59545",
        "signature_version": "v1",
        "target": {
            "file": "drivers/net/ethernet/micrel/ks8851_common.c"
        },
        "digest": {
            "threshold": 0.9,
            "line_hashes": [
                "97968045930146394170640754488629197890",
                "58931071043799123626919580312148678080",
                "332981792425044729000070803437621665103",
                "272292386501943771785148182628456192344",
                "76060780744972190034203097552052843342",
                "26181067071950307544626936625926572280",
                "305540876921332123893414099015715198213",
                "284202677709872617464968256452399038129",
                "139991279330817265534520776676218259958",
                "22395422709048136126334172476597004114",
                "20415801849109632304903829564991787787",
                "57924789120526905958480880345011470992",
                "120635595301254071640410011717209494361",
                "155797376264755327952585277067526089632",
                "102054078478988204005672258998989890711",
                "229740580245983486145139798666683646710",
                "306065708878842520038502858157117105026",
                "283865084925931027617739948156593303159",
                "79137547514777108321537462608020574463",
                "320812626312433159891316873681339309254",
                "152953576165949781112003117865166659127",
                "221958231452349736447808847497460548663",
                "42489498630211948160151033947555796582",
                "165030237860960999301410842006326219961"
            ]
        },
        "deprecated": false,
        "signature_type": "Line",
        "id": "CVE-2024-36962-331da3ee"
    },
    {
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@ae87f661f3c1a3134a7ed86ab69bf9f12af88993",
        "signature_version": "v1",
        "target": {
            "file": "drivers/net/ethernet/micrel/ks8851_common.c",
            "function": "ks8851_irq"
        },
        "digest": {
            "length": 1575.0,
            "function_hash": "238196980030960181379076135340328349498"
        },
        "deprecated": false,
        "signature_type": "Function",
        "id": "CVE-2024-36962-4656f6e0"
    },
    {
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7e2901a2a9195da76111f351584bf77552a038f0",
        "signature_version": "v1",
        "target": {
            "file": "drivers/net/ethernet/micrel/ks8851_common.c"
        },
        "digest": {
            "threshold": 0.9,
            "line_hashes": [
                "97968045930146394170640754488629197890",
                "58931071043799123626919580312148678080",
                "332981792425044729000070803437621665103",
                "272292386501943771785148182628456192344",
                "76060780744972190034203097552052843342",
                "26181067071950307544626936625926572280",
                "305540876921332123893414099015715198213",
                "284202677709872617464968256452399038129",
                "139991279330817265534520776676218259958",
                "22395422709048136126334172476597004114",
                "20415801849109632304903829564991787787",
                "57924789120526905958480880345011470992",
                "120635595301254071640410011717209494361",
                "155797376264755327952585277067526089632",
                "102054078478988204005672258998989890711",
                "229740580245983486145139798666683646710",
                "306065708878842520038502858157117105026",
                "283865084925931027617739948156593303159",
                "79137547514777108321537462608020574463",
                "320812626312433159891316873681339309254",
                "152953576165949781112003117865166659127",
                "221958231452349736447808847497460548663",
                "42489498630211948160151033947555796582",
                "165030237860960999301410842006326219961"
            ]
        },
        "deprecated": false,
        "signature_type": "Line",
        "id": "CVE-2024-36962-600c9089"
    },
    {
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e0863634bf9f7cf36291ebb5bfa2d16632f79c49",
        "signature_version": "v1",
        "target": {
            "file": "drivers/net/ethernet/micrel/ks8851_common.c"
        },
        "digest": {
            "threshold": 0.9,
            "line_hashes": [
                "97968045930146394170640754488629197890",
                "58931071043799123626919580312148678080",
                "332981792425044729000070803437621665103",
                "272292386501943771785148182628456192344",
                "76060780744972190034203097552052843342",
                "26181067071950307544626936625926572280",
                "305540876921332123893414099015715198213",
                "284202677709872617464968256452399038129",
                "139991279330817265534520776676218259958",
                "22395422709048136126334172476597004114",
                "20415801849109632304903829564991787787",
                "57924789120526905958480880345011470992",
                "120635595301254071640410011717209494361",
                "155797376264755327952585277067526089632",
                "102054078478988204005672258998989890711",
                "229740580245983486145139798666683646710",
                "306065708878842520038502858157117105026",
                "283865084925931027617739948156593303159",
                "79137547514777108321537462608020574463",
                "320812626312433159891316873681339309254",
                "152953576165949781112003117865166659127",
                "221958231452349736447808847497460548663",
                "42489498630211948160151033947555796582",
                "165030237860960999301410842006326219961"
            ]
        },
        "deprecated": false,
        "signature_type": "Line",
        "id": "CVE-2024-36962-841439da"
    },
    {
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8a3ff43dcbab7c96f9e8cf2bd1049ab8d6e59545",
        "signature_version": "v1",
        "target": {
            "file": "drivers/net/ethernet/micrel/ks8851_common.c",
            "function": "ks8851_rx_pkts"
        },
        "digest": {
            "length": 1123.0,
            "function_hash": "104613745926628831002351140967510840779"
        },
        "deprecated": false,
        "signature_type": "Function",
        "id": "CVE-2024-36962-8e0474d6"
    },
    {
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7e2901a2a9195da76111f351584bf77552a038f0",
        "signature_version": "v1",
        "target": {
            "file": "drivers/net/ethernet/micrel/ks8851_common.c",
            "function": "ks8851_rx_pkts"
        },
        "digest": {
            "length": 1123.0,
            "function_hash": "104613745926628831002351140967510840779"
        },
        "deprecated": false,
        "signature_type": "Function",
        "id": "CVE-2024-36962-94ac0dd9"
    },
    {
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@ae87f661f3c1a3134a7ed86ab69bf9f12af88993",
        "signature_version": "v1",
        "target": {
            "file": "drivers/net/ethernet/micrel/ks8851_common.c"
        },
        "digest": {
            "threshold": 0.9,
            "line_hashes": [
                "97968045930146394170640754488629197890",
                "58931071043799123626919580312148678080",
                "332981792425044729000070803437621665103",
                "272292386501943771785148182628456192344",
                "76060780744972190034203097552052843342",
                "26181067071950307544626936625926572280",
                "305540876921332123893414099015715198213",
                "284202677709872617464968256452399038129",
                "139991279330817265534520776676218259958",
                "22395422709048136126334172476597004114",
                "20415801849109632304903829564991787787",
                "57924789120526905958480880345011470992",
                "120635595301254071640410011717209494361",
                "155797376264755327952585277067526089632",
                "102054078478988204005672258998989890711",
                "229740580245983486145139798666683646710",
                "306065708878842520038502858157117105026",
                "283865084925931027617739948156593303159",
                "79137547514777108321537462608020574463",
                "320812626312433159891316873681339309254",
                "152953576165949781112003117865166659127",
                "221958231452349736447808847497460548663",
                "42489498630211948160151033947555796582",
                "165030237860960999301410842006326219961"
            ]
        },
        "deprecated": false,
        "signature_type": "Line",
        "id": "CVE-2024-36962-ab67f211"
    },
    {
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e0863634bf9f7cf36291ebb5bfa2d16632f79c49",
        "signature_version": "v1",
        "target": {
            "file": "drivers/net/ethernet/micrel/ks8851_common.c",
            "function": "ks8851_irq"
        },
        "digest": {
            "length": 1575.0,
            "function_hash": "238196980030960181379076135340328349498"
        },
        "deprecated": false,
        "signature_type": "Function",
        "id": "CVE-2024-36962-d033d8ba"
    },
    {
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@ae87f661f3c1a3134a7ed86ab69bf9f12af88993",
        "signature_version": "v1",
        "target": {
            "file": "drivers/net/ethernet/micrel/ks8851_common.c",
            "function": "ks8851_rx_pkts"
        },
        "digest": {
            "length": 1123.0,
            "function_hash": "104613745926628831002351140967510840779"
        },
        "deprecated": false,
        "signature_type": "Function",
        "id": "CVE-2024-36962-d1bf841e"
    },
    {
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8a3ff43dcbab7c96f9e8cf2bd1049ab8d6e59545",
        "signature_version": "v1",
        "target": {
            "file": "drivers/net/ethernet/micrel/ks8851_common.c",
            "function": "ks8851_irq"
        },
        "digest": {
            "length": 1575.0,
            "function_hash": "238196980030960181379076135340328349498"
        },
        "deprecated": false,
        "signature_type": "Function",
        "id": "CVE-2024-36962-d99e1dce"
    },
    {
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e0863634bf9f7cf36291ebb5bfa2d16632f79c49",
        "signature_version": "v1",
        "target": {
            "file": "drivers/net/ethernet/micrel/ks8851_common.c",
            "function": "ks8851_rx_pkts"
        },
        "digest": {
            "length": 1123.0,
            "function_hash": "104613745926628831002351140967510840779"
        },
        "deprecated": false,
        "signature_type": "Function",
        "id": "CVE-2024-36962-dc33a7ce"
    }
]

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
6.1.87
Fixed
6.1.91
Type
ECOSYSTEM
Events
Introduced
6.6.28
Fixed
6.6.31
Type
ECOSYSTEM
Events
Introduced
6.8.7
Fixed
6.8.10