Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3178034ybz; Mon, 27 Apr 2020 11:21:17 -0700 (PDT) X-Google-Smtp-Source: APiQypITksplU/LxnOHrottWURQxnpIIOyRRWvXfhov+I7dFhWvLrfIALm4wEwtxiK0fXs1JVt5u X-Received: by 2002:a17:906:af6f:: with SMTP id os15mr21312718ejb.78.1588011677138; Mon, 27 Apr 2020 11:21:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588011677; cv=none; d=google.com; s=arc-20160816; b=Rpd7wWwufj1AeU52a4mNlHQ5yoMDvBupMKKW34a0te8K7tk8NIwSoURlPq8CVn7GTq 9EUlymgwbIimEU9VsRbmT+kUXdf72dx520drZO0OWKWN2pi1VYnr9e8jl+VJRw/J51un His5maTWeby4N/98ToqGwzECqzuBAaK1FQ+SK1YWB9LQVrIgZ8eT86VFCvtfBSECWr1X bRzj+iaVVz7FQyBP5aKQUdWfwli9sf5rGaWUXBDKA9GKHB+jz+Kybyu6CCGg9nrUfuOG QJ/y13HRSkuD+vMzYScdQ1n0eqyqrTJN2wbRNhmg8OmNXmksj9DhMOGno+NgNhVo/hGo gvNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=wiK8u2lq86CLEJk2sltbigywC//kREoH6b7fL3RvaWg=; b=eSAyYQVZcWD2anT4+4HWGh921DnCp5wBpC4aYaPEHMLaxY5VCJ7V7dczyD40RGmV6d IEsO5oMkerkK1gDtw7ubTOjCiikWzqDzze9UVTSVSzlTd8hUqybls3+JOmaZKPWcTmkz j2infRB/XKoLY++eS8QUaene9NJfnOEKquAyTfUIE2sWzGDGfrYHDoEsG2DPEJe5IRDd 3PfVYo+EjibBW+934Fv05ncgFH8NVROT7alpO8rGfnEWdtXKpcgODXT+BrF12ruEBPMN B4kkF7KPuqR3H3IhcZRFRCK8YZYVC24iHmuXGxYUnB23gqQjZdbszs6Hw9KjQCjengoY MBNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="e/+8k00m"; 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 p22si233056edx.177.2020.04.27.11.20.53; Mon, 27 Apr 2020 11:21:17 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="e/+8k00m"; 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 S1726315AbgD0SU1 (ORCPT + 99 others); Mon, 27 Apr 2020 14:20:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726228AbgD0SU1 (ORCPT ); Mon, 27 Apr 2020 14:20:27 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34E78C0610D5; Mon, 27 Apr 2020 11:20:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=wiK8u2lq86CLEJk2sltbigywC//kREoH6b7fL3RvaWg=; b=e/+8k00mqcfTWYriIXfKmf08/X cQxqOE8yNydgrjrrrKWwgly2dHrXjiBqyTXmKWRHBJS9w0akmq6ev/XlfCMVKlZh+WG0+SeEn2iuc tyWpKVRryZhwPw00d2lopNc+GmJ0hMCbPsVKYcil/ahewVx9w/3xJlA3nKQnwhATWn3VnOBbL/+hC wsLbovhP0ghZmJeBsxQe2mpf9/GUlRddt1v9gHfOk36fp2+e0oLEmJEPJ3p/YwqxhdKrSbSnIomX4 bNsQVzoJNTdna1zZJVX4yulr1OfZ7kmN21IXPBxrOR6dMyz+hDaCtwMnx2kdSdf2yA+qLCCzamQCH H6oVRfmg==; Received: from [2001:4bb8:193:f203:c70:4a89:bc61:2] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jT8Mk-0004d4-Lg; Mon, 27 Apr 2020 18:20:27 +0000 From: Christoph Hellwig To: linux-ext4@vger.kernel.org, viro@zeniv.linux.org.uk Cc: 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: [PATCH 11/11] ext4: remove the access_ok() check in ext4_ioctl_get_es_cache Date: Mon, 27 Apr 2020 20:19:57 +0200 Message-Id: <20200427181957.1606257-12-hch@lst.de> X-Mailer: git-send-email 2.26.1 In-Reply-To: <20200427181957.1606257-1-hch@lst.de> References: <20200427181957.1606257-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org 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 --- fs/ext4/ioctl.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c index 0746532ba463d..7fded54d2dba9 100644 --- a/fs/ext4/ioctl.c +++ b/fs/ext4/ioctl.c @@ -754,11 +754,6 @@ static int ext4_ioctl_get_es_cache(struct file *filp, unsigned long arg) fieinfo.fi_extents_max = fiemap.fm_extent_count; fieinfo.fi_extents_start = ufiemap->fm_extents; - if (fiemap.fm_extent_count != 0 && - !access_ok(fieinfo.fi_extents_start, - fieinfo.fi_extents_max * sizeof(struct fiemap_extent))) - return -EFAULT; - if (fieinfo.fi_flags & FIEMAP_FLAG_SYNC) filemap_write_and_wait(inode->i_mapping); -- 2.26.1