{"id":"CVE-2026-143246","sourceIdentifier":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","published":"2026-12-03T10:18:04.123","lastModified":"2026-12-03T10:18:04.123","vulnStatus":"Received","cveTags":[],"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\ngpiolib: fix GPIO descriptor leak in gpiod_get_array()\n\nIn gpiod_get_array(), descs->ndescs is used as the loop induction\nvariable and is only incremented at the end of each iteration. When\nkrealloc() fails on the first iteration (when index is 0),\ndescs->desc[0] has already been acquired via gpiod_get_index(), but\ndescs->ndescs is still 0. Consequently, gpiod_put_array() frees descs\nwithout releasing descs->desc[0], leaking the descriptor.\n\nFix this by using a dedicated loop induction variable and incrementing\ndescs->ndescs immediately upon storing the retrieved descriptor.\nAdditionally, since the fast-path array_info setup only executes for the\nfirst element (index 0), simplify the bitmap_set() calls to start at bit\n0 for count bits instead of calculating offsets from the loop index."}],"affected":[{"source":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","affectedData":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","programFiles":["drivers/gpio/gpiolib.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","versions":[{"version":"bf9346f5d47b4506aafbc384dfb5796b0adc3f8d","lessThan":"5e22a760a23ee3298b525b1bc6b0647272d6bf4b","versionType":"git","status":"affected"},{"version":"bf9346f5d47b4506aafbc384dfb5796b0adc3f8d","lessThan":"233b889db63c316ec558db34ae15dcb4784dc39f","versionType":"git","status":"affected"},{"version":"bf9346f5d47b4506aafbc384dfb5796b0adc3f8d","lessThan":"b2a161687acdc297aa91fec7fa0966b5aecf0d16","versionType":"git","status":"affected"}]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","programFiles":["drivers/gpio/gpiolib.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","versions":[{"version":"4.20","status":"affected"},{"version":"0","lessThan":"4.20","versionType":"semver","status":"unaffected"},{"version":"6.18.66","lessThanOrEqual":"6.18.*","versionType":"semver","status":"unaffected"},{"version":"7.3.7","lessThanOrEqual":"7.3.*","versionType":"semver","status":"unaffected"},{"version":"7.4-rc3","lessThanOrEqual":"*","versionType":"original_commit_for_fix","status":"unaffected"}]}]}],"metrics":{},"references":[{"url":"https://git.kernel.org/stable/c/233b889db63c316ec558db34ae15dcb4784dc39f","source":"416baaa9-dc9f-4396-8d5f-8c081fb06d67"},{"url":"https://git.kernel.org/stable/c/5e22a760a23ee3298b525b1bc6b0647272d6bf4b","source":"416baaa9-dc9f-4396-8d5f-8c081fb06d67"},{"url":"https://git.kernel.org/stable/c/b2a161687acdc297aa91fec7fa0966b5aecf0d16","source":"416baaa9-dc9f-4396-8d5f-8c081fb06d67"}]}