Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1221988imu; Wed, 16 Jan 2019 15:06:57 -0800 (PST) X-Google-Smtp-Source: ALg8bN7y+nGMRoi4zx7p5KhQdfv3Go6lYMufpa5gm99Xz3aLOoKrZHR15CmVj90ft50LLbAyjzxu X-Received: by 2002:a62:7504:: with SMTP id q4mr12121407pfc.180.1547680017478; Wed, 16 Jan 2019 15:06:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547680017; cv=none; d=google.com; s=arc-20160816; b=bBn8trDKHQNQem/73sfCm//IZyKzGeDYwdrlGh4Np7vB1bWjOejAR/oiHeDz7lm2z1 6yptASNwMtDP7fDTfJfFz/GUaqCuw8uG5SNw83/sX+h7Qc/gYtXa/QzJ0jJj/7FAlY+P P8HfaCU468Kxunotf4nanak/ow1hbHw5DmgFQFH7cRGRlhjTqdpORJlmXYPu8fADGECa tU7lLMWAJoIugIBKGkPa46ElqSDugKE0SHkh8hzj3zen3zWWGHDYSUsdq73cVFC6rgDr HU6OA4tGfc1EO2YHmPuXabcGLZisaGrnsRdUU9dd5IBTc3U98pbcLDet7tJ2hsLRjQiY MhOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=cObnf8BQUUjYv5FEQl31eHukD+U4RORsineAHtwJLjU=; b=IwccdmIolfrG+lGqRd9O5l5iSnVT2H+/khIn/uEyKOXbroaN97IER3mFwFh8/tcxBo 61b7IGnY3Glc6sD0TIJE92tVpZPaij+gN1vaHGgxWwKSeGu3NnFX16UCAK3OUYRk9xLm CWjs1UJDuSvVGee4PETDTYkgI+bkO0VJVLLbddhgdZx4gHDc2NhBep5G39m6+m1+gwDE 4q6LK6cB4OvSrUUfbAkdmythP4mWZnS/QmObOwHbAkWFPSjmZRss7Bp2vmRZeZjEt0/M LlWpsxcmqSKaU2N2/I9JvtruhyreVnjCgzymIexpBiw/3POfzdb8ods10Yttb7AQfqOn 11yg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m63si7791652pld.132.2019.01.16.15.06.38; Wed, 16 Jan 2019 15:06:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394314AbfAPQsY (ORCPT + 99 others); Wed, 16 Jan 2019 11:48:24 -0500 Received: from foss.arm.com ([217.140.101.70]:52890 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733068AbfAPQsY (ORCPT ); Wed, 16 Jan 2019 11:48:24 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E7696A78; Wed, 16 Jan 2019 08:48:23 -0800 (PST) Received: from brain-police (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9E5093F5AF; Wed, 16 Jan 2019 08:48:21 -0800 (PST) Date: Wed, 16 Jan 2019 16:48:18 +0000 From: Will Deacon To: Kassey Cc: linux-kernel@vger.kernel.org, willy@infradead.org, kassey@126.com, linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, mark.rutland@arm.com, robin.murphy@arm.com, ard.biesheuvel@linaro.org Subject: Re: arm64: copy_from_user access the last page of ddr has problem on 4.14 kernel Message-ID: <20190116164817.GG1910@brain-police> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [I'm due to get on a long flight shortly, so I've added LAKML and a few others to CC] On Wed, Jan 16, 2019 at 11:25:15AM +0800, Kassey wrote: > Hi, Will and team: > > we met a issue when copy_from_user to access the last page of DDR > on 4.14 kenrel, below is the detail steps, > can you help to suggest if there is know fix or debug something ? > > 1. we mmap ( in userspace) a region of phy address that is not > continous but include the last page of ddr > > for example our ddr end is 0x200000000 > the last page is fall in below addr: > 0x1fffff000 to 0x200000000 > > 2. we using copy_from_user to copy these mmap address to kernel buffer > > 3. and we find everytime when trying to copy_from_user the last page > in phy of ddr, > the dst kernel buffer is looks overwrite by some same patten start > with "mmap" in this last page ,but the src in the last page of ddr is > still correct. > > is there any know issue for copy_from_user to accces the last page of > phy ddr mmaped by userspace ? Not that I'm aware of. Are you using defconfig and can you reproduce the problem with mainline (e.g. v5.0-rc2)? What exactly do you mean by: "the fst kernel buffer is looks overwrite by some same patten start with "mmap""? Does the copy_from_user fail (what does it return?) or does it succeed but the data copied appears to be junk? Is it deterministic? Could you share an example of what the corrupted data looks like, please? Cheers, Will