Linux semop system call return EINVAL in case when the invalid nsops

or semid values specified.

MFC after:	1 month
This commit is contained in:
dchagin 2017-03-07 17:12:22 +00:00
parent f5caa5a507
commit 2ee4a4e5ac

View File

@ -513,6 +513,8 @@ linux_semop(struct thread *td, struct linux_semop_args *args)
int nsops;
} */ bsd_args;
if (args->nsops < 1 || args->semid < 0)
return (EINVAL);
bsd_args.semid = args->semid;
bsd_args.sops = PTRIN(args->tsops);
bsd_args.nsops = args->nsops;