[PATCH] ntsync: Check for owner in setup_wait()
Griffin Kroah-Hartman <[email protected]> Tue, 14 Jul 2026 17:36:46 +0200
| Newsgroups | gmane.linux.kernel,gmane.comp.emulators.wine.devel |
|---|---|
| Message-ID | <[email protected]> |
Add a check to see if any mutex owner is 0. As stated in the uapi documentation , this is a failure case that was not being checked under the NTSYNC_IOC_WAIT_ANY and NTSYNC_IOC_WAIT_ALL cases, which state that mutexes with no owner should fail the ioctl with -EINVAL. Assisted-by: gkh_clanker_t1000 Signed-off-by: Griffin Kroah-Hartman <[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; --- base-commit: a13c140cc289c0b7b3770bce5b3ad42ab35074aa change-id: 20260714-ntsync_patches_1-34ea98de8606 Best regards, -- Griffin Kroah-Hartman <[email protected]>