[PATCH v2 3/5] ntsync: reject wait ioctls with zero owner
Elizabeth Figura <[email protected]> Thu, 23 Jul 2026 15:12:59 -0500
| Newsgroups | gmane.linux.kernel.api,gmane.linux.kernel,gmane.comp.emulators.wine.devel,gmane.linux.documentation |
|---|---|
| Message-ID | <[email protected]> |
From: Iván Ezequiel Rodriguez <[email protected]> setup_wait() already validates pad and flags but not owner, while Documentation/userspace-api/ntsync.rst requires EINVAL when owner is zero. Reject early before queueing waiters. Signed-off-by: Iván Ezequiel Rodriguez <[email protected]> Reviewed-by: Elizabeth Figura <[email protected]> Signed-off-by: Elizabeth Figura <[email protected]> --- drivers/misc/ntsync.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/misc/ntsync.c b/drivers/misc/ntsync.c index 02c9d1192812..4a805919bb0c 100644 --- a/drivers/misc/ntsync.c +++ b/drivers/misc/ntsync.c @@ -875,6 +875,9 @@ static int setup_wait(struct ntsync_device *dev, if (args->pad || (args->flags & ~NTSYNC_WAIT_REALTIME)) return -EINVAL; + if (!args->owner) + return -EINVAL; + if (size >= sizeof(fds)) return -EINVAL; -- 2.53.0