From owner-svn-src-all@FreeBSD.ORG Fri Nov 28 12:15:00 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6C9BCC8E; Fri, 28 Nov 2014 12:15:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 59252EDA; Fri, 28 Nov 2014 12:15:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sASCF0QQ081895; Fri, 28 Nov 2014 12:15:00 GMT (envelope-from rea@FreeBSD.org) Received: (from rea@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sASCF08A081894; Fri, 28 Nov 2014 12:15:00 GMT (envelope-from rea@FreeBSD.org) Message-Id: <201411281215.sASCF08A081894@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rea set sender to rea@FreeBSD.org using -f From: Eygene Ryabinkin Date: Fri, 28 Nov 2014 12:15:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275209 - head/sys/dev/drm2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Nov 2014 12:15:00 -0000 Author: rea (ports committer) Date: Fri Nov 28 12:14:59 2014 New Revision: 275209 URL: https://svnweb.freebsd.org/changeset/base/275209 Log: DRM2: fix off-by-one overflow in ioctl processing Call to the driver-specific ioctl used to process ioctl number that will lead to the out-of-bounds access to the ioctl handler array. PR: 193367 Approved by: kib MFC after: 1 week Modified: head/sys/dev/drm2/drm_drv.c Modified: head/sys/dev/drm2/drm_drv.c ============================================================================== --- head/sys/dev/drm2/drm_drv.c Fri Nov 28 11:49:26 2014 (r275208) +++ head/sys/dev/drm2/drm_drv.c Fri Nov 28 12:14:59 2014 (r275209) @@ -905,7 +905,7 @@ int drm_ioctl(struct cdev *kdev, u_long 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;