In the Linux kernel, the following vulnerability has been resolved:
regulator: gpio: Fix the out-of-bounds access to drvdata::gpiods
drvdata::gpiods is supposed to hold an array of 'gpio_desc' pointers. But the memory is allocated for only one pointer. This will lead to out-of-bounds access later in the code if 'config::ngpios' is > 1. So fix the code to allocate enough memory to hold 'config::ngpios' of GPIO descriptors.
While at it, also move the check for memory allocation failure to be below the allocation to make it more readable.
[
{
"id": "CVE-2025-38395-0544202d",
"signature_type": "Line",
"deprecated": false,
"target": {
"file": "drivers/regulator/gpio-regulator.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@24418bc77a66cb5be9f5a837431ba3674ed8b52f",
"signature_version": "v1",
"digest": {
"line_hashes": [
"45883524069660879235908312969977402442",
"275841463946487295983451998342851031017",
"17783121668757377001067219997717566495",
"60469218258666831143415098171812107760",
"309780668610029003232068151601182929403",
"153411804031070220024378348267132352260",
"328553375081196960010686897331251506353",
"159927551258423167166006023353909409137",
"296848077205886034027961988433324045742",
"122822941533719961096411649259012776804"
],
"threshold": 0.9
}
},
{
"id": "CVE-2025-38395-076d033e",
"signature_type": "Function",
"deprecated": false,
"target": {
"file": "drivers/regulator/gpio-regulator.c",
"function": "gpio_regulator_probe"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e4d19e5d71b217940e33f2ef6c6962b7b68c5606",
"signature_version": "v1",
"digest": {
"length": 2770.0,
"function_hash": "253489039738599316462105660371228098469"
}
},
{
"id": "CVE-2025-38395-10b2ad74",
"signature_type": "Line",
"deprecated": false,
"target": {
"file": "drivers/regulator/gpio-regulator.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e4d19e5d71b217940e33f2ef6c6962b7b68c5606",
"signature_version": "v1",
"digest": {
"line_hashes": [
"45883524069660879235908312969977402442",
"275841463946487295983451998342851031017",
"17783121668757377001067219997717566495",
"60469218258666831143415098171812107760",
"309780668610029003232068151601182929403",
"153411804031070220024378348267132352260",
"328553375081196960010686897331251506353",
"159927551258423167166006023353909409137",
"296848077205886034027961988433324045742",
"122822941533719961096411649259012776804"
],
"threshold": 0.9
}
},
{
"id": "CVE-2025-38395-1333e33c",
"signature_type": "Function",
"deprecated": false,
"target": {
"file": "drivers/regulator/gpio-regulator.c",
"function": "gpio_regulator_probe"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@a1e12fac214d4f49fcb186dbdf9c5592e7fa0a7a",
"signature_version": "v1",
"digest": {
"length": 2770.0,
"function_hash": "253489039738599316462105660371228098469"
}
},
{
"id": "CVE-2025-38395-3453baa4",
"signature_type": "Line",
"deprecated": false,
"target": {
"file": "drivers/regulator/gpio-regulator.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@3830ab97cda9599872625cc0dc7b00160193634f",
"signature_version": "v1",
"digest": {
"line_hashes": [
"45883524069660879235908312969977402442",
"275841463946487295983451998342851031017",
"17783121668757377001067219997717566495",
"60469218258666831143415098171812107760",
"309780668610029003232068151601182929403",
"153411804031070220024378348267132352260",
"328553375081196960010686897331251506353",
"159927551258423167166006023353909409137",
"296848077205886034027961988433324045742",
"122822941533719961096411649259012776804"
],
"threshold": 0.9
}
},
{
"id": "CVE-2025-38395-5a612c30",
"signature_type": "Function",
"deprecated": false,
"target": {
"file": "drivers/regulator/gpio-regulator.c",
"function": "gpio_regulator_probe"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@a3cd5ae7befbac849e0e0529c94ca04e8093cfd2",
"signature_version": "v1",
"digest": {
"length": 2770.0,
"function_hash": "253489039738599316462105660371228098469"
}
},
{
"id": "CVE-2025-38395-80c5a284",
"signature_type": "Function",
"deprecated": false,
"target": {
"file": "drivers/regulator/gpio-regulator.c",
"function": "gpio_regulator_probe"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@56738cbac3bbb1d39a71a07f57484dec1db8b239",
"signature_version": "v1",
"digest": {
"length": 2770.0,
"function_hash": "253489039738599316462105660371228098469"
}
},
{
"id": "CVE-2025-38395-9fa9674b",
"signature_type": "Line",
"deprecated": false,
"target": {
"file": "drivers/regulator/gpio-regulator.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@a1e12fac214d4f49fcb186dbdf9c5592e7fa0a7a",
"signature_version": "v1",
"digest": {
"line_hashes": [
"45883524069660879235908312969977402442",
"275841463946487295983451998342851031017",
"17783121668757377001067219997717566495",
"60469218258666831143415098171812107760",
"309780668610029003232068151601182929403",
"153411804031070220024378348267132352260",
"328553375081196960010686897331251506353",
"159927551258423167166006023353909409137",
"296848077205886034027961988433324045742",
"122822941533719961096411649259012776804"
],
"threshold": 0.9
}
},
{
"id": "CVE-2025-38395-a5267df9",
"signature_type": "Function",
"deprecated": false,
"target": {
"file": "drivers/regulator/gpio-regulator.c",
"function": "gpio_regulator_probe"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@24418bc77a66cb5be9f5a837431ba3674ed8b52f",
"signature_version": "v1",
"digest": {
"length": 2770.0,
"function_hash": "253489039738599316462105660371228098469"
}
},
{
"id": "CVE-2025-38395-d55c5b3b",
"signature_type": "Line",
"deprecated": false,
"target": {
"file": "drivers/regulator/gpio-regulator.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@56738cbac3bbb1d39a71a07f57484dec1db8b239",
"signature_version": "v1",
"digest": {
"line_hashes": [
"45883524069660879235908312969977402442",
"275841463946487295983451998342851031017",
"17783121668757377001067219997717566495",
"60469218258666831143415098171812107760",
"309780668610029003232068151601182929403",
"153411804031070220024378348267132352260",
"328553375081196960010686897331251506353",
"159927551258423167166006023353909409137",
"296848077205886034027961988433324045742",
"122822941533719961096411649259012776804"
],
"threshold": 0.9
}
},
{
"id": "CVE-2025-38395-ddaa3c05",
"signature_type": "Line",
"deprecated": false,
"target": {
"file": "drivers/regulator/gpio-regulator.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@a3cd5ae7befbac849e0e0529c94ca04e8093cfd2",
"signature_version": "v1",
"digest": {
"line_hashes": [
"45883524069660879235908312969977402442",
"275841463946487295983451998342851031017",
"17783121668757377001067219997717566495",
"60469218258666831143415098171812107760",
"309780668610029003232068151601182929403",
"153411804031070220024378348267132352260",
"328553375081196960010686897331251506353",
"159927551258423167166006023353909409137",
"296848077205886034027961988433324045742",
"122822941533719961096411649259012776804"
],
"threshold": 0.9
}
},
{
"id": "CVE-2025-38395-e9faab8c",
"signature_type": "Function",
"deprecated": false,
"target": {
"file": "drivers/regulator/gpio-regulator.c",
"function": "gpio_regulator_probe"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@3830ab97cda9599872625cc0dc7b00160193634f",
"signature_version": "v1",
"digest": {
"length": 2770.0,
"function_hash": "253489039738599316462105660371228098469"
}
},
{
"id": "CVE-2025-38395-f2268661",
"signature_type": "Function",
"deprecated": false,
"target": {
"file": "drivers/regulator/gpio-regulator.c",
"function": "gpio_regulator_probe"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9fe71972869faed1f8f9b3beb9040f9c1b300c79",
"signature_version": "v1",
"digest": {
"length": 2521.0,
"function_hash": "336486891855170708216061133208347063079"
}
},
{
"id": "CVE-2025-38395-f60fa1f8",
"signature_type": "Line",
"deprecated": false,
"target": {
"file": "drivers/regulator/gpio-regulator.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9fe71972869faed1f8f9b3beb9040f9c1b300c79",
"signature_version": "v1",
"digest": {
"line_hashes": [
"45883524069660879235908312969977402442",
"275841463946487295983451998342851031017",
"97149879706969747534377493039359420593",
"52954820772751453592171769545192585966",
"39940666215976416293559918839893670621"
],
"threshold": 0.9
}
}
]