Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp1056310pxx; Tue, 27 Oct 2020 07:17:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwysIyx8luU0O0NYTjf2kwxt0OPfP2Zz1PPys1BlWn6Yqw2y9E51emVzXiNdnwKZ1+fJXfI X-Received: by 2002:a17:906:6cb:: with SMTP id v11mr2730607ejb.31.1603808274812; Tue, 27 Oct 2020 07:17:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603808274; cv=none; d=google.com; s=arc-20160816; b=rjGyvAlxJX+BY89awJLVyAm1gn9JgQ/5Eb2UeQC2ohjwRpaOGlDa3WwQ78NkHVI+cF nR0UGF3a5h3iZbgTK1Nn+CDOJvMmtm1J5CdPoog8O85+UaBMSohfPVbJwZMiF5QsEjf6 SpBpQEQiFx6gf5FB1SsWYS1u+7gSfw4b2kmc6YH2qGLvIlEqiyK4uTw7TxW9tIicRaGR yA2J/7cc/eFUXWnHNWRAwDMK3+F5oHhBy5MY3cBHmGGDfxksm8chZEQ0dwVFsLww4Rpn NVkRJUWQUifEqv8zCV6HelhmGSFuJitj8+hwKqrA2AR1mgDsCMVE8XMREx95cW7wa2GS 75Dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=0UWfOY3JewQyPcTZDezBhgRy4tU08W46rk8nsxed4rQ=; b=LWkIBwOkK6nivWtKzR/ZnuCac3sQXOKyi9l8x2rvTftzifgqo7KXY5B4zqZo0fc76u pCLbldYCrYWNKOAIS1ExUPun6JmCqKY19feUhOvVENefyYjQd32My36wuxycbtMnq9rv mi7OYEMcTHcQBncQn4446uNWGCkRgCo31Cquj+46GF7ddyK7nllcXTrSbxbcVNB3gjBd +W46c0gpnjlAkCG1XzSpxYMaQwg0K/2XPQlqBuHYGznUooo+YvklGe+yESduBeMyqQ0M /9BKXWRPR4hSjpNdpJ674wcojmbtgVjCPpRtK9ZVIR82/99AK42iWt0Vz8tg8DvinuAR GSow== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bu21si959103edb.86.2020.10.27.07.17.32; Tue, 27 Oct 2020 07:17:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2508619AbgJ0IBi (ORCPT + 99 others); Tue, 27 Oct 2020 04:01:38 -0400 Received: from verein.lst.de ([213.95.11.211]:37702 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391283AbgJ0IBh (ORCPT ); Tue, 27 Oct 2020 04:01:37 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 8C46067373; Tue, 27 Oct 2020 09:01:35 +0100 (CET) Date: Tue, 27 Oct 2020 09:01:35 +0100 From: Christoph Hellwig To: Al Viro Cc: Jens Axboe , Linus Torvalds , "linux-kernel@vger.kernel.org" , Christoph Hellwig , Kyle Huey Subject: Re: [PATCH] Fix compat regression in process_vm_rw() Message-ID: <20201027080135.GB22650@lst.de> References: <20201027000920.GE3576660@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201027000920.GE3576660@ZenIV.linux.org.uk> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 27, 2020 at 12:09:20AM +0000, Al Viro wrote: > On Mon, Oct 26, 2020 at 06:03:18PM -0600, Jens Axboe wrote: > > The removal of compat_process_vm_{readv,writev} didn't change > > process_vm_rw(), which always assumes it's not doing a compat syscall. > > Instead of passing in 'false' unconditionally for 'compat', make it > > conditional on in_compat_syscall(). > > > > Fixes: c3973b401ef2 ("mm: remove compat_process_vm_{readv,writev}") > > Reported-by: Kyle Huey > > Signed-off-by: Jens Axboe > > ACK with some reservations - I suspect that we want an explicit flag > for process_vm_{read,write}v() that would force the 64bit layout for > the vector refering to the foreign process. It's not relevant for > regression fix; however, as it is these syscalls are not usable for > 32bit process trying to access memory of 64bit one - there's no way > to specify the addresses past 4G. Independent of this fix I think we just need to explicitly prohibit cross-access.