From patchwork Tue Jan 25 20:42:14 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brad Figg X-Patchwork-Id: 80405 X-Patchwork-Delegate: stefan.bader@canonical.com 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 B2F69B70E4 for ; Wed, 26 Jan 2011 07:44:39 +1100 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1Phpki-0005hH-64; Tue, 25 Jan 2011 20:44:36 +0000 Received: from adelie.canonical.com ([91.189.90.139]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1Phpkg-0005gn-58 for kernel-team@lists.ubuntu.com; Tue, 25 Jan 2011 20:44:34 +0000 Received: from hutte.canonical.com ([91.189.90.181]) by adelie.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1Phpkf-00041B-Uf for ; Tue, 25 Jan 2011 20:44:34 +0000 Received: from pool-98-108-155-157.ptldor.fios.verizon.net ([98.108.155.157] helo=localhost) by hutte.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1Phpkf-0002F9-J5 for kernel-team@lists.ubuntu.com; Tue, 25 Jan 2011 20:44:33 +0000 From: Brad Figg To: kernel-team@lists.ubuntu.com Subject: [Hardy] [CVE-2010-4078] [PATCH 1/1] drivers/video/sis/sis_main.c: prevent reading uninitialized stack memory, CVE-2010-4078 Date: Tue, 25 Jan 2011 12:42:14 -0800 Message-Id: <1295988134-18733-1-git-send-email-brad.figg@canonical.com> X-Mailer: git-send-email 1.7.0.4 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: Dan Rosenberg CVE-2010-4078 BugLink: http://bugs.launchpad.net/bugs/707579 Released by: 2.6.35.y stable upstream 2.6.32.y stable upstream The FBIOGET_VBLANK device ioctl allows unprivileged users to read 16 bytes of uninitialized stack memory, because the "reserved" member of the fb_vblank struct declared on the stack is not altered or zeroed before being copied back to the user. This patch takes care of it. Signed-off-by: Dan Rosenberg Cc: Thomas Winischhofer Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds (cherry-picked from commit fd02db9de73faebc51240619c7c7f99bee9f65c7) Signed-off-by: Brad Figg Acked-by: Tim Gardner Acked-by: Stefan Bader --- drivers/video/sis/sis_main.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/drivers/video/sis/sis_main.c b/drivers/video/sis/sis_main.c index 559bf17..b52f8e4 100644 --- a/drivers/video/sis/sis_main.c +++ b/drivers/video/sis/sis_main.c @@ -1701,6 +1701,9 @@ static int sisfb_ioctl(struct fb_info *info, unsigned int cmd, break; case FBIOGET_VBLANK: + + memset(&sisvbblank, 0, sizeof(struct fb_vblank)); + sisvbblank.count = 0; sisvbblank.flags = sisfb_setupvbblankflags(ivideo, &sisvbblank.vcount, &sisvbblank.hcount);