From patchwork Mon Jul 4 10:08:08 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Pisati X-Patchwork-Id: 103076 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 5DC46B6F70 for ; Mon, 4 Jul 2011 20:08:29 +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 1Qdg4e-0006ws-Rk; Mon, 04 Jul 2011 10:08:16 +0000 Received: from adelie.canonical.com ([91.189.90.139]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1Qdg4c-0006w6-Mw for kernel-team@lists.ubuntu.com; Mon, 04 Jul 2011 10:08:14 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by adelie.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1Qdg4c-00025d-JV for ; Mon, 04 Jul 2011 10:08:14 +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 1Qdg4c-0005IR-D8 for kernel-team@lists.ubuntu.com; Mon, 04 Jul 2011 10:08:14 +0000 From: paolo.pisati@canonical.com To: kernel-team@lists.ubuntu.com Subject: [PATCH 2/4] drm: fix unsigned vs signed comparison issue in modeset ctl ioctl CVE-2011-1013 Date: Mon, 4 Jul 2011 11:08:08 +0100 Message-Id: <1309774090-2781-3-git-send-email-paolo.pisati@canonical.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1309774090-2781-1-git-send-email-paolo.pisati@canonical.com> References: <1309774090-2781-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 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: Andi Kleen 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 a263b70..0ddd109 100644 --- a/drivers/gpu/drm/drm_irq.c +++ b/drivers/gpu/drm/drm_irq.c @@ -545,7 +545,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 bd833c3..04fb2d3 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -1024,7 +1024,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;