CVE-2024-58042

Source
https://nvd.nist.gov/vuln/detail/CVE-2024-58042
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-58042.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2024-58042
Downstream
Published
2025-02-27T20:00:52.879Z
Modified
2025-11-20T07:47:30.566506Z
Severity
  • 5.5 (Medium) CVSS_V3 - CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H CVSS Calculator
Summary
rhashtable: Fix potential deadlock by moving schedule_work outside lock
Details

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

rhashtable: Fix potential deadlock by moving schedule_work outside lock

Move the hash table growth check and work scheduling outside the rht lock to prevent a possible circular locking dependency.

The original implementation could trigger a lockdep warning due to a potential deadlock scenario involving nested locks between rhashtable bucket, rq lock, and dsq lock. By relocating the growth check and work scheduling after releasing the rth lock, we break this potential deadlock chain.

This change expands the flexibility of rhashtable by removing restrictive locking that previously limited its use in scheduler and workqueue contexts.

Import to say that this calls rhtgrowabove_75(), which reads from struct rhashtable without holding the lock, if this is a problem, we can move the check to the lock, and schedule the workqueue after the lock.

Modified so that atomic_inc is also moved outside of the bucket lock along with the growth above 75% check.

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
f0e1a0643a59bf1f922fa209cec86a170b784f3f
Fixed
eb2e58484b838fb4e777ee9721bb9e20e6ca971d
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
f0e1a0643a59bf1f922fa209cec86a170b784f3f
Fixed
ced8ce3c83a7150c5f5d371a8c332d7bc7f9b66d
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
f0e1a0643a59bf1f922fa209cec86a170b784f3f
Fixed
e1d3422c95f003eba241c176adfe593c33e8a8f6

Affected versions

v6.*

v6.10
v6.10-rc3
v6.10-rc4
v6.10-rc5
v6.10-rc6
v6.10-rc7
v6.11
v6.11-rc1
v6.11-rc2
v6.11-rc3
v6.11-rc4
v6.11-rc5
v6.11-rc6
v6.11-rc7
v6.12
v6.12-rc1
v6.12-rc2
v6.12-rc3
v6.12-rc4
v6.12-rc5
v6.12-rc6
v6.12-rc7
v6.12.1
v6.12.10
v6.12.11
v6.12.12
v6.12.2
v6.12.3
v6.12.4
v6.12.5
v6.12.6
v6.12.7
v6.12.8
v6.12.9
v6.13
v6.13-rc1
v6.13-rc2
v6.13-rc3
v6.13-rc4
v6.13-rc5
v6.13-rc6
v6.13-rc7
v6.13.1

Database specific

vanir_signatures

[
    {
        "id": "CVE-2024-58042-39c2b0df",
        "signature_version": "v1",
        "digest": {
            "length": 960.0,
            "function_hash": "181897112746917554726415958920702399074"
        },
        "deprecated": false,
        "signature_type": "Function",
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e1d3422c95f003eba241c176adfe593c33e8a8f6",
        "target": {
            "file": "lib/rhashtable.c",
            "function": "rhashtable_insert_one"
        }
    },
    {
        "id": "CVE-2024-58042-8511c791",
        "signature_version": "v1",
        "digest": {
            "length": 960.0,
            "function_hash": "181897112746917554726415958920702399074"
        },
        "deprecated": false,
        "signature_type": "Function",
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@ced8ce3c83a7150c5f5d371a8c332d7bc7f9b66d",
        "target": {
            "file": "lib/rhashtable.c",
            "function": "rhashtable_insert_one"
        }
    },
    {
        "id": "CVE-2024-58042-9c11f53a",
        "signature_version": "v1",
        "digest": {
            "threshold": 0.9,
            "line_hashes": [
                "223056297797469068129923415995305903954",
                "32317662168620594970423875137027884121",
                "208090636542956041733562398443755084642",
                "120096284512893548467381534977826122391",
                "223873748064708716819641584977760624338",
                "29103439236444338965090764122663370772",
                "80665815293363457496834462403475217562",
                "269899265590667727184354298572609376066",
                "136396389024749919092195844014698741280",
                "190366418368280585543867117221324181373"
            ]
        },
        "deprecated": false,
        "signature_type": "Line",
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e1d3422c95f003eba241c176adfe593c33e8a8f6",
        "target": {
            "file": "lib/rhashtable.c"
        }
    },
    {
        "id": "CVE-2024-58042-a026b43f",
        "signature_version": "v1",
        "digest": {
            "length": 910.0,
            "function_hash": "96501448758386542613020059054977019723"
        },
        "deprecated": false,
        "signature_type": "Function",
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@ced8ce3c83a7150c5f5d371a8c332d7bc7f9b66d",
        "target": {
            "file": "lib/rhashtable.c",
            "function": "rhashtable_try_insert"
        }
    },
    {
        "id": "CVE-2024-58042-a597016c",
        "signature_version": "v1",
        "digest": {
            "threshold": 0.9,
            "line_hashes": [
                "223056297797469068129923415995305903954",
                "32317662168620594970423875137027884121",
                "208090636542956041733562398443755084642",
                "120096284512893548467381534977826122391",
                "223873748064708716819641584977760624338",
                "29103439236444338965090764122663370772",
                "80665815293363457496834462403475217562",
                "269899265590667727184354298572609376066",
                "136396389024749919092195844014698741280",
                "190366418368280585543867117221324181373"
            ]
        },
        "deprecated": false,
        "signature_type": "Line",
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@ced8ce3c83a7150c5f5d371a8c332d7bc7f9b66d",
        "target": {
            "file": "lib/rhashtable.c"
        }
    },
    {
        "id": "CVE-2024-58042-e7fdbc27",
        "signature_version": "v1",
        "digest": {
            "length": 910.0,
            "function_hash": "96501448758386542613020059054977019723"
        },
        "deprecated": false,
        "signature_type": "Function",
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e1d3422c95f003eba241c176adfe593c33e8a8f6",
        "target": {
            "file": "lib/rhashtable.c",
            "function": "rhashtable_try_insert"
        }
    }
]

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
6.12.0
Fixed
6.12.13
Type
ECOSYSTEM
Events
Introduced
6.13.0
Fixed
6.13.2