From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754352AbdASSqL (ORCPT ); Thu, 19 Jan 2017 13:46:11 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:58159 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754334AbdASSqJ (ORCPT ); Thu, 19 Jan 2017 13:46:09 -0500 Date: Thu, 19 Jan 2017 19:12:48 +0100 (CET) From: Thomas Gleixner To: David Smith cc: Peter Zijlstra , Linus Torvalds , Andy Lutomirski , Ingo Molnar , "H. Peter Anvin" , "linux-kernel@vger.kernel.org" , "Frank Ch. Eigler" Subject: Re: [RFC][PATCH] x86: Verify access_ok() context In-Reply-To: <8758e5b4-050d-a5dd-2e58-e4f9dccc734b@redhat.com> Message-ID: References: <20161122095715.GN3092@twins.programming.kicks-ass.net> <20161122193720.GA3045@worktop.programming.kicks-ass.net> <20161205102747.GT3092@twins.programming.kicks-ass.net> <8758e5b4-050d-a5dd-2e58-e4f9dccc734b@redhat.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 18 Jan 2017, David Smith wrote: > On 01/16/2017 03:14 PM, Thomas Gleixner wrote: > >> If you put that new access_ok() call in a module that gets > >> loaded/unloaded, you see one warning for every module load, which gets a > >> bit annoying. > > > > Can you please elaborate where this access_ok() is placed in the module > > code? > > It doesn't really matter where you place the access_ok() call in the > module code. It does matter very much, because the fact that the warning triggers tells me that it's placed in code which is NOT executed in task context. > If you call access_ok() in a module, then that module has > its own WARN_ON_ONCE() static variable. If access_ok() was a function > exported from the kernel, then there would be only one copy of the > WARN_ON_ONCE() static variable. Not a big deal. If access_ok() is called from the wrong context in that module then this should be fixed and not the warning supressed. We are not papering over problems. Thanks, tglx