Thread (6 messages) 6 messages, 1 author, 14h ago
DORMANTno replies REVIEWED: 1 (1M)

[PATCH v2 3/5] ntsync: reject wait ioctls with zero owner

From: Elizabeth Figura <zfigura@codeweavers.com>
Date: 2026-07-23 20:13:19
Also in: linux-doc, linux-kselftest, lkml
Subsystem: char and misc drivers, ntsync synchronization primitive driver, the rest · Maintainers: Arnd Bergmann, Greg Kroah-Hartman, Elizabeth Figura, Linus Torvalds

From: Iván Ezequiel Rodriguez <redacted>

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 <redacted>
Reviewed-by: Elizabeth Figura <zfigura@codeweavers.com>
Signed-off-by: Elizabeth Figura <zfigura@codeweavers.com>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help