From patchwork Wed Jun 28 14:58:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luc Van Oostenryck X-Patchwork-Id: 9814701 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 6371560383 for ; Wed, 28 Jun 2017 15:25:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 555D328575 for ; Wed, 28 Jun 2017 15:25:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4A376285B3; Wed, 28 Jun 2017 15:25:19 +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=-1.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C628C28575 for ; Wed, 28 Jun 2017 15:25:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=Zkf7Zhg9BvOFT80pmz6zv7oVzvgyBqocUswbRKJ5/r4=; b=jkR VU1yozs+RH5icEsfgDtOHq9dZeQXBBZg6Yxa+3W+/cI0UlGRZ0Q72b75wg934XcG/w75IZNvwB5vd HdwkHDHS5AE57Je3GTNakDK//vkWpk+kK47EXlw9KnI2GKiPithYDE1fsY51ZCF7DFQDDSu5rjV9a 8f8oHNUX2W3bFXkLW8gxbSIsjYSBz3A4iy00mTD/J3csOKbzFkTs3cDQAvOolV4Ir20j/HRagTnem WZo5jeGZpHJGgLMhFHx0Kn53DAO1ysxJl2Ty4MvtgUaGqnpv4CddZF+705Wcyb6Cir9KOpof5lfI4 kOxgw7qkA5unfXj9LoZEKHyksGgYnUw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dQEq5-0005JZ-SR; Wed, 28 Jun 2017 15:25:09 +0000 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dQEQN-0004tG-Ia for linux-arm-kernel@lists.infradead.org; Wed, 28 Jun 2017 14:58:38 +0000 Received: by mail-wm0-x243.google.com with SMTP id 131so11997842wmq.2 for ; Wed, 28 Jun 2017 07:58:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=44yHKtwmgX8hpIRFT+YNs8esMHjD0F2fMsHoSXEclT8=; b=Q2wXD7KcSlhXXfs0xM3bd5WeSgK3mO4CBAMeMP5wVR2JwaE1ujXhAPRQ2k06ar/5h4 U8z+aYF/5ZFCuuLlqQ9kX5TmR2Hfbc0j9hdQVBYQD19yl0ge1DA3ud86ixGl0E0sizYa d5A8O8cIjhS0CoidJmmEgsP6kWrZWoneGgAxmkVXo4E5Nq9Mk0e5LSZPOghBr1CmspBF 8LMdhNaMRBSViujKwzy6z2x8/YsLrdMvf4lleHVDFPI+zhubtJno3ZauJYQTh5uKNbxo 7/yjjrowRO/OoYXrdQAm/lkY7fbrufW+D9ngmxDn8WZwKf0HaxWV/dflDuPy2UkrHVl8 X6Ug== 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=44yHKtwmgX8hpIRFT+YNs8esMHjD0F2fMsHoSXEclT8=; b=LnaTKPuwkp9KZCpjFeKrYGL4V3RgzkDEuuDP9C6cep1M8bov4K+eK0xfOQ8fqqpdVg FstC117yVeC7q127gcAqU2CnW1Ek/aMeRl8sQDBIoOTsZAXiCJ95B+x4HUI1bmVAIKLR 2NaUKEc8VTVcpq4Mf5TYEVKPaFmA/X+0VRjiOuJwLd1/r/KmuyDhJFOWlEp5vdB7MpnO /43AtEqS/xxsxx0PKrfIx3KJ1imsWPiCsPGioK955HoG1XBCKmPiCS0Jg/lGYDz4+Hi0 Ry8XZ0ZrtAQ1Omewk4e1obQadzArljGSs5FuuleOjrTVZAyMDBE5u5wBcB7Awn49P5+3 kqDg== X-Gm-Message-State: AKS2vOxHQi7VVfkTvoePsOe7uWg1GoE5nCC3xI/4jMFwtvlE+BWHyFlr xe/2v1zbp3X3QQ== X-Received: by 10.80.162.38 with SMTP id 35mr8080074edl.99.1498661898079; Wed, 28 Jun 2017 07:58:18 -0700 (PDT) Received: from localhost.localdomain ([2a02:a03f:837:f300:dc41:f6b3:4608:d7c8]) by smtp.gmail.com with ESMTPSA id p49sm2337392edc.47.2017.06.28.07.58.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Jun 2017 07:58:17 -0700 (PDT) From: Luc Van Oostenryck To: Will Deacon Subject: [PATCH] arm64: fix missing __user in compat_vfp_{get,set}() Date: Wed, 28 Jun 2017 16:58:16 +0200 Message-Id: <20170628145816.24807-1-luc.vanoostenryck@gmail.com> X-Mailer: git-send-email 2.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170628_075835_927704_596026CB X-CRM114-Status: GOOD ( 12.45 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Pratyush Anand , Catalin Marinas , linux-arm-kernel@lists.infradead.org, Dave Martin , Luc Van Oostenryck , "David A. Long" MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP compat_vfp_get() & compat_vfp_set() are two helpers reading or writting some values via {get,put}_user() which need a pointer annotated with '__user'. The buffers used by the two helpers are correctly '__user' annotated but need to be casted to a real type before being given to {get,put}_user(). The problem is that this cast lack a '__user' annotation. Fix this by adding the missing '__user'. Signed-off-by: Luc Van Oostenryck Reviewed-by: Dave Martin --- arch/arm64/kernel/ptrace.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c index c142459a8..c77f425c7 100644 --- a/arch/arm64/kernel/ptrace.c +++ b/arch/arm64/kernel/ptrace.c @@ -908,7 +908,7 @@ static int compat_vfp_get(struct task_struct *target, if (count && !ret) { fpscr = (uregs->fpsr & VFP_FPSCR_STAT_MASK) | (uregs->fpcr & VFP_FPSCR_CTRL_MASK); - ret = put_user(fpscr, (compat_ulong_t *)ubuf); + ret = put_user(fpscr, (compat_ulong_t __user *)ubuf); } return ret; @@ -932,7 +932,7 @@ static int compat_vfp_set(struct task_struct *target, VFP_STATE_SIZE - sizeof(compat_ulong_t)); if (count && !ret) { - ret = get_user(fpscr, (compat_ulong_t *)ubuf); + ret = get_user(fpscr, (compat_ulong_t __user *)ubuf); uregs->fpsr = fpscr & VFP_FPSCR_STAT_MASK; uregs->fpcr = fpscr & VFP_FPSCR_CTRL_MASK; }