From patchwork Tue Jan 30 20:30:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Malone X-Patchwork-Id: 10192567 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E5D956020C for ; Tue, 30 Jan 2018 20:30:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D562526538 for ; Tue, 30 Jan 2018 20:30:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CA0C826AE3; Tue, 30 Jan 2018 20:30:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5FD9A26538 for ; Tue, 30 Jan 2018 20:30:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753183AbeA3Ua5 (ORCPT ); Tue, 30 Jan 2018 15:30:57 -0500 Received: from mail-yw0-f194.google.com ([209.85.161.194]:34127 "EHLO mail-yw0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753178AbeA3Ua5 (ORCPT ); Tue, 30 Jan 2018 15:30:57 -0500 Received: by mail-yw0-f194.google.com with SMTP id t201so5780522ywf.1 for ; Tue, 30 Jan 2018 12:30:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=fm//GSO55PrksqoV7onn0Uqhi/3IPndtXw9nkCg994s=; b=g4Y3pGzjjbZVQnHd1MjXvgM4hIfuuyJlISnKP0SpHgJ0lpvljFeGHIsJcBmQ0S8k4n dVTEXuqLGb886GafPIrYm/HsV6g0o0l7Nr+PwyVrxpyT7n4t4XDt81efQzfuQGFj95gD Nj6gtWOdCe07MabdWTgkWeDeGthAXh88nGvYX28OmggGJ/smIQVnAsKHxJKAkRq08yw5 SiCXVBLCGTUfDcHhV4vqmjZZ5ksr2Jh2/4MoB4rqE5ut/CKxXGcizecxCmw81b27cPeZ s9kO1e0X6p4mUEreeixAWx084VNLRir0MwIrPBfSO4zgny+w/TZ8IHkSk+aqc+2fuGFh 9OOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=fm//GSO55PrksqoV7onn0Uqhi/3IPndtXw9nkCg994s=; b=sTaGKR59eprksCUU+o85nW/sSnfGMsaNkFKY3nj7XeLnDzSEiQ3qFIjXoJtSYAyayu CVHwvKxXZe4av9OVpRADmvh1Bu/+4BELfbj8S2hphb9Ib/hsew/VsTN0GL7K8B1lccP4 w8PAqMrcjlCULUT8VJocPEjbKhAcWsU3Bw28vD+HeGxNMGwFp++V58JPQdjjL2o+KGZH mwNLlzvHrTJKysE/WPa3rmHJC+R2pknMylT+P8Mf9V/yvNtLqA5qxxmSzhIQq6jNrrDq TKksIPY8Zi44ZvtWBZfVuX/CypVlBXUGQ85FZkzg1Tt1z9NwaYJo3NSPjfTjZcZFXGs3 qqNg== X-Gm-Message-State: AKwxytd8o7fdL3XpQ/ce2eUDN0LbAeKcy7bzP3AqUDPe/h1OQ6KgW+/q AtRy6Ufnc+S8vvmQeQFy9ZF+mQE0 X-Google-Smtp-Source: AH8x224mj/HEREzqgOEOfLHmLma+vRp6XFhulU6AE4Fdos7+nBLePzlAwsTineTAlW5IgJRYG8t8UA== X-Received: by 10.37.199.146 with SMTP id w140mr21286997ybe.193.1517344256003; Tue, 30 Jan 2018 12:30:56 -0800 (PST) Received: from Eire.localdomain (cpe-45-37-207-0.nc.res.rr.com. [45.37.207.0]) by smtp.gmail.com with ESMTPSA id k187sm5669059ywb.109.2018.01.30.12.30.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 30 Jan 2018 12:30:55 -0800 (PST) From: Peter Malone To: linux-fbdev@vger.kernel.org Cc: Peter Malone Subject: [PATCH] Fixing arbitrary kernel leak in case FBIOGETCMAP_SPARC in sbusfb_ioctl_helper(). Date: Tue, 30 Jan 2018 15:30:42 -0500 Message-Id: <20180130203042.4797-1-peter.malone@gmail.com> X-Mailer: git-send-email 2.14.3 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Peter Malone --- drivers/video/fbdev/sbuslib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/video/fbdev/sbuslib.c b/drivers/video/fbdev/sbuslib.c index af6fc97f4ba4..a436d44f1b7f 100644 --- a/drivers/video/fbdev/sbuslib.c +++ b/drivers/video/fbdev/sbuslib.c @@ -122,7 +122,7 @@ int sbusfb_ioctl_helper(unsigned long cmd, unsigned long arg, unsigned char __user *ured; unsigned char __user *ugreen; unsigned char __user *ublue; - int index, count, i; + unsigned int index, count, i; if (get_user(index, &c->index) || __get_user(count, &c->count) || @@ -161,7 +161,7 @@ int sbusfb_ioctl_helper(unsigned long cmd, unsigned long arg, unsigned char __user *ugreen; unsigned char __user *ublue; struct fb_cmap *cmap = &info->cmap; - int index, count, i; + unsigned int index, count, i; u8 red, green, blue; if (get_user(index, &c->index) ||