Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp556781ybj; Tue, 5 May 2020 03:47:03 -0700 (PDT) X-Google-Smtp-Source: APiQypJKJiazHjAmFxRGQs6j4BRQ2HtLLYv9kUOQicUIDASVZAs3vu0uWDQhYgaRj3QXFOqx/1Ji X-Received: by 2002:a17:906:2f8f:: with SMTP id w15mr2006255eji.255.1588675623620; Tue, 05 May 2020 03:47:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588675623; cv=none; d=google.com; s=arc-20160816; b=wQt5FVRIZt6M3PzeghOZ//h1EjeZU7jZ9k8f8tXpjq21M/9c0upht88vpdXL9hnfEo vhlwQZOI4A57qR8qqcNv0mS41l6D+CHxYMw6/+22GOMRfZnSVWUvS0SuYYRG5eT3ygkE 1BjwzcGGHNd4WagReu9VhPVWj8w9aPdcP5d5gfAvM/zoGMMjvIqCB7MEeJuGuzt+PSSh +lIV8t9V43qYC5d8zoo08UwGsBnl/HxEOEsqZDcQCII+xv0wBX1XDVsiZzprP43WUof2 sBYVE6w1yhkKgJ3Z6oZNpkSY+pNRWwbl6yggltW4NDcT0dfrjhTztoHlww6Sk8e6UE2/ U2aA== 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=znQfp8csgXH+vP2F+tHT//p1h3JFAJUeeonldQWeMOQ=; b=FLgQWeoJ2x9qSYF6b0Oo8lgxHj4XRJndv5uGmQSpA2ygCTCC3U1NZpdO5E6JxGiRzu 5afafFbYUkYnUT0HFlThPEKl+JPZu9K5awGTvOcsveOaWvpSr4biFVa6oP+bSAYUVIfi xLdlvfTO7K6cXL5h5XCj6/ymDwg4SZ/uwirrFHUSylhDERV6RXfWWgc/e29en7kE8Mvk xBvLEzziu5xTRm4QT30SV80TQ7MfJgfaVmYPwgwjnTH2kWriNcLq9hhvqGZkXMlbXWX+ bV+LNroJuOlgiheqd5JPyv5ldwGeAP42wpGC6FVsjJRJoQmCcYAvK/4st2P6JW9UP6N6 858w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-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 f10si919009ejb.466.2020.05.05.03.46.40; Tue, 05 May 2020 03:47:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-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-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728670AbgEEKoR (ORCPT + 99 others); Tue, 5 May 2020 06:44:17 -0400 Received: from verein.lst.de ([213.95.11.211]:34604 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728233AbgEEKoR (ORCPT ); Tue, 5 May 2020 06:44:17 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 4F60368C4E; Tue, 5 May 2020 12:44:14 +0200 (CEST) Date: Tue, 5 May 2020 12:44:14 +0200 From: Christoph Hellwig To: "Darrick J. Wong" Cc: Christoph Hellwig , linux-ext4@vger.kernel.org, viro@zeniv.linux.org.uk, jack@suse.cz, tytso@mit.edu, adilger@dilger.ca, riteshh@linux.ibm.com, amir73il@gmail.com, linux-fsdevel@vger.kernel.org, linux-unionfs@vger.kernel.org Subject: Re: [PATCH 10/11] fs: remove the access_ok() check in ioctl_fiemap Message-ID: <20200505104414.GD15815@lst.de> References: <20200427181957.1606257-1-hch@lst.de> <20200427181957.1606257-11-hch@lst.de> <20200428152124.GL6741@magnolia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200428152124.GL6741@magnolia> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Tue, Apr 28, 2020 at 08:21:24AM -0700, Darrick J. Wong wrote: > On Mon, Apr 27, 2020 at 08:19:56PM +0200, Christoph Hellwig wrote: > > access_ok just checks we are fed a proper user pointer. We also do that > > in copy_to_user itself, so no need to do this early. > > > > Signed-off-by: Christoph Hellwig > > Hmm. It's a minor behavioral change that we no longer require the > entire extent array to be accessible at the start even if parts of it > would never have gotten accessed, but I don't think that matters, so: Note that access_ok only checks if the memory actually is in userspace, so they only thing seeing a behavior difference would be an exploit of some kind.