All of lore.kernel.org
 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
Subject: [PATCH 0/2] liveupdate: Return -ENOTTY for unknown ioctl numbers
Date: Tue, 01 Dec 2026 22:53:41 -0800	[thread overview]
Message-ID: <cover.1796194107.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.

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 | 35 +++++++++++++++++++
 3 files changed, 37 insertions(+), 2 deletions(-)


base-commit: ec459d99ed222228b3d601818fd1e24822a450d6
-- 
2.56.1


             reply	other threads:[~2026-12-02  6:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02  6:53 Chris Down [this message]
2026-12-02  6:53 ` [PATCH 1/2] liveupdate: Return -ENOTTY for unknown ioctl numbers Chris Down
2026-12-02  6:53 ` [PATCH 2/2] selftests/liveupdate: Test ENOTTY " Chris Down
2026-12-02  6:59 ` [PATCH 0/2] liveupdate: Return -ENOTTY " sashiko-bot

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.1796194107.git.chris@chrisdown.name \
    --to=chris@chrisdown.name \
    --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=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.