mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Danish Khateeb <danishkhateeb03@gmail.com>
To: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>,
	Linus Walleij <linusw@kernel.org>
Cc: Shuah Khan <shuah@kernel.org>,
	Bamvor Jian Zhang <bamv2005@gmail.com>,
	Tzung-Bi Shih <tzungbi@kernel.org>,
	Samuel Moelius <sam.moelius@trailofbits.com>,
	linux-gpio@vger.kernel.org, linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Danish Khateeb <danishkhateeb03@gmail.com>
Subject: [PATCH 1/2] selftests: gpio: enable GPIO_CDEV_V1 for gpio-cdev-uaf
Date: Wed, 30 Sep 2026 21:16:08 -0500	[thread overview]
Message-ID: <20261001021609.167505-1-danishkhateeb03@gmail.com> (raw)

gpio-cdev-uaf.sh also tests linehandle and lineevent file descriptors,
which only exist with CONFIG_GPIO_CDEV_V1. Since commit 7673e4c7f7f9
("Do not enable the v1 uAPI by default") that option is off unless
asked for, and the gpio selftest config doesn't ask for it. Built with
that config, GPIO_GET_LINEHANDLE_IOCTL fails with EINVAL and the test
stops at its second step:

  # 2. linehandle
  # 2.1. ioctl
  # failed to get handle FD
  # failed to test handle ioctl
  # GPIO gpio-cdev-uaf test FAIL

Add the option to the config.

Fixes: c7f92042d3f3 ("selftests: gpio: Add gpio-cdev-uaf tests")
Assisted-by: LLM
Signed-off-by: Danish Khateeb <danishkhateeb03@gmail.com>
---

Notes:
    Tested on v7.3-rc5 (x86_64, KASAN and lockdep, virtme-ng) with a
    kernel config merged with tools/testing/selftests/gpio/config:
    - current config (GPIO_CDEV_V1 not set): gpio-cdev-uaf.sh fails at
      "2.1. ioctl" as above.
    - with this patch (GPIO_CDEV_V1=y is the only config change):
      gpio-cdev-uaf.sh passes, as does gpio-mockup.sh -t cdev_v1 (with
      2/2). No KASAN or lockdep reports.

 tools/testing/selftests/gpio/config | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/testing/selftests/gpio/config b/tools/testing/selftests/gpio/config
index 1287abeaac7e..54cf6484441b 100644
--- a/tools/testing/selftests/gpio/config
+++ b/tools/testing/selftests/gpio/config
@@ -1,5 +1,6 @@
 CONFIG_GPIOLIB=y
 CONFIG_GPIO_CDEV=y
+CONFIG_GPIO_CDEV_V1=y
 CONFIG_GPIO_MOCKUP=m
 CONFIG_GPIO_SIM=m
 CONFIG_GPIO_AGGREGATOR=m
-- 
2.55.0


             reply	other threads:[~2026-10-01  2:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-01  2:16 Danish Khateeb [this message]
2026-10-01  2:16 ` [PATCH 2/2] selftests: gpio: expect gpio-mockup to reject a range with no lines Danish Khateeb

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261001021609.167505-1-danishkhateeb03@gmail.com \
    --to=danishkhateeb03@gmail.com \
    --cc=bamv2005@gmail.com \
    --cc=bartosz.golaszewski@oss.qualcomm.com \
    --cc=linusw@kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=sam.moelius@trailofbits.com \
    --cc=shuah@kernel.org \
    --cc=tzungbi@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®