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


Reply via email to