Skip to content

ntsync documentation, selftests, and owner validation

Iván Ezequiel Rodriguez lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4docs: ntsync: align uAPI ioctl names and struct layout with ntsync.hDocumentation/userspace-api/ntsync.rst+11 -111 reply
2/4selftests: ntsync: fix wake_all CREATE_EVENT fd expectationtools/testing/selftests/drivers/ntsync/ntsync.c+1 -11 reply
3/4selftests: ntsync: add wait argument validation teststools/testing/selftests/drivers/ntsync/ntsync.c+44 -01 reply
4/4ntsync: reject wait ioctls with zero ownerdrivers/misc/ntsync.c+3 -01 reply

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchElizabeth Figura
1/4R-b
2/4R-b
3/4R-b
4/4R-b

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/4] ntsync documentation, selftests, and owner validation

This series improves ntsync without changing wait/wake semantics:

1/4 — Align Documentation/userspace-api/ntsync.rst with
include/uapi/linux/ntsync.h (ioctl macro names and struct layout).

2/4 — Fix wake_all selftest: CREATE_EVENT returns an fd, not zero.

3/4 — Add selftests for documented EINVAL cases (zero owner, non-zero
pad, cross-instance object use).

4/4 — Reject wait ioctls when owner is zero, matching the documented
uAPI (3/4 depends on 4/4 for the owner tests).

Patch 4/4 closes a spec gap: Documentation/userspace-api/ntsync.rst requires EINVAL when wait owner is zero, but setup_wait() only validated pad and flags. Unlock/kill mutex ioctls already reject owner == 0.

Testing:
- scripts/checkpatch.pl --strict --no-tree: clean (4/4 patches)
- make headers && make -C tools/testing/selftests TARGETS=drivers/ntsync
- Kernel 7.1.0-ntsync-test+ (CONFIG_NTSYNC=y), QEMU x86_64 initramfs:
tools/testing/selftests/drivers/ntsync/ntsync — 12/12 PASS, including wake_all and wait_args_validation
- On 6.17.0-35-generic with the distro ntsync.ko (without patch 4/4):
wait_args_validation fails on owner==0 (wait proceeds instead of EINVAL), confirming the gap this series fixes

Elizabeth Figura <[email protected]>
[email protected]

---
 Documentation/userspace-api/ntsync.rst         | 22 +++++-----
 tools/testing/selftests/drivers/ntsync/ntsync.c | 45 ++++++++++++++++++++
 drivers/misc/ntsync.c                          |  3 ++
 3 files changed, 59 insertions(+), 11 deletions(-)

Iván Ezequiel Rodriguez (4):
docs: ntsync: align uAPI ioctl names and struct layout with ntsync.h
selftests: ntsync: fix wake_all CREATE_EVENT fd expectation
selftests: ntsync: add wait argument validation tests
ntsync: reject wait ioctls with zero owner

--
2.43.0