From patchwork Wed Apr 22 09:57:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 227165 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44333C55189 for ; Wed, 22 Apr 2020 10:41:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1C9452075A for ; Wed, 22 Apr 2020 10:41:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587552098; bh=lUJfySIV4iy9oc8egJOB4Qa52Ho6PfQJ47fWOfGD2pw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=cQ2TS7OZsGpdM4OZOelLEKvk5yP7iVnnHGLex+LB+qFNX2NxEA6azFtbIzy1ynxpv 4zAyzIVwwEfWqW596qcOhmhpW5hmad4JPZ+dSRE2dTSiTp09Wc8FSA22Lnw/xUChD0 qJBMVqshrB9iiHCwl2C2tu8MfSn88spUs5QQaUGI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730076AbgDVKlh (ORCPT ); Wed, 22 Apr 2020 06:41:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:56980 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730075AbgDVKUN (ORCPT ); Wed, 22 Apr 2020 06:20:13 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3A1EC2076E; Wed, 22 Apr 2020 10:20:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587550812; bh=lUJfySIV4iy9oc8egJOB4Qa52Ho6PfQJ47fWOfGD2pw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KjYvOcsDgjwWzzD0rH8vQLauinj1mZCYwm/9e4JgSocYuHSMlP2wE//pFsYVByGcB iTqEz9W3qbn+p8pz4s0CKmt9IsfuwJCJ2fQKfYF+zplewDbVSypqd937ZkMF3iDiWS H8OXiA/o7PBxg2K1LLaGYVk9vpXaZdu5VQEc1fM0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Andrew Morton , Arnd Bergmann , "Eric W. Biederman" , Andrea Righi , Daniel Vetter , Sam Ravnborg , Maarten Lankhorst , Daniel Thompson , Peter Rosin , Jani Nikula , Gerd Hoffmann , Bartlomiej Zolnierkiewicz Subject: [PATCH 5.4 103/118] fbdev: potential information leak in do_fb_ioctl() Date: Wed, 22 Apr 2020 11:57:44 +0200 Message-Id: <20200422095048.125647124@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200422095031.522502705@linuxfoundation.org> References: <20200422095031.522502705@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Dan Carpenter commit d3d19d6fc5736a798b118971935ce274f7deaa82 upstream. 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. The solution is just to replace the assignment with an memcpy(). Fixes: 1f5e31d7e55a ("fbmem: don't call copy_from/to_user() with mutex held") Signed-off-by: Dan Carpenter Cc: Andrew Morton Cc: Arnd Bergmann Cc: "Eric W. Biederman" Cc: Andrea Righi Cc: Daniel Vetter Cc: Sam Ravnborg Cc: Maarten Lankhorst Cc: Daniel Thompson Cc: Peter Rosin Cc: Jani Nikula Cc: Gerd Hoffmann Signed-off-by: Bartlomiej Zolnierkiewicz Link: https://patchwork.freedesktop.org/patch/msgid/20200113100132.ixpaymordi24n3av@kili.mountain Signed-off-by: Greg Kroah-Hartman --- drivers/video/fbdev/core/fbmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -1110,7 +1110,7 @@ static long do_fb_ioctl(struct fb_info * break; case FBIOGET_FSCREENINFO: lock_fb_info(info); - fix = info->fix; + memcpy(&fix, &info->fix, sizeof(fix)); if (info->flags & FBINFO_HIDE_SMEM_START) fix.smem_start = 0; unlock_fb_info(info);