Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Mar 2017 17:12:22 +0000 (UTC)
From:      Dmitry Chagin <dchagin@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r314868 - head/sys/compat/linux
Message-ID:  <201703071712.v27HCM3q062341@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dchagin
Date: Tue Mar  7 17:12:22 2017
New Revision: 314868
URL: https://svnweb.freebsd.org/changeset/base/314868

Log:
  Linux semop system call return EINVAL in case when the invalid nsops
  or semid values specified.
  
  MFC after:	1 month

Modified:
  head/sys/compat/linux/linux_ipc.c

Modified: head/sys/compat/linux/linux_ipc.c
==============================================================================
--- head/sys/compat/linux/linux_ipc.c	Tue Mar  7 17:09:12 2017	(r314867)
+++ head/sys/compat/linux/linux_ipc.c	Tue Mar  7 17:12:22 2017	(r314868)
@@ -513,6 +513,8 @@ linux_semop(struct thread *td, struct li
 	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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201703071712.v27HCM3q062341>