{"id":2223485,"url":"http://patchwork.ozlabs.org/api/1.2/covers/2223485/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-gpio/cover/20260415-6-12-gpiolib-cve-2026-22986-v1-0-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-0-3a7a6de332eb@cherry.de>","list_archive_url":null,"date":"2026-04-15T11:15:39","name":"[6.12.y,0/2] gpiolib: backport fa17f749ee5b and a7ac22d53d09","submitter":{"id":82991,"url":"http://patchwork.ozlabs.org/api/1.2/people/82991/?format=json","name":"Quentin Schulz","email":"foss+kernel@0leil.net"},"mbox":"http://patchwork.ozlabs.org/project/linux-gpio/cover/20260415-6-12-gpiolib-cve-2026-22986-v1-0-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/covers/2223485/comments/","headers":{"Return-Path":"\n <linux-gpio+bounces-35165-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=miKOb32Y;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c04:e001:36c::12fc:5321; helo=tor.lore.kernel.org;\n envelope-from=linux-gpio+bounces-35165-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=\"miKOb32Y\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=83.166.143.175","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 tor.lore.kernel.org (tor.lore.kernel.org\n [IPv6:2600:3c04:e001:36c::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fwdtM0WNLz1yDF\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 15 Apr 2026 21:18:19 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby tor.lore.kernel.org (Postfix) with ESMTP id 40E6330E1B17\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 15 Apr 2026 11:16:30 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id C811437BE6C;\n\tWed, 15 Apr 2026 11:16:17 +0000 (UTC)","from smtp-8faf.mail.infomaniak.ch (smtp-8faf.mail.infomaniak.ch\n [83.166.143.175])\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 ED21537AA78\n\tfor <linux-gpio@vger.kernel.org>; Wed, 15 Apr 2026 11:16:15 +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 4fwdqr3HzgzxMX;\n\tWed, 15 Apr 2026 13:16:08 +0200 (CEST)","from unknown by smtp-4-0001.mail.infomaniak.ch (Postfix) with ESMTPA\n id 4fwdqq02pRzv9G;\n\tWed, 15 Apr 2026 13:16:06 +0200 (CEST)"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1776251777; cv=none;\n b=tlxP4GZMUz4urKm4Wu9HxoI5Xsjkfs4XqEkNHAcRDGVQEL+R+kFHIpSTgqzhT2yGFVdIZSzc7+zUuog9QLPGh+Eo4nkmgpIlj2BbQ1ojod8YPAPHiwJz8pd9qC7akZBtDdmUt3tA57u269swQeLvriRhhbHb2in0jp0SYtDTPQE=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1776251777; c=relaxed/simple;\n\tbh=H2x1lln5ugRuhbvN9TZ84Wo/S7v5rtbx5oU4HY5nFIY=;\n\th=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc;\n b=X1efIUsyOWWOaVaYfqT5tbMSqSahtHK/eOCklafmg+1JJvqqHh8YNRnDBiX6IlViWwNHZE0gcvnrg7aJOz3+8INxqa3LQqOaG3A5vd6bTS6ox6XFfwCZanLFTy5+39wjak38YwQi5VdhLNMF82ROPHuKk5y8r9AW5UsMpPiEw9I=","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=miKOb32Y; arc=none smtp.client-ip=83.166.143.175","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=0leil.net;\n\ts=20231125; t=1776251768;\n\tbh=0lVK8Rm2lzilyfbtzFHxL8+WN33t4Abpn2Ws9XDUDb8=;\n\th=From:Subject:Date:To:Cc:From;\n\tb=miKOb32YgKIwEKFd7U+z/LpG0mhkJZNOpA4AR5o3mekxVRzgh4v1R45RwY1o/A0HG\n\t b31MIh8RYCK9rMJav0UjKmQD9o35zxETqf7chWsrjxtdeNJ2TLBjADWKp2N3norMmU\n\t CEV0bnsbgbPwkZNQe/fESng1ivNA55h0szZ4Xkv1CWO9bB3iQLU4obkQnvBKPVRZcU\n\t irNwqkCTDQ7uAh6b33K977/zw8hqecvoT2ZqoVFAwOheU5tdhRHbRdqZPrnDnQT6+Q\n\t VQ11nHvvMM3InVW6M4F6DJTt89tMzVOSf5yweGWBdDm/HBlFN0HRUfyBUYvGjosWeb\n\t 7tZXm02/ca1yg==","From":"Quentin Schulz <foss+kernel@0leil.net>","Subject":"[PATCH 6.12.y 0/2] gpiolib: backport fa17f749ee5b and a7ac22d53d09","Date":"Wed, 15 Apr 2026 13:15:39 +0200","Message-Id":"<20260415-6-12-gpiolib-cve-2026-22986-v1-0-3a7a6de332eb@cherry.de>","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":"8bit","X-B4-Tracking":"v=1; b=H4sIAAAAAAAC/yXMQQ6CMBCF4auQWTukM2AjXsW4aOuAYwiQVomGc\n HcLLP/3km+BJFElwbVYIMqsScchB50KCE83dIL6yA1s2JqazmiRGLtJx149hllwe5C5uVhsja+\n rioJxjiALU5RWv7t+A1sSlz+4H3v6+JeE90bDuv4B7E4unocAAAA=","X-Change-ID":"20260415-6-12-gpiolib-cve-2026-22986-f0b4331c0aa1","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>,\n =?utf-8?q?Pawe=C5=82_Narewski?= <pawel.narewski@nokia.com>,\n  Jakub Lewalski <jakub.lewalski@nokia.com>,\n  Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>","X-Mailer":"b4 0.15-dev-47773","X-Infomaniak-Routing":"alpha"},"content":"Backport a7ac22d53d09 (\"gpiolib: fix race condition for gdev->srcu\") to\n6.12.y. To make the git context difference between commit a7ac22d53d09\nand its backport in 6.12.y smaller, also backport fa17f749ee5b\n(\"gpiolib: unify two loops initializing GPIO descriptors\").\n\na7ac22d53d09 fixes an issue reported as being present since 6.9. It's\nbeen fixed in 6.19 and backported to 6.18.y in fb674c8f1a5d8.\n\nThe git context difference could be even smaller if we also backported\nd4f335b410dd (\"gpiolib: rename GPIO chip printk macros\") but its\ncherry-pick conflicts so I decided to not include it for now. It was\nbackported to 6.18.y though (because it applied cleanly and helped\na7ac22d53d09 being cleanly applied as well, see\nhttps://lore.kernel.org/stable/2026011530-owl-savage-9b8e@gregkh/).\n\nThe changes between a7ac22d53d09 in v6.19 and the second patch of this\nseries is (according to git range-diff):\n\n\"\"\"\n      ## drivers/gpio/gpiolib.c ##\n     @@ drivers/gpio/gpiolib.c: int gpiochip_add_data_with_key(struct gpio_chip *gc, void *data,\n        gdev->ngpio = gc->ngpio;\n        gdev->can_sleep = gc->can_sleep;\n\n    -+  rwlock_init(&gdev->line_state_lock);\n    -+  RAW_INIT_NOTIFIER_HEAD(&gdev->line_state_notifier);\n    ++  BLOCKING_INIT_NOTIFIER_HEAD(&gdev->line_state_notifier);\n     +  BLOCKING_INIT_NOTIFIER_HEAD(&gdev->device_notifier);\n     +\n     +  ret = init_srcu_struct(&gdev->srcu);\n    @@ drivers/gpio/gpiolib.c: int gpiochip_add_data_with_key(struct gpio_chip *gc, voi\n     @@ drivers/gpio/gpiolib.c: int gpiochip_add_data_with_key(struct gpio_chip *gc, void *data,\n                ret = gpiodev_add_to_list_unlocked(gdev);\n                if (ret) {\n    -                   gpiochip_err(gc, \"GPIO integer space overlap, cannot add chip\\n\");\n    +                   chip_err(gc, \"GPIO integer space overlap, cannot add chip\\n\");\n     -                  goto err_free_label;\n     +                  goto err_cleanup_desc_srcu;\n                }\n        }\n\n    --  rwlock_init(&gdev->line_state_lock);\n    --  RAW_INIT_NOTIFIER_HEAD(&gdev->line_state_notifier);\n    +-  BLOCKING_INIT_NOTIFIER_HEAD(&gdev->line_state_notifier);\n     -  BLOCKING_INIT_NOTIFIER_HEAD(&gdev->device_notifier);\n     -\n     -  ret = init_srcu_struct(&gdev->srcu);\n\"\"\"\n\ns/gpiochip_err/chip_err/ aside, the rest of the diff comes from feature\ncommits which do not fit the rules for backporting to stable.\n\nSigned-off-by: Quentin Schulz <quentin.schulz@cherry.de>\n---\nBartosz Golaszewski (1):\n      gpiolib: unify two loops initializing GPIO descriptors\n\nPaweł Narewski (1):\n      gpiolib: fix race condition for gdev->srcu\n\n drivers/gpio/gpiolib.c | 43 +++++++++++++++++++++----------------------\n 1 file changed, 21 insertions(+), 22 deletions(-)\n---\nbase-commit: e7a3953084a7050ca349010deb22546834c2e196\nchange-id: 20260415-6-12-gpiolib-cve-2026-22986-f0b4331c0aa1\n\nBest regards,\n--  \nQuentin Schulz <quentin.schulz@cherry.de>"}