The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Chris Down <chris@chrisdown.name>
To: Pasha Tatashin <pasha.tatashin@soleen.com>,
	Mike Rapoport <rppt@kernel.org>,
	Pratyush Yadav <pratyush@kernel.org>
Cc: Shuah Khan <shuah@kernel.org>,
	Shuah Khan <skhan@linuxfoundation.org>,
	linux-kselftest@vger.kernel.org, kexec@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-api@vger.kernel.org,
	sashiko-bot@kernel.org, kernel-team@meta.com
Subject: [PATCH v2 0/2] liveupdate: Return -ENOTTY for unknown ioctl numbers
Date: Wed, 02 Dec 2026 14:44:38 -0800	[thread overview]
Message-ID: <cover.1796251200.git.chris@chrisdown.name> (raw)

luo_ioctl() and luo_session_ioctl() return -EINVAL for a command number
outside their ops table, but ENOTTY for an in-table number whose full
command does not match. That contradicts the errno contract in
include/uapi/linux/liveupdate.h, and it means a program cannot tell an
ioctl the kernel does not have from a known ioctl with a bad argument.
It also makes isatty() on a LUO fd fail with EINVAL instead of ENOTTY.

Patch 1 returns -ENOIOCTLCMD for out-of-range numbers too. Patch 2 adds
a selftest for it.

v2:

- Name the command numbers the selftest uses, and drop 0x3f on
  /dev/liveupdate, since it tests the same thing as 0xff there (Pratyush)

v1: https://lore.kernel.org/r/cover.1796194107.git.chris@chrisdown.name

Chris Down (2):
  liveupdate: Return -ENOTTY for unknown ioctl numbers
  selftests/liveupdate: Test ENOTTY for unknown ioctl numbers

 kernel/liveupdate/luo_core.c                  |  2 +-
 kernel/liveupdate/luo_session.c               |  2 +-
 .../testing/selftests/liveupdate/liveupdate.c | 39 +++++++++++++++++++
 3 files changed, 41 insertions(+), 2 deletions(-)


base-commit: 073b7942a9a5998875c2e65a4c243212206713c2
-- 
2.56.1


             reply	other threads:[~2026-12-02 22:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02 22:44 Chris Down [this message]
2026-12-02 22:44 ` [PATCH v2 1/2] liveupdate: Return -ENOTTY for unknown ioctl numbers Chris Down
2026-12-02 22:44 ` [PATCH v2 2/2] selftests/liveupdate: Test ENOTTY " Chris Down

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=cover.1796251200.git.chris@chrisdown.name \
    --to=chris@chrisdown.name \
    --cc=kernel-team@meta.com \
    --cc=kexec@lists.infradead.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=pasha.tatashin@soleen.com \
    --cc=pratyush@kernel.org \
    --cc=rppt@kernel.org \
    --cc=sashiko-bot@kernel.org \
    --cc=shuah@kernel.org \
    --cc=skhan@linuxfoundation.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