From patchwork Mon Jul 4 10:03:33 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Pisati X-Patchwork-Id: 103073 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 77505B6F73 for ; Mon, 4 Jul 2011 20:03:52 +1000 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1Qdg0E-0005q9-AQ; Mon, 04 Jul 2011 10:03:42 +0000 Received: from adelie.canonical.com ([91.189.90.139]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1Qdg0C-0005oo-28 for kernel-team@lists.ubuntu.com; Mon, 04 Jul 2011 10:03:40 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by adelie.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1Qdg0B-0007qI-VH for ; Mon, 04 Jul 2011 10:03:39 +0000 Received: from dynamic-adsl-94-36-146-179.clienti.tiscali.it ([94.36.146.179] helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1Qdg0B-00056Q-PW for kernel-team@lists.ubuntu.com; Mon, 04 Jul 2011 10:03:39 +0000 From: paolo.pisati@canonical.com To: kernel-team@lists.ubuntu.com Subject: [PATCH 3/4] drm: fix unsigned vs signed comparison issue in modeset ctl ioctl, CVE-2011-1013 Date: Mon, 4 Jul 2011 11:03:33 +0100 Message-Id: <1309773814-2669-4-git-send-email-paolo.pisati@canonical.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1309773814-2669-1-git-send-email-paolo.pisati@canonical.com> References: <1309773814-2669-1-git-send-email-paolo.pisati@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com From: Dave Airlie BugLink: http://bugs.launchpad.net/bugs/804229 CVE-2011-1013 commit 1922756124ddd53846877416d92ba4a802bc658f upstream. This fixes CVE-2011-1013. Reported-by: Matthiew Herrb (OpenBSD X.org team) Signed-off-by: Dave Airlie Signed-off-by: Greg Kroah-Hartman Signed-off-by: Stefan Bader Signed-off-by: Tim Gardner Signed-off-by: Paolo Pisati --- drivers/gpu/drm/drm_irq.c | 3 ++- include/drm/drmP.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c index f298434..a60bf9f 100644 --- a/drivers/gpu/drm/drm_irq.c +++ b/drivers/gpu/drm/drm_irq.c @@ -513,7 +513,8 @@ int drm_modeset_ctl(struct drm_device *dev, void *data, struct drm_file *file_priv) { struct drm_modeset_ctl *modeset = data; - int crtc, ret = 0; + int ret = 0; + unsigned int crtc; /* If drm_vblank_init() hasn't been called yet, just no-op */ if (!dev->num_crtcs) diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 4637dce..c012b01 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -989,7 +989,7 @@ struct drm_device { struct pci_controller *hose; #endif struct drm_sg_mem *sg; /**< Scatter gather memory */ - int num_crtcs; /**< Number of CRTCs on this device */ + unsigned int num_crtcs; /**< Number of CRTCs on this device */ void *dev_private; /**< device private data */ void *mm_private; struct address_space *dev_mapping;