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

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



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

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

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-02  6:53 [PATCH 0/2] liveupdate: Return -ENOTTY for unknown ioctl numbers Chris Down
2026-12-02  6:53 ` [PATCH 1/2] " Chris Down
2026-12-02 10:16   ` Pratyush Yadav
2026-12-02  6:53 ` [PATCH 2/2] selftests/liveupdate: Test ENOTTY " Chris Down
2026-12-02 10:45   ` Pratyush Yadav
2026-12-02  6:59 ` [PATCH 0/2] liveupdate: Return -ENOTTY " sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox