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=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 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 614F9C32751 for ; Wed, 31 Jul 2019 12:37:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3FA65206B8 for ; Wed, 31 Jul 2019 12:37:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727820AbfGaMhQ (ORCPT ); Wed, 31 Jul 2019 08:37:16 -0400 Received: from foss.arm.com ([217.140.110.172]:45792 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726259AbfGaMhQ (ORCPT ); Wed, 31 Jul 2019 08:37:16 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A039D344; Wed, 31 Jul 2019 05:37:15 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4C9FC3F575; Wed, 31 Jul 2019 05:37:14 -0700 (PDT) Date: Wed, 31 Jul 2019 13:37:12 +0100 From: Mark Rutland To: Viresh Kumar Cc: stable@vger.kernel.org, Julien Thierry , linux-arm-kernel@lists.infradead.org, Catalin Marinas , Marc Zyngier , Will Deacon , Russell King , Vincent Guittot , mark.brown@arm.com Subject: Re: [PATCH v4.4 V2 11/43] arm64: uaccess: Mask __user pointers for __arch_{clear, copy_*}_user Message-ID: <20190731123711.GB39768@lakrids.cambridge.arm.com> References: <7d56c56af2f883958d5e74fa3178a1f774b9fd94.1562908075.git.viresh.kumar@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7d56c56af2f883958d5e74fa3178a1f774b9fd94.1562908075.git.viresh.kumar@linaro.org> User-Agent: Mutt/1.11.1+11 (2f07cb52) (2018-12-01) Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Fri, Jul 12, 2019 at 10:57:59AM +0530, Viresh Kumar wrote: > From: Will Deacon > > commit f71c2ffcb20dd8626880747557014bb9a61eb90e upstream. > > Like we've done for get_user and put_user, ensure that user pointers > are masked before invoking the underlying __arch_{clear,copy_*}_user > operations. > > Signed-off-by: Will Deacon > Signed-off-by: Catalin Marinas > [ v4.4: fixup for v4.4 style uaccess primitives ] > Signed-off-by: Viresh Kumar [...] > static inline unsigned long __must_check __copy_from_user(void *to, const void __user *from, unsigned long n) > { > kasan_check_write(to, n); > - return __arch_copy_from_user(to, from, n); > + return __arch_copy_from_user(to, __uaccess_mask_ptr(from), n); > + > } > > static inline unsigned long __must_check __copy_to_user(void __user *to, const void *from, unsigned long n) > { > kasan_check_read(from, n); > - return __arch_copy_to_user(to, from, n); > + return __arch_copy_to_user(__uaccess_mask_ptr(to), from, n); > + > } Can we please drop the trailing whitespace from each of these? That wasn't in the upstreadm commit or v4.9.y. Otherwise, this looks fine. Thanks, Mark.