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=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 9A6CAC4360C for ; Tue, 8 Oct 2019 20:34:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 798D021835 for ; Tue, 8 Oct 2019 20:34:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730985AbfJHUey (ORCPT ); Tue, 8 Oct 2019 16:34:54 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:34624 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727835AbfJHUey (ORCPT ); Tue, 8 Oct 2019 16:34:54 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.2 #3 (Red Hat Linux)) id 1iHwC4-0002Mx-0p; Tue, 08 Oct 2019 20:34:52 +0000 Date: Tue, 8 Oct 2019 21:34:51 +0100 From: Al Viro To: Linus Torvalds Cc: Guenter Roeck , Linux Kernel Mailing List , linux-fsdevel Subject: Re: [PATCH] Convert filldir[64]() from __put_user() to unsafe_put_user() Message-ID: <20191008203451.GX26530@ZenIV.linux.org.uk> References: <5f06c138-d59a-d811-c886-9e73ce51924c@roeck-us.net> <20191007012437.GK26530@ZenIV.linux.org.uk> <20191007025046.GL26530@ZenIV.linux.org.uk> <20191008195858.GV26530@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191008195858.GV26530@ZenIV.linux.org.uk> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 08, 2019 at 08:58:58PM +0100, Al Viro wrote: > The difference is, they have separate "for read" and "for write" primitives > and they want the range in their user_access_end() analogue. Separating > the read and write isn't a problem for callers (we want them close to > the actual memory accesses). Passing the range to user_access_end() just > might be tolerable, unless it makes you throw up... NOTE: I'm *NOT* suggesting to bring back the VERIFY_READ/VERIFY_WRITE argument to access_ok(). We'd gotten rid of it, and for a very good reason (and decades overdue). The main difference between access_ok() and user_access_begin() is that the latter is right next to actual memory access, with user_access_end() on the other side, also very close. And most of those guys would be concentrated in a few functions, where we bloody well know which direction we are copying. Even if we try and map ppc allow_..._to_user() on user_access_begin(), access_ok() remains as it is (and I hope we'll get rid of the majority of its caller in process).