gpiolib: Fix crash on error in gpiochip_get_ngpios()
In the Linux kernel, the following vulnerability has been resolved: gpiolib: Fix crash on error in gpiochip_get_ngpios() The gpiochip_get_ngpios() uses chip_*() macros to print messages. However these macros rely on gpiodev to be initialised and set, which is not the case when called via bgpio_init(). In such a case the printing messages will crash on NULL pointer dereference. Replace chip_*() macros by the respective dev_*() ones to avoid such crash.
- Products
- Kernel
- Affected versions
- Not specified
- Fixed versions
- 6.12.16, 6.13.4, 6.6.79
- CVEs
- CVE-2025-21783
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 4 Nov 2026, 16:18 UTC · Revision 1
Source evidence
gpiolib: Fix crash on error in gpiochip_get_ngpios()
core-osv · Original sourcePublished 27 Feb 2025, 02:18 UTC
In the Linux kernel, the following vulnerability has been resolved: gpiolib: Fix crash on error in gpiochip_get_ngpios() The gpiochip_get_ngpios() uses chip_*() macros to print messages. However these macros rely on gpiodev to be initialised and set, which is not the case when called via bgpio_init(). In such a case the printing messages will crash on NULL pointer dereference. Replace chip_*() macros by the respective dev_*() ones to avoid such crash.
osv:CVE-2025-21783
Kernel
Fixed versions: 6.6.79, 6.12.16, 6.13.4
Complete source record
{
"id": "188516e6e37e1f0c93a25a9faf6b842680b9bdaa7b4c37d187b0cb8d70121d87",
"url": "https://osv.dev/vulnerability/CVE-2025-21783",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "gpiolib: Fix crash on error in gpiochip_get_ngpios()",
"summary": "In the Linux kernel, the following vulnerability has been resolved: gpiolib: Fix crash on error in gpiochip_get_ngpios() The gpiochip_get_ngpios() uses chip_*() macros to print messages. However these macros rely on gpiodev to be initialised and set, which is not the case when called via bgpio_init(). In such a case the printing messages will crash on NULL pointer dereference. Replace chip_*() macros by the respective dev_*() ones to avoid such crash.",
"evidence": "osv:CVE-2025-21783",
"products": [
{
"name": {
"value": "Kernel",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "6.6.79",
"evidence": "/affected/1/ranges"
},
{
"value": "6.12.16",
"evidence": "/affected/1/ranges"
},
{
"value": "6.13.4",
"evidence": "/affected/1/ranges"
}
],
"affected_versions": []
}
],
"severity": "medium",
"structured": {
"id": "CVE-2025-21783",
"aliases": [
"CVE-2025-21783"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"type": "GIT",
"events": [
{
"introduced": "55b2395e4e92adc492c6b30ac109eb78250dcd9d"
},
{
"fixed": "4d9b2b62e1136d10f661ec4c0c268140b6f74f4f"
},
{
"fixed": "a7052afa9eae2239e25943baa8817a6a56e8aa68"
},
{
"fixed": "189fb76215e479c10731baabb50f1a352d2078f5"
},
{
"fixed": "7b4aebeecbbd5b5fe73e35fad3f62ed21aa7ef44"
}
]
}
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-21783.json"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.6.0"
},
{
"fixed": "6.6.79"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.7.0"
},
{
"fixed": "6.12.16"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.13.0"
},
{
"fixed": "6.13.4"
}
]
}
],
"package": {
"name": "Kernel",
"ecosystem": "Linux"
},
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-21783.json"
}
}
],
"modified": "2026-10-28T02:30:37.416810122Z",
"provider": "osv",
"references": [
"https://git.kernel.org/stable/c/189fb76215e479c10731baabb50f1a352d2078f5",
"https://git.kernel.org/stable/c/4d9b2b62e1136d10f661ec4c0c268140b6f74f4f",
"https://git.kernel.org/stable/c/7b4aebeecbbd5b5fe73e35fad3f62ed21aa7ef44",
"https://git.kernel.org/stable/c/a7052afa9eae2239e25943baa8817a6a56e8aa68",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/21xxx/CVE-2025-21783.json",
"https://nvd.nist.gov/vuln/detail/CVE-2025-21783",
"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
],
"provider_metadata": {
"cna_assigner": "Linux",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/21xxx/CVE-2025-21783.json"
}
},
"related_cves": [
{
"value": "CVE-2025-21783",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 504602,
"published_at": "2025-02-27T02:18:24.98+00:00"
}