Author: emaste
Date: Fri May  4 14:49:37 2018
New Revision: 333252
URL: https://svnweb.freebsd.org/changeset/base/333252

Log:
  MFC r333234: zfs_ioctl: avoid out-of-bound read
  
  admbugs:      796
  Submitted by: Domagoj Stolfa <ds...@cam.ac.uk>
  Reported by:  Ilja Van Sprundel <ivansprun...@ioactive.com>
  Approved by:  re (early MFC as an EN candidate)

Modified:
  stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
==============================================================================
--- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c        
Fri May  4 14:39:32 2018        (r333251)
+++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c        
Fri May  4 14:49:37 2018        (r333252)
@@ -6441,6 +6441,10 @@ zfsdev_ioctl(struct cdev *dev, u_long zcmd, caddr_t ar
                        cflag = ZFS_CMD_COMPAT_V28;
                        break;
                case sizeof(zfs_cmd_v15_t):
+                       if (cmd >= sizeof(zfs_ioctl_v15_to_v28) /
+                           sizeof(zfs_ioctl_v15_to_v28[0]))
+                               return (EINVAL);
+
                        cflag = ZFS_CMD_COMPAT_V15;
                        vecnum = zfs_ioctl_v15_to_v28[cmd];
 
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to