Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4829226ybg; Tue, 29 Oct 2019 13:03:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqyevoKXAfW5Mw86wwP9ZGy0MqsJTgjMgSNa1G7Q9o7Q093aDXyR1gsNX9ctBzltIUfLqtgB X-Received: by 2002:aa7:c954:: with SMTP id h20mr27640879edt.159.1572379387517; Tue, 29 Oct 2019 13:03:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572379387; cv=none; d=google.com; s=arc-20160816; b=rMcjn0461IXjHl3lR/TVMm/kEN6RXUj+MXLB31qs5tiEhT65ml4HfzprUxqRcSrIFd jzX/rpfgyzX4fXPlFZwcYCibgZUJED0Jluue8YOVdvGEwAnWu9tHQpEY75pJokCWf9jF FJBp3g0Vz6YaLFE88GpgtFKPDgtJC4F22yfmJqUGA6xU2KKWygYHTo06S0d/teH4s++l 5sz/GoDDBeYCGGcGMCyHnqsKlDO+r1LWH4nUptWwPinIXXX+SpLMW37Vvl2jDwxiy1j5 ED+M6SjBU+5j0H483tANUXxNeXCb204aL9pkXf4pd9vHGISnCOQwSrSrfRQe0Ql7IBcZ Wt3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature; bh=pvaGyOZDLlNqbGIv4aiDa+8jV2u8TRmd0Sg/3CdaYfQ=; b=pwJ0INKt5/RR0DFjqDU5uc6CYqm2dg8vQhjJqnHnbvTnir7j8I4vaAcbZAXhVmdRsa Kelnks15c/c0raw052bnXYp6pFFKpF5XjTVw4xIad1eI8wrqipM+JqNHq57NBwXkMkqQ SrudC//VlnB4v4fbCqDl76RX7O7NENalG3Al+TMwoXkgTiFGT71a77a6sG6bFLNpyJ1w Bo7oZAwK4gbpUxKNFuUhyl/SrPOGvVI7TyH4XovZl3aLCXz/pMX9DI6ZstYLtXqYmO0z vOObPpEEj3vy+PXrw5IjNhak20KhZenCBfaWoknzEeC9rPLbic5yDpG/1hOHjAK770qb 46GQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2019-08-05 header.b=GayfmIV9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id dt26si8442097ejb.38.2019.10.29.13.02.44; Tue, 29 Oct 2019 13:03:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2019-08-05 header.b=GayfmIV9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729534AbfJ2SZN (ORCPT + 99 others); Tue, 29 Oct 2019 14:25:13 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:48686 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726923AbfJ2SZN (ORCPT ); Tue, 29 Oct 2019 14:25:13 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x9TI5FDj175951; Tue, 29 Oct 2019 18:23:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type; s=corp-2019-08-05; bh=pvaGyOZDLlNqbGIv4aiDa+8jV2u8TRmd0Sg/3CdaYfQ=; b=GayfmIV97A/7KomJSAsydyBuszzE+3RDo1LCbszbUU03PKeOPpUsle4oX8Bz1eM7+QTg w17fUSx26ItlguIpsL8eUG0ZQzM19hMSpsyOjpclWpMjsMwnIU1OJ0G/0HZ9jt9TcWPu nc2WRwGPQVL9Ox2RSIbuHMSbPWSSss3mVfWN2ZOT14JMBpQIsvN3gB/FH1OC1i7XgMgI pKVgT+27FvJ6I9IkQhR7tVJmBVx3R9ZIPK8kaaHl/VEpXSNaajWQENUJs13sEKJacAWV fQuop4wCqvSb1Q1wLkFTAlw40mAmIgY55WNYNdaRCm4j8RVgdThKmUpTxLYJCbEjnlRz Jw== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2130.oracle.com with ESMTP id 2vvdjub9ee-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 29 Oct 2019 18:23:39 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x9TI8BBK179764; Tue, 29 Oct 2019 18:23:39 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3020.oracle.com with ESMTP id 2vxpfdgt2e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 29 Oct 2019 18:23:39 +0000 Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x9TINU14011472; Tue, 29 Oct 2019 18:23:30 GMT Received: from mwanda (/41.57.98.10) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 29 Oct 2019 11:23:30 -0700 Date: Tue, 29 Oct 2019 21:23:20 +0300 From: Dan Carpenter To: Bartlomiej Zolnierkiewicz , Andrea Righi Cc: Daniel Vetter , Sam Ravnborg , Maarten Lankhorst , Peter Rosin , Gerd Hoffmann , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, security@kernel.org, Kees Cook , Julia Lawall Subject: [PATCH] fbdev: potential information leak in do_fb_ioctl() Message-ID: <20191029182320.GA17569@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Mailer: git-send-email haha only kidding User-Agent: Mutt/1.10.1 (2018-07-13) X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9425 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1910290160 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9425 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1910290160 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The "fix" struct has a 2 byte hole after ->ywrapstep and the "fix = info->fix;" assignment doesn't necessarily clear it. It depends on the compiler. Fixes: 1f5e31d7e55a ("fbmem: don't call copy_from/to_user() with mutex held") Signed-off-by: Dan Carpenter --- I have 13 more similar places to patch... I'm not totally sure I understand all the issues involved. drivers/video/fbdev/core/fbmem.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index 6f6fc785b545..b4ce6a28aed9 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -1109,6 +1109,7 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, ret = -EFAULT; break; case FBIOGET_FSCREENINFO: + memset(&fix, 0, sizeof(fix)); lock_fb_info(info); fix = info->fix; if (info->flags & FBINFO_HIDE_SMEM_START) -- 2.20.1