All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] liveupdate: Return -ENOTTY for unknown ioctl numbers
@ 2026-12-02 22:44 Chris Down
  2026-12-02 22:44 ` [PATCH v2 1/2] " Chris Down
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Chris Down @ 2026-12-02 22:44 UTC (permalink / raw)
  To: Pasha Tatashin, Mike Rapoport, Pratyush Yadav
  Cc: Shuah Khan, Shuah Khan, linux-kselftest, kexec, linux-kernel,
	linux-api, sashiko-bot, kernel-team

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-12-02 22:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-02 22:44 [PATCH v2 0/2] liveupdate: Return -ENOTTY for unknown ioctl numbers Chris Down
2026-12-02 22:44 ` [PATCH v2 1/2] " Chris Down
2026-12-02 22:44 ` [PATCH v2 2/2] selftests/liveupdate: Test ENOTTY " Chris Down
2026-12-02 22:52 ` [PATCH v2 0/2] liveupdate: Return -ENOTTY " sashiko-bot

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.