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=-6.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 7B983C55178 for ; Tue, 27 Oct 2020 00:23:26 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 0F28F20780 for ; Tue, 27 Oct 2020 00:23:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="1GU2ZeRH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0F28F20780 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=zeniv.linux.org.uk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+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=merlin.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=rM5m07ri6WfhVWhOp7tRw+3JV8n/Zleu+rzytTZ9sWI=; b=1GU2ZeRHc6nS+9sW6S3nLBoZi 2V9hfwNGjXWR/yrkHQXhzG7C1k2cL4hYex+3MknTUudNTxTHKAXlczYNP0sv+Y9gh5E3vd7BGJe+Q lRmGyqFvN9Ls2u/VIU1VDG3X68aFLP/eeuEBzFMSB2Z2b+LAi35onHPvITS7bwM26OyXjuQM8ezof t1vGcYK2a1U/LRkRz97uSYtOAXNq5gJg3bvuSU4cIctA33kg0X3EfceiNee89A5jUOYX4bXNIe51Z m/o8hjIphQQ0/jxInl1OABk2CyjcNQjXGzjxdgc3ClpFg6fa2K3WnwjJFOi0jwYePxEi5ys4cTECg RAIE/m5zg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kXCjp-0006zk-UG; Tue, 27 Oct 2020 00:21:22 +0000 Received: from [2002:c35c:fd02::1] (helo=ZenIV.linux.org.uk) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kXCUe-00007R-EP for linux-arm-kernel@lists.infradead.org; Tue, 27 Oct 2020 00:05:44 +0000 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kXCUL-009VwG-7r; Tue, 27 Oct 2020 00:05:21 +0000 Date: Tue, 27 Oct 2020 00:05:21 +0000 From: Al Viro To: Jens Axboe Subject: Re: [REGRESSION] mm: process_vm_readv testcase no longer works after compat_prcoess_vm_readv removed Message-ID: <20201027000521.GD3576660@ZenIV.linux.org.uk> References: <70d5569e-4ad6-988a-e047-5d12d298684c@kernel.dk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <70d5569e-4ad6-988a-e047-5d12d298684c@kernel.dk> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201026_200540_863698_5FD73598 X-CRM114-Status: GOOD ( 20.91 ) 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: linux-aio@kvack.org, linux-mips@vger.kernel.org, David Howells , linux-mm@kvack.org, keyrings@vger.kernel.org, sparclinux@vger.kernel.org, Christoph Hellwig , linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, linux-scsi@vger.kernel.org, "maintainer:X86 ARCHITECTURE \(32-BIT AND 64-BIT\)" , linux-security-module@vger.kernel.org, Robert O'Callahan , Linus Torvalds , Arnd Bergmann , linux-block@vger.kernel.org, io-uring@vger.kernel.org, "moderated list:ARM PORT" , linux-parisc@vger.kernel.org, netdev@vger.kernel.org, open list , Kyle Huey , "open list:FILESYSTEMS \(VFS and infrastructure\)" , Andrew Morton , linuxppc-dev@lists.ozlabs.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Oct 26, 2020 at 05:56:11PM -0600, Jens Axboe wrote: > On 10/26/20 4:55 PM, Kyle Huey wrote: > > A test program from the rr[0] test suite, vm_readv_writev[1], no > > longer works on 5.10-rc1 when compiled as a 32 bit binary and executed > > on a 64 bit kernel. The first process_vm_readv call (on line 35) now > > fails with EFAULT. I have bisected this to > > c3973b401ef2b0b8005f8074a10e96e3ea093823. > > > > It should be fairly straightforward to extract the test case from our > > repository into a standalone program. > > Can you check with this applied? > > diff --git a/mm/process_vm_access.c b/mm/process_vm_access.c > index fd12da80b6f2..05676722d9cd 100644 > --- a/mm/process_vm_access.c > +++ b/mm/process_vm_access.c > @@ -273,7 +273,8 @@ static ssize_t process_vm_rw(pid_t pid, > return rc; > if (!iov_iter_count(&iter)) > goto free_iov_l; > - iov_r = iovec_from_user(rvec, riovcnt, UIO_FASTIOV, iovstack_r, false); > + iov_r = iovec_from_user(rvec, riovcnt, UIO_FASTIOV, iovstack_r, > + in_compat_syscall()); _ouch_ There's a bug, all right, but I'm not sure that this is all there is to it. For now it's probably the right fix, but... Consider the fun trying to use that from 32bit process to access the memory of 64bit one. IOW, we might want to add an explicit flag for "force 64bit addresses/sizes in rvec". _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel