From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Fri, 17 May 2019 09:40:31 -0700 From: Kees Cook Subject: Re: [PATCH] libnvdimm/pmem: Bypass CONFIG_HARDENED_USERCOPY overhead Message-ID: <201905170938.99AACF0D@keescook> References: <155805321833.867447.3864104616303535270.stgit@dwillia2-desk3.amr.corp.intel.com> <20190517084739.GB20550@quack2.suse.cz> <2d8b1ba7890940bf8a512d4eef0d99b3@AcuMS.aculab.com> <201905170845.1B4E2A03@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: David Laight Cc: 'Jan Kara' , Dan Williams , "linux-nvdimm@lists.01.org" , "stable@vger.kernel.org" , Jeff Moyer , Ingo Molnar , Christoph Hellwig , Al Viro , Thomas Gleixner , Matthew Wilcox , Jeff Smits , "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" List-ID: On Fri, May 17, 2019 at 04:14:03PM +0000, David Laight wrote: > From: Kees Cook > > Sent: 17 May 2019 16:54 > ... > > > I've changed some of our code to use __get_user() to avoid > > > these stupid overheads. > > > > __get_user() skips even access_ok() checking too, so that doesn't seem > > like a good idea. Did you run access_ok() checks separately? (This > > generally isn't recommended.) > > Of course, I'm not THAT stupid :-) Right, yes, I know. :) I just wanted to double-check since accidents can happen. The number of underscores on these function is not really a great way to indicate what they're doing. ;) -- Kees Cook