Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934693AbdC3TKT (ORCPT ); Thu, 30 Mar 2017 15:10:19 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:54102 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934299AbdC3TKS (ORCPT ); Thu, 30 Mar 2017 15:10:18 -0400 Date: Thu, 30 Mar 2017 20:10:09 +0100 From: Al Viro To: Linus Torvalds Cc: Russell King - ARM Linux , "linux-arch@vger.kernel.org" , Linux Kernel Mailing List , Richard Henderson , Will Deacon , Haavard Skinnemoen , Vineet Gupta , Steven Miao , Jesper Nilsson , Mark Salter , Yoshinori Sato , Richard Kuo , Tony Luck , Geert Uytterhoeven , James Hogan , Michal Simek , David Howells , Ley Foon Tan , Jonas Bonn , Helge Deller , Martin Schwidefsky , Ralf Baechle , Benjamin Herrenschmidt , Chen Liqin , "David S. Miller" , Chris Metcalf , Richard Weinberger , Guan Xuetao , Thomas Gleixner , Chris Zankel Subject: Re: [RFC][CFT][PATCHSET v1] uaccess unification Message-ID: <20170330191009.GU29622@ZenIV.linux.org.uk> References: <20170329055706.GH29622@ZenIV.linux.org.uk> <20170330162241.GG7909@n2100.armlinux.org.uk> <20170330164342.GR29622@ZenIV.linux.org.uk> <20170330184824.GS29622@ZenIV.linux.org.uk> <20170330185427.GT29622@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 734 Lines: 16 On Thu, Mar 30, 2017 at 11:59:16AM -0700, Linus Torvalds wrote: > But regardless of that, I think you're being silly to even look at the > iovec code. That code simply *isn't* critical enough that one or two > extra instructions matter. > > Show me profiles to the contrary. I dare you. > > Those things shouldn't be using *anything* odd at all. They should be > using "copy_from_user()". Nothing else. That they very definitely should not. And not because of access_ok() or might_fault() - this is one place where zero-padding is absolutely wrong. So unless you are going to take it out of copy_from_user() and pray that random shit ioctls in random shit drivers check the return value properly, copy_from_user() is no-go here.