[PATCH 0/2] liveupdate: Return -ENOTTY for unknown ioctl numbers

From: Chris Down

Date: Wed Dec 02 2026 - 01:53:49 EST


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