CVE-2024-42282

Source
https://nvd.nist.gov/vuln/detail/CVE-2024-42282
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-42282.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2024-42282
Downstream
Published
2024-08-17T09:08:49.145Z
Modified
2025-11-20T05:15:40.487393Z
Summary
net: mediatek: Fix potential NULL pointer dereference in dummy net_device handling
Details

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

net: mediatek: Fix potential NULL pointer dereference in dummy net_device handling

Move the freeing of the dummy netdevice from mtkfreedev() to mtkremove().

Previously, if allocnetdevdummy() failed in mtkprobe(), eth->dummydev would be NULL. The error path would then call mtkfreedev(), which in turn called freenetdev() assuming dummydev was allocated (but it was not), potentially causing a NULL pointer dereference.

By moving freenetdev() to mtkremove(), we ensure it's only called when mtkprobe() has succeeded and dummydev is fully allocated. This addresses a potential NULL pointer dereference detected by Smatch[1].

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
b209bd6d0bffb8991aba568e2d9a892c86a1a43c
Fixed
af6bd5c9901b13a26eaf4d57d97a813297791596
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
b209bd6d0bffb8991aba568e2d9a892c86a1a43c
Fixed
16f3a28cf5f876a7f3550d8f4c870a7b41bcfaef

Affected versions

v6.*

v6.10
v6.10-rc1
v6.10-rc2
v6.10-rc3
v6.10-rc4
v6.10-rc5
v6.10-rc6
v6.10-rc7
v6.10.1
v6.10.2
v6.9
v6.9-rc5
v6.9-rc6
v6.9-rc7

Database specific

vanir_signatures

[
    {
        "deprecated": false,
        "target": {
            "file": "drivers/net/ethernet/mediatek/mtk_eth_soc.c",
            "function": "mtk_free_dev"
        },
        "digest": {
            "length": 385.0,
            "function_hash": "326853414783718516941248878612749597983"
        },
        "id": "CVE-2024-42282-0eee6158",
        "signature_type": "Function",
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@16f3a28cf5f876a7f3550d8f4c870a7b41bcfaef",
        "signature_version": "v1"
    },
    {
        "deprecated": false,
        "target": {
            "file": "drivers/net/ethernet/mediatek/mtk_eth_soc.c",
            "function": "mtk_remove"
        },
        "digest": {
            "length": 442.0,
            "function_hash": "22662440852145054622791212156494205156"
        },
        "id": "CVE-2024-42282-1610d7cf",
        "signature_type": "Function",
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@af6bd5c9901b13a26eaf4d57d97a813297791596",
        "signature_version": "v1"
    },
    {
        "deprecated": false,
        "target": {
            "file": "drivers/net/ethernet/mediatek/mtk_eth_soc.c",
            "function": "mtk_remove"
        },
        "digest": {
            "length": 442.0,
            "function_hash": "22662440852145054622791212156494205156"
        },
        "id": "CVE-2024-42282-176de9ec",
        "signature_type": "Function",
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@16f3a28cf5f876a7f3550d8f4c870a7b41bcfaef",
        "signature_version": "v1"
    },
    {
        "deprecated": false,
        "target": {
            "file": "drivers/net/ethernet/mediatek/mtk_eth_soc.c"
        },
        "digest": {
            "threshold": 0.9,
            "line_hashes": [
                "296507479798506932698506697457929870061",
                "310412275052544163021658019168312362729",
                "334364652614592765825922138755939920846",
                "266456083456212874944126245267951341348",
                "231462427427459334713229483178735397822",
                "268965137942011616809539498560468026766",
                "71262500426256659117904317770327668658",
                "312403381450202109565992075861531199894"
            ]
        },
        "id": "CVE-2024-42282-381279cf",
        "signature_type": "Line",
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@16f3a28cf5f876a7f3550d8f4c870a7b41bcfaef",
        "signature_version": "v1"
    },
    {
        "deprecated": false,
        "target": {
            "file": "drivers/net/ethernet/mediatek/mtk_eth_soc.c"
        },
        "digest": {
            "threshold": 0.9,
            "line_hashes": [
                "296507479798506932698506697457929870061",
                "310412275052544163021658019168312362729",
                "334364652614592765825922138755939920846",
                "266456083456212874944126245267951341348",
                "231462427427459334713229483178735397822",
                "268965137942011616809539498560468026766",
                "71262500426256659117904317770327668658",
                "312403381450202109565992075861531199894"
            ]
        },
        "id": "CVE-2024-42282-7edf9833",
        "signature_type": "Line",
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@af6bd5c9901b13a26eaf4d57d97a813297791596",
        "signature_version": "v1"
    },
    {
        "deprecated": false,
        "target": {
            "file": "drivers/net/ethernet/mediatek/mtk_eth_soc.c",
            "function": "mtk_free_dev"
        },
        "digest": {
            "length": 385.0,
            "function_hash": "326853414783718516941248878612749597983"
        },
        "id": "CVE-2024-42282-f3f1c4a8",
        "signature_type": "Function",
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@af6bd5c9901b13a26eaf4d57d97a813297791596",
        "signature_version": "v1"
    }
]

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
6.10.0
Fixed
6.10.3