svn commit: r343717 - stable/12/sys/dev/drm

Oleksandr Tymoshenko gonzo at FreeBSD.org
Sun Feb 3 14:56:39 UTC 2019


Author: gonzo
Date: Sun Feb  3 14:56:38 2019
New Revision: 343717
URL: https://svnweb.freebsd.org/changeset/base/343717

Log:
  MFC r343060:
  
  [drm] Fix off-by-one error when accessing driver-specific ioctl handlers array
  
  PR:		231513
  Submitted by:	Young_X <YangX92 at hotmail.com>
  Approved by:	imp

Modified:
  stable/12/sys/dev/drm/drm_drv.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/drm/drm_drv.c
==============================================================================
--- stable/12/sys/dev/drm/drm_drv.c	Sun Feb  3 14:55:21 2019	(r343716)
+++ stable/12/sys/dev/drm/drm_drv.c	Sun Feb  3 14:56:38 2019	(r343717)
@@ -745,7 +745,7 @@ int drm_ioctl(struct cdev *kdev, u_long cmd, caddr_t d
 	if (ioctl->func == NULL && nr >= DRM_COMMAND_BASE) {
 		/* The array entries begin at DRM_COMMAND_BASE ioctl nr */
 		nr -= DRM_COMMAND_BASE;
-		if (nr > dev->driver->max_ioctl) {
+		if (nr >= dev->driver->max_ioctl) {
 			DRM_DEBUG("Bad driver ioctl number, 0x%x (of 0x%x)\n",
 			    nr, dev->driver->max_ioctl);
 			return EINVAL;


More information about the svn-src-stable mailing list