From patchwork Tue Jan 13 05:12:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 5625561 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 25CD79F406 for ; Wed, 14 Jan 2015 03:22:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1FD4620395 for ; Wed, 14 Jan 2015 03:22:55 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 5DDA320397 for ; Wed, 14 Jan 2015 03:22:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6DE8E6E6E5; Tue, 13 Jan 2015 19:22:46 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 2909 seconds by postgrey-1.34 at gabe; Mon, 12 Jan 2015 22:00:56 PST Received: from bh-25.webhostbox.net (bh-25.webhostbox.net [208.91.199.152]) by gabe.freedesktop.org (Postfix) with ESMTP id 5CB506E581 for ; Mon, 12 Jan 2015 22:00:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=roeck-us.net; s=default; h=Message-Id:Date:Subject:Cc:To:From; bh=3m0WgAYcoyVrmP3YyKLwoHFWRsSBmu0Y8QamfbUn1KM=; b=2i3g7UeaDZAk9N4XiJSaiz3b9El8k2Bq1mROP7qshLaL6e6YHwVz9Dbx/MfJgr4YpOK5lZCoWl9nesEQpZeKhwJqsjV2rUNUdvxwdizKOOZCMESOXe5wiulkVWAOSRXRmSqWQKigYSmGcPPGeMWQrNtkbhcqIOc6v+RS7uvwemo=; Received: from mailnull by bh-25.webhostbox.net with sa-checked (Exim 4.82) (envelope-from ) id 1YAtmD-000VdQ-GR for dri-devel@lists.freedesktop.org; Tue, 13 Jan 2015 05:12:25 +0000 Received: from 108-223-40-66.lightspeed.sntcca.sbcglobal.net ([108.223.40.66]:36331 helo=localhost) by bh-25.webhostbox.net with esmtpa (Exim 4.82) (envelope-from ) id 1YAtmB-000VWb-D9; Tue, 13 Jan 2015 05:12:23 +0000 From: Guenter Roeck To: David Airlie Subject: [PATCH] next: drm/atomic: Use copy_from_user to copy 64 bit data from user space Date: Mon, 12 Jan 2015 21:12:17 -0800 Message-Id: <1421125937-27394-1-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 2.1.0 X-Authenticated_sender: guenter@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-CTCH-PVer: 0000001 X-CTCH-Spam: Unknown X-CTCH-VOD: Unknown X-CTCH-Flags: 0 X-CTCH-RefID: str=0001.0A020202.54B4A939.0185, ss=1, re=0.001, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-Score: 0.001 X-CTCH-ScoreCust: 0.000 X-CTCH-Rules: C_4847, X-CTCH-SenderID: linux@roeck-us.net X-CTCH-SenderID-Flags: 0 X-CTCH-SenderID-TotalMessages: 2 X-CTCH-SenderID-TotalSpam: 0 X-CTCH-SenderID-TotalSuspected: 0 X-CTCH-SenderID-TotalConfirmed: 0 X-CTCH-SenderID-TotalBulk: 0 X-CTCH-SenderID-TotalVirus: 0 X-CTCH-SenderID-TotalRecipients: 0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - lists.freedesktop.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: mailgid no entry from get_relayhosts_entry X-Source: X-Source-Args: X-Source-Dir: X-Mailman-Approved-At: Tue, 13 Jan 2015 19:22:45 -0800 Cc: linux-next@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Guenter Roeck X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Copying 64 bit data from user space using get_user is not supported on all architectures, and may result in the following build error. ERROR: "__get_user_bad" [drivers/gpu/drm/drm.ko] undefined! Avoid the problem by using copy_from_user. Fixes: d34f20d6e2f2 ("drm: Atomic modeset ioctl") Cc: Rob Clark Signed-off-by: Guenter Roeck --- Compile tested only. drivers/gpu/drm/drm_atomic.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c index 1e38dfc..af3f3df 100644 --- a/drivers/gpu/drm/drm_atomic.c +++ b/drivers/gpu/drm/drm_atomic.c @@ -1259,7 +1259,9 @@ retry: goto fail; } - if (get_user(prop_value, prop_values_ptr + copied_props)) { + if (copy_from_user(&prop_value, + prop_values_ptr + copied_props, + sizeof(prop_value))) { ret = -EFAULT; goto fail; }