From mboxrd@z Thu Jan 1 00:00:00 1970 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.3 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,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 64111C433FF for ; Wed, 31 Jul 2019 12:37:24 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 34B33206B8 for ; Wed, 31 Jul 2019 12:37:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="RpZjNXCI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 34B33206B8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=pBL2jo3zw2phLiPOIoNZQbYrE/skKHFpgad+7WR7W94=; b=RpZjNXCIJCj62D xfkXRt8eWSr2ZsN7jZ7nbfhZctP8p3LiwCl5WPH77+ta8O3ZAYw+b1MY95eSJP35+OkhOMlpzw/od eZqmXSsR2RLkvdKp9EtfMH+PJVtvHjnEoIarduNScyxYmN/dE4jgYsL6/4dwUCKOraz3DBcpzoRwB oDSmWqb6Oil/oG4XJbUBA/YKwkVfr9p1jsxZ1CPSTD7+chnWN2b43YIfwu5eMgYpdHAMPfQSXLnhK xt7RBhXxuI+pGbbjzJ+uMktZM51GKTnACd7u+/ojCWRZdloqjeCIPy9DSXiZ8uFHyQRxLh5hg56ao DD1z0uLCoyxez6qQVZ2w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hsnr4-0005eg-Tn; Wed, 31 Jul 2019 12:37:18 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hsnr2-0005eL-3L for linux-arm-kernel@lists.infradead.org; Wed, 31 Jul 2019 12:37:17 +0000 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 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-Disposition: inline In-Reply-To: <7d56c56af2f883958d5e74fa3178a1f774b9fd94.1562908075.git.viresh.kumar@linaro.org> User-Agent: Mutt/1.11.1+11 (2f07cb52) (2018-12-01) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190731_053716_183605_B9EB7303 X-CRM114-Status: GOOD ( 10.09 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Julien Thierry , Marc Zyngier , Catalin Marinas , Will Deacon , stable@vger.kernel.org, mark.brown@arm.com, Russell King , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.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. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel