Skip to content

liveupdate: Return -ENOTTY for unknown ioctl numbers

Chris Down kexec linux-api linux-kselftest lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2liveupdate: Return -ENOTTY for unknown ioctl numberskernel/liveupdate/luo_core.c kernel/liveupdate/luo_session.c+2 -21 reply
2/2selftests/liveupdate: Test ENOTTY for unknown ioctl numberstools/testing/selftests/liveupdate/liveupdate.c+35 -01 reply

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchPratyush Yadav
1/2R-b
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

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

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

Signature · 1 line
2.56.1