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 1C050C4360C for ; Tue, 8 Oct 2019 15:29:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F2F0420815 for ; Tue, 8 Oct 2019 15:29:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727412AbfJHP3E (ORCPT ); Tue, 8 Oct 2019 11:29:04 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:58786 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726134AbfJHP3E (ORCPT ); Tue, 8 Oct 2019 11:29:04 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.2 #3 (Red Hat Linux)) id 1iHrQ4-00038Y-RO; Tue, 08 Oct 2019 15:29:00 +0000 Date: Tue, 8 Oct 2019 16:29:00 +0100 From: Al Viro To: Greg KH Cc: Linus Torvalds , Guenter Roeck , Linux Kernel Mailing List , linux-fsdevel Subject: Re: [PATCH] Convert filldir[64]() from __put_user() to unsafe_put_user() Message-ID: <20191008152900.GT26530@ZenIV.linux.org.uk> References: <20191007012437.GK26530@ZenIV.linux.org.uk> <20191007025046.GL26530@ZenIV.linux.org.uk> <20191008032912.GQ26530@ZenIV.linux.org.uk> <20191008045712.GR26530@ZenIV.linux.org.uk> <20191008131416.GA2860109@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191008131416.GA2860109@kroah.com> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Tue, Oct 08, 2019 at 03:14:16PM +0200, Greg KH wrote: > On Tue, Oct 08, 2019 at 05:57:12AM +0100, Al Viro wrote: > > > > OK... BTW, do you agree that the use of access_ok() in > > drivers/tty/n_hdlc.c:n_hdlc_tty_read() is wrong? It's used as an early > > cutoff, so we don't bother waiting if user has passed an obviously bogus > > address. copy_to_user() is used for actual copying there... > > Yes, it's wrong, and not needed. I'll go rip it out unless you want to? I'll throw it into misc queue for now; it has no prereqs and nothing is going to depend upon it. While looking for more of the same pattern: usb_device_read(). Frankly, usb_device_dump() calling conventions look ugly - it smells like it would be much happier as seq_file. Iterator would take some massage, but that seems to be doable. Anyway, that's a separate story...