linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Jones <davej@redhat.com>
To: Greg KH <greg@kroah.com>
Cc: Nick Bowler <nbowler@elliptictech.com>,
	Ben Hutchings <ben@decadent.org.uk>,
	Rusty Russell <rusty@rustcorp.com.au>,
	Randy Dunlap <rdunlap@xenotime.net>,
	LKML <linux-kernel@vger.kernel.org>,
	Debian kernel maintainers <debian-kernel@lists.debian.org>
Subject: Re: [PATCH] module,bug: Add TAINT_OOT_MODULE flag for modules not built in-tree
Date: Tue, 25 Oct 2011 16:17:24 -0400	[thread overview]
Message-ID: <20111025201723.GA25063@redhat.com> (raw)
In-Reply-To: <20111025200455.GA6376@kroah.com>

On Tue, Oct 25, 2011 at 10:04:55PM +0200, Greg Kroah-Hartman wrote:
 > On Tue, Oct 25, 2011 at 12:51:42PM -0400, Nick Bowler wrote:
 > > On 2011-10-25 18:05 +0200, Ben Hutchings wrote:
 > > > On Tue, 2011-10-25 at 11:38 -0400, Nick Bowler wrote:
 > > > > This patch prevents the use of lockdep for debugging out of tree
 > > > > modules, which is rather mean.
 > > > 
 > > > It was already disabled for staging modules, which seems equally
 > > > unhelpful.
 > > 
 > > This is not the case: lockdep works fine with staging modules.
 > 
 > Yes, that was fixed a few kernel versions ago.
 > 
 > Now you might want to update that fix for the TAINT_OOT_MODULE flag as
 > well, if you feel it is needed.

I'm assuming you mean this patch ?

commit 7816c45bf13255157c00fb8aca86cb64d825e878
Author: Roland Vossen <rvossen@broadcom.com>
Date:   Thu Apr 7 11:20:58 2011 +0200

    modules: Enabled dynamic debugging for staging modules
    
    Driver modules from the staging directory are marked 'tainted'
    by module.c. Subsequently, tainted modules are denied dynamic
    debugging. This is unwanted behavior, since staging modules should
    be able to use the dynamic debugging mechanism.
    
    Please merge this also into the staging-linus branch.
    
    Signed-off-by: Roland Vossen <rvossen@broadcom.com>
    Acked-by: Jason Baron <jbaron@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

diff --git a/kernel/module.c b/kernel/module.c
index d5938a5..4d5c16a 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -2790,7 +2790,7 @@ static struct module *load_module(void __user *umod,
        }
 
        /* This has to be done once we're sure module name is unique. */
-       if (!mod->taints)
+       if (!mod->taints || mod->taints == (1U<<TAINT_CRAP))
                dynamic_debug_setup(info.debug, info.num_debug);
 
        /* Find duplicate symbols */
@@ -2827,7 +2827,7 @@ static struct module *load_module(void __user *umod,
        module_bug_cleanup(mod);
 
  ddebug:
-       if (!mod->taints)
+       if (!mod->taints || mod->taints == (1U<<TAINT_CRAP))
                dynamic_debug_remove(info.debug);
  unlock:
        mutex_unlock(&module_mutex);



If we want to support out of tree modules with this, should we just nuke the
whole check, or do we still want to prevent certain types of tainted kernels
from using this stuff ?

(sidenote: it's not immediately obvious to me that this is the right patch,
as dynamic debug & lockdep are separate things, though this was the only
thing in kernel/module.c's history this year that sounds similar)

	Dave


  reply	other threads:[~2011-10-25 20:18 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-24 13:12 [PATCH] module,bug: Add TAINT_OOT_MODULE flag for modules not built in-tree Ben Hutchings
2011-10-24 13:58 ` Dave Jones
2011-10-24 14:57 ` Randy Dunlap
2011-10-25  3:56   ` Rusty Russell
2011-10-25  9:52     ` Ben Hutchings
2011-10-25 15:38     ` Nick Bowler
2011-10-25 16:05       ` Ben Hutchings
2011-10-25 16:51         ` Nick Bowler
2011-10-25 20:04           ` Greg KH
2011-10-25 20:17             ` Dave Jones [this message]
2011-10-25 20:54               ` Greg KH
2011-10-26 13:08                 ` Nick Bowler
2011-10-27  1:11                   ` Rusty Russell
2011-10-27  1:55                     ` Dave Jones
2011-10-31  1:30                       ` Rusty Russell
2011-10-27  5:49                     ` Greg KH
2011-10-26  4:16               ` Rusty Russell
2011-10-26  6:15                 ` Mathieu Desnoyers
2011-10-25  1:37 ` Greg KH
2011-12-12 21:40 ` Luis R. Rodriguez
2011-12-12 21:58   ` Ben Hutchings
2011-12-12 22:47     ` Luis R. Rodriguez
2011-12-12 22:49       ` Luis R. Rodriguez
2011-12-13  5:02       ` Ben Hutchings
2011-12-14 16:20         ` [RFC] modpost: add option to allow external modules to avoid taint John W. Linville
2011-12-14 16:52           ` Ben Hutchings
2011-12-14 17:39             ` John W. Linville
     [not found]           ` <87mxatp3ty.fsf@rustcorp.com.au>
2011-12-16  4:39             ` Ben Hutchings
2011-12-19  5:45               ` Rusty Russell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111025201723.GA25063@redhat.com \
    --to=davej@redhat.com \
    --cc=ben@decadent.org.uk \
    --cc=debian-kernel@lists.debian.org \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nbowler@elliptictech.com \
    --cc=rdunlap@xenotime.net \
    --cc=rusty@rustcorp.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).