{"id":2223501,"url":"http://patchwork.ozlabs.org/api/1.2/patches/2223501/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-gpio/patch/20260415-6-12-gpiolib-cve-2026-22986-v1-1-3a7a6de332eb@cherry.de/","project":{"id":42,"url":"http://patchwork.ozlabs.org/api/1.2/projects/42/?format=json","name":"Linux GPIO development","link_name":"linux-gpio","list_id":"linux-gpio.vger.kernel.org","list_email":"linux-gpio@vger.kernel.org","web_url":"","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20260415-6-12-gpiolib-cve-2026-22986-v1-1-3a7a6de332eb@cherry.de>","list_archive_url":null,"date":"2026-04-15T11:15:40","name":"[6.12.y,1/2] gpiolib: unify two loops initializing GPIO descriptors","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"83c5304b42f2eeb9528bfc8415a2ed685edff837","submitter":{"id":82991,"url":"http://patchwork.ozlabs.org/api/1.2/people/82991/?format=json","name":"Quentin Schulz","email":"foss+kernel@0leil.net"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linux-gpio/patch/20260415-6-12-gpiolib-cve-2026-22986-v1-1-3a7a6de332eb@cherry.de/mbox/","series":[{"id":499972,"url":"http://patchwork.ozlabs.org/api/1.2/series/499972/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-gpio/list/?series=499972","date":"2026-04-15T11:15:39","name":"gpiolib: backport fa17f749ee5b and a7ac22d53d09","version":1,"mbox":"http://patchwork.ozlabs.org/series/499972/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2223501/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2223501/checks/","tags":{},"related":[],"headers":{"Return-Path":"\n <linux-gpio+bounces-35170-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-gpio@vger.kernel.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=0leil.net header.i=@0leil.net header.a=rsa-sha256\n header.s=20231125 header.b=jzkL3baO;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=linux-gpio+bounces-35170-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=0leil.net header.i=@0leil.net\n header.b=\"jzkL3baO\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=84.16.66.169","smtp.subspace.kernel.org;\n dmarc=pass (p=reject dis=none) header.from=0leil.net","smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=0leil.net"],"Received":["from sea.lore.kernel.org (sea.lore.kernel.org\n [IPv6:2600:3c0a:e001:db::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fwfk32vXGz1yHM\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 15 Apr 2026 21:56:11 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id 981CD3019070\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 15 Apr 2026 11:55:14 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 5BEDA37AA8B;\n\tWed, 15 Apr 2026 11:55:13 +0000 (UTC)","from smtp-42a9.mail.infomaniak.ch (smtp-42a9.mail.infomaniak.ch\n [84.16.66.169])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 165CC3264EA\n\tfor <linux-gpio@vger.kernel.org>; Wed, 15 Apr 2026 11:55:09 +0000 (UTC)","from smtp-4-0001.mail.infomaniak.ch (smtp-4-0001.mail.infomaniak.ch\n [10.7.10.108])\n\tby smtp-4-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4fwdqs0QYYzyg7;\n\tWed, 15 Apr 2026 13:16:09 +0200 (CEST)","from unknown by smtp-4-0001.mail.infomaniak.ch (Postfix) with ESMTPA\n id 4fwdqr2RXwzwZ0;\n\tWed, 15 Apr 2026 13:16:08 +0200 (CEST)"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1776254113; cv=none;\n b=ePHSm7NNrGPhnnaYLXBkSxsLPUaoxrY5UiQQDClloGvBT1JvTXk6NHSXy5j2NwqXlEI647fiLvYCb6KwbPyw63O1csgJgTQ35iqbHG0Qw9DnByjeF2tbB1ECIRrUHZ1LplYI7SXEPzoCaNo8L7jwJ8+EG+aaGDY2lJWDfkzb9sw=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1776254113; c=relaxed/simple;\n\tbh=FwK7aiO0RWft5Qk9rOII/R/wsjA8XT8FnotMP7tgGJs=;\n\th=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References:\n\t In-Reply-To:To:Cc;\n b=K/U6f2cdJE9v9z3eTvsHSA0OZnO0vF6IJ6CMtikDVFcwJz7knbINIl/1/Hb/MlnLSzGd242GyOT6H+pa0a9VMNM7nRSzc6SZFP+g0tbqCMEOOmx90FG2NNG44nDtN7D1bHBaZXAhytJighkKzNrF9fbr3PXEo74BBOZGvPOuRrw=","ARC-Authentication-Results":"i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=reject dis=none) header.from=0leil.net;\n spf=pass smtp.mailfrom=0leil.net;\n dkim=pass (2048-bit key) header.d=0leil.net header.i=@0leil.net\n header.b=jzkL3baO; arc=none smtp.client-ip=84.16.66.169","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=0leil.net;\n\ts=20231125; t=1776251768;\n\tbh=E5uIj97XCDhQeYrBq3CgyTfmjr97TvL+zt9wLLTXNA0=;\n\th=From:Date:Subject:References:In-Reply-To:To:Cc:From;\n\tb=jzkL3baO24uAcq/8TGIozu9CbZeTtjOvG5NW4pWsaMSlba3J1NugL7XoakGdSioc5\n\t LW4sDTIq91g6CJmbGrM8KuZswyOVaX03xK4NQyktWqiAmybeZag0CnvJ+SDlA3tgRq\n\t 2DyOENdBNLIVCuvlAHfOPZFTj6yx0zi3aa+L6M/64ywv+v22NN3UV71mk4Apj217Kw\n\t ecONrF9XInFBVtXHgCYIdKuNApTrbce1ExnBYmAAWb6Jb299oHnDlH0U61HsRu51cV\n\t GOEJPmFHCWBgH8rwE47hFV8LO/fEBXd5yrLuAcrDCHnumUVi9Ifk4lyHVufkT/hMVB\n\t JEZaWvl5TkA+Q==","From":"Quentin Schulz <foss+kernel@0leil.net>","Date":"Wed, 15 Apr 2026 13:15:40 +0200","Subject":"[PATCH 6.12.y 1/2] gpiolib: unify two loops initializing GPIO\n descriptors","Precedence":"bulk","X-Mailing-List":"linux-gpio@vger.kernel.org","List-Id":"<linux-gpio.vger.kernel.org>","List-Subscribe":"<mailto:linux-gpio+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-gpio+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"7bit","Message-Id":"<20260415-6-12-gpiolib-cve-2026-22986-v1-1-3a7a6de332eb@cherry.de>","References":"<20260415-6-12-gpiolib-cve-2026-22986-v1-0-3a7a6de332eb@cherry.de>","In-Reply-To":"\n <20260415-6-12-gpiolib-cve-2026-22986-v1-0-3a7a6de332eb@cherry.de>","To":"Linus Walleij <linus.walleij@linaro.org>,\n Bartosz Golaszewski <brgl@bgdev.pl>,\n Andy Shevchenko <andriy.shevchenko@linux.intel.com>","Cc":"Heiko Stuebner <heiko.stuebner@cherry.de>, stable@vger.kernel.org,\n linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,\n Bartosz Golaszewski <bartosz.golaszewski@linaro.org>,\n Quentin Schulz <quentin.schulz@cherry.de>,\n Kent Gibson <warthog618@gmail.com>","X-Mailer":"b4 0.15-dev-47773","X-Infomaniak-Routing":"alpha"},"content":"From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>\n\n[ Upstream commit fa17f749ee5bc6afdaa9e0ddbe6a816b490dad7d ]\n\nWe currently iterate over the descriptors owned by the GPIO device we're\nadding twice with the first loop just setting the gdev pointer. It's not\nused anywhere between this and the second loop so just drop the first\none and move the assignment to the second.\n\nReviewed-by: Kent Gibson <warthog618@gmail.com>\nLink: https://lore.kernel.org/r/20241004-gpio-notify-in-kernel-events-v1-2-8ac29e1df4fe@linaro.org\nSigned-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>\nCc: stable@vger.kernel.org # 6.12\nSigned-off-by: Quentin Schulz <quentin.schulz@cherry.de>\n---\n drivers/gpio/gpiolib.c | 5 ++---\n 1 file changed, 2 insertions(+), 3 deletions(-)","diff":"diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c\nindex 967ff661e4c96..3f9019cc832ac 100644\n--- a/drivers/gpio/gpiolib.c\n+++ b/drivers/gpio/gpiolib.c\n@@ -1026,9 +1026,6 @@ int gpiochip_add_data_with_key(struct gpio_chip *gc, void *data,\n \t\t}\n \t}\n \n-\tfor (desc_index = 0; desc_index < gc->ngpio; desc_index++)\n-\t\tgdev->descs[desc_index].gdev = gdev;\n-\n \tBLOCKING_INIT_NOTIFIER_HEAD(&gdev->line_state_notifier);\n \tBLOCKING_INIT_NOTIFIER_HEAD(&gdev->device_notifier);\n \n@@ -1058,6 +1055,8 @@ int gpiochip_add_data_with_key(struct gpio_chip *gc, void *data,\n \tfor (desc_index = 0; desc_index < gc->ngpio; desc_index++) {\n \t\tstruct gpio_desc *desc = &gdev->descs[desc_index];\n \n+\t\tdesc->gdev = gdev;\n+\n \t\tif (gc->get_direction && gpiochip_line_is_valid(gc, desc_index)) {\n \t\t\tassign_bit(FLAG_IS_OUT,\n \t\t\t\t   &desc->flags, !gc->get_direction(gc, desc_index));\n","prefixes":["6.12.y","1/2"]}