CVE-2024-49941

Source
https://nvd.nist.gov/vuln/detail/CVE-2024-49941
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2024-49941.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2024-49941
Downstream
Related
Published
2024-10-21T18:02:00Z
Modified
2025-10-15T00:48:46.025940Z
Summary
gpiolib: Fix potential NULL pointer dereference in gpiod_get_label()
Details

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

gpiolib: Fix potential NULL pointer dereference in gpiodgetlabel()

In gpiod_get_label(), it is possible that srcu_dereference_check() may return a NULL pointer, leading to a scenario where label->str is accessed without verifying if label itself is NULL.

This patch adds a proper NULL check for label before accessing label->str. The check for label->str != NULL is removed because label->str can never be NULL if label is not NULL.

This fixes the issue where the label name was being printed as (efault) when dumping the sysfs GPIO file when label == NULL.

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
a86d27693066a34a29be86f394bbad847b2d1749
Fixed
9ee4b907d7a5d7a53b4ff7727c371ff3d44ccbbb
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
a86d27693066a34a29be86f394bbad847b2d1749
Fixed
7b99b5ab885993bff010ebcd93be5e511c56e28a

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.11
v6.11-rc1
v6.11-rc2
v6.11-rc3
v6.11-rc4
v6.11-rc5
v6.11-rc6
v6.11-rc7
v6.11.1
v6.11.2
v6.12-rc1
v6.9
v6.9-rc7

Database specific

{
    "vanir_signatures": [
        {
            "target": {
                "file": "drivers/gpio/gpiolib.c"
            },
            "signature_version": "v1",
            "id": "CVE-2024-49941-2c3b9539",
            "digest": {
                "threshold": 0.9,
                "line_hashes": [
                    "209731718547525536752615315586207258815",
                    "65222427989559660498839040999914593402",
                    "75538254094967050261439030848066236098",
                    "73452436810055314452489493893828319427",
                    "156638843572205955157019908623485477537",
                    "225764364592085021441495787537815952598",
                    "19157285074345291044567042644968801635"
                ]
            },
            "deprecated": false,
            "signature_type": "Line",
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9ee4b907d7a5d7a53b4ff7727c371ff3d44ccbbb"
        },
        {
            "target": {
                "file": "drivers/gpio/gpiolib.c",
                "function": "gpiod_get_label"
            },
            "signature_version": "v1",
            "id": "CVE-2024-49941-61d30de1",
            "digest": {
                "length": 382.0,
                "function_hash": "115040444243295126955704068271069573826"
            },
            "deprecated": false,
            "signature_type": "Function",
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7b99b5ab885993bff010ebcd93be5e511c56e28a"
        },
        {
            "target": {
                "file": "drivers/gpio/gpiolib.c"
            },
            "signature_version": "v1",
            "id": "CVE-2024-49941-cf7c79b0",
            "digest": {
                "threshold": 0.9,
                "line_hashes": [
                    "209731718547525536752615315586207258815",
                    "65222427989559660498839040999914593402",
                    "75538254094967050261439030848066236098",
                    "73452436810055314452489493893828319427",
                    "156638843572205955157019908623485477537",
                    "225764364592085021441495787537815952598",
                    "19157285074345291044567042644968801635"
                ]
            },
            "deprecated": false,
            "signature_type": "Line",
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7b99b5ab885993bff010ebcd93be5e511c56e28a"
        },
        {
            "target": {
                "file": "drivers/gpio/gpiolib.c",
                "function": "gpiod_get_label"
            },
            "signature_version": "v1",
            "id": "CVE-2024-49941-dc3b4e66",
            "digest": {
                "length": 382.0,
                "function_hash": "115040444243295126955704068271069573826"
            },
            "deprecated": false,
            "signature_type": "Function",
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9ee4b907d7a5d7a53b4ff7727c371ff3d44ccbbb"
        }
    ]
}

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
6.9.0
Fixed
6.11.3