{"id":"CVE-2025-38395","summary":"regulator: gpio: Fix the out-of-bounds access to drvdata::gpiods","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nregulator: gpio: Fix the out-of-bounds access to drvdata::gpiods\n\ndrvdata::gpiods is supposed to hold an array of 'gpio_desc' pointers. But\nthe memory is allocated for only one pointer. This will lead to\nout-of-bounds access later in the code if 'config::ngpios' is \u003e 1. So\nfix the code to allocate enough memory to hold 'config::ngpios' of GPIO\ndescriptors.\n\nWhile at it, also move the check for memory allocation failure to be below\nthe allocation to make it more readable.","modified":"2026-05-18T05:57:28.571512296Z","published":"2025-07-25T12:53:39.933Z","related":["SUSE-SU-2025:02853-1","SUSE-SU-2025:02923-1","SUSE-SU-2025:02969-1","SUSE-SU-2025:02996-1","SUSE-SU-2025:02997-1","SUSE-SU-2025:03011-1","SUSE-SU-2025:03023-1","SUSE-SU-2025:20577-1","SUSE-SU-2025:20586-1","SUSE-SU-2025:20601-1","SUSE-SU-2025:20602-1","SUSE-SU-2025:21074-1","SUSE-SU-2025:21139-1","SUSE-SU-2025:21179-1","openSUSE-SU-2025:20081-1"],"database_specific":{"cna_assigner":"Linux","osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/38xxx/CVE-2025-38395.json"},"references":[{"type":"WEB","url":"https://git.kernel.org/stable/c/24418bc77a66cb5be9f5a837431ba3674ed8b52f"},{"type":"WEB","url":"https://git.kernel.org/stable/c/3830ab97cda9599872625cc0dc7b00160193634f"},{"type":"WEB","url":"https://git.kernel.org/stable/c/56738cbac3bbb1d39a71a07f57484dec1db8b239"},{"type":"WEB","url":"https://git.kernel.org/stable/c/9fe71972869faed1f8f9b3beb9040f9c1b300c79"},{"type":"WEB","url":"https://git.kernel.org/stable/c/a1e12fac214d4f49fcb186dbdf9c5592e7fa0a7a"},{"type":"WEB","url":"https://git.kernel.org/stable/c/a3cd5ae7befbac849e0e0529c94ca04e8093cfd2"},{"type":"WEB","url":"https://git.kernel.org/stable/c/c9764fd88bc744592b0604ccb6b6fc1a5f76b4e3"},{"type":"WEB","url":"https://git.kernel.org/stable/c/e4d19e5d71b217940e33f2ef6c6962b7b68c5606"},{"type":"WEB","url":"https://lists.debian.org/debian-lts-announce/2025/10/msg00007.html"},{"type":"WEB","url":"https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/38xxx/CVE-2025-38395.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-38395"},{"type":"PACKAGE","url":"https://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":"d6cd33ad71029a3f77ba1686caf55d4dea58d916"},{"fixed":"a3cd5ae7befbac849e0e0529c94ca04e8093cfd2"},{"fixed":"9fe71972869faed1f8f9b3beb9040f9c1b300c79"},{"fixed":"56738cbac3bbb1d39a71a07f57484dec1db8b239"},{"fixed":"a1e12fac214d4f49fcb186dbdf9c5592e7fa0a7a"},{"fixed":"24418bc77a66cb5be9f5a837431ba3674ed8b52f"},{"fixed":"e4d19e5d71b217940e33f2ef6c6962b7b68c5606"},{"fixed":"3830ab97cda9599872625cc0dc7b00160193634f"},{"fixed":"c9764fd88bc744592b0604ccb6b6fc1a5f76b4e3"}]}],"database_specific":{"source":"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2025-38395.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"5.1.0"},{"fixed":"5.4.296"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.5.0"},{"fixed":"5.10.240"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.11.0"},{"fixed":"5.15.187"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.16.0"},{"fixed":"6.1.144"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.2.0"},{"fixed":"6.6.97"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.7.0"},{"fixed":"6.12.37"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.13.0"},{"fixed":"6.15.6"}]}],"database_specific":{"source":"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2025-38395.json"}}],"schema_version":"1.7.5"}