From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753337AbdASPiL (ORCPT ); Thu, 19 Jan 2017 10:38:11 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33380 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753114AbdASPiI (ORCPT ); Thu, 19 Jan 2017 10:38:08 -0500 Subject: Re: [RFC][PATCH] x86: Verify access_ok() context To: Andy Lutomirski 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> Cc: Thomas Gleixner , Peter Zijlstra , Linus Torvalds , Ingo Molnar , "H. Peter Anvin" , "linux-kernel@vger.kernel.org" , "Frank Ch. Eigler" From: David Smith Message-ID: <98694f81-234e-fc7b-9bd4-477a07d91ef2@redhat.com> Date: Thu, 19 Jan 2017 09:37:35 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 19 Jan 2017 15:37:37 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/18/2017 06:19 PM, Andy Lutomirski wrote: > On Wed, Jan 18, 2017 at 2:16 PM, David Smith wrote: >> On 01/16/2017 03:14 PM, Thomas Gleixner wrote: >>> On Mon, 16 Jan 2017, David Smith wrote: ... stuff deleted ... >>>> 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. 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. > > That doesn't seem like such a big deal to me. To be clear here, I'm not suggesting we replace the access_ok() macro with an exported kernel function. I'm just stating the fact that if you have several modules that call the access_ok() macro (or one module that gets loaded/unloaded/reloaded multiple times), each one can produce the new warning. I'm not seeing a "flood" of these new warnings, but a steady enough stream of them to be annoying. -- David Smith dsmith@redhat.com Red Hat http://www.redhat.com 256.217.0141 (direct) 256.837.0057 (fax)