mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: LKML <linux-kernel@vger.kernel.org>, Ingo Molnar <mingo@elte.hu>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH v2][GIT PULL] tracing: Prevent unloadable modules from using trace_bprintk()
Date: Thu, 21 Oct 2010 18:34:23 -0400	[thread overview]
Message-ID: <1287700463.16971.603.camel@gandalf.stny.rr.com> (raw)
In-Reply-To: <201010220805.14454.rusty@rustcorp.com.au>

On Fri, 2010-10-22 at 08:05 +1030, Rusty Russell wrote:
> On Fri, 22 Oct 2010 12:15:42 am Steven Rostedt wrote:
> > 
> > Ingo,
> > 
> > This is based off of my core-2 branch. I'm moved this patch after that
> > so if anyone has any objections, I can change this patch without holding
> > off the previous one.
> 
> I think disabling use in modules is lazy,

and safer.

It's not a big deal if a module does not use it. What we have is
"trace_printk()" and if the format passed to it is static, that turns
into trace_bprintk(). If the format is a variable, then you are stuck
with trace_printk() that just does the sprintf() operation in the trace.
Which this patch makes all modules do.

With trace_bprintk() the pointer to the format and arguments are put
into the ring buffer for later processing.


>  and allowing it for !MODVERSIONS
> is just weird.

that was me being weirdly paranoid ;-)

> 
> Can't you detect this on module unload and fix it up?  Or delay freeing the
> module until the trace ring is emptied?

One possibility is to magically make all string formats used in
trace_printk into its own section, and keep it allocated until the ring
buffer is empty. Or, we can just do that with the module's entire string
section, since we know whether or not that module has a trace_printk in
it or not.

-- Steve




  reply	other threads:[~2010-10-21 22:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-21 13:45 Steven Rostedt
2010-10-21 21:35 ` Rusty Russell
2010-10-21 22:34   ` Steven Rostedt [this message]
2010-10-22  3:43     ` Rusty Russell
2010-10-22  3:58       ` Steven Rostedt
2010-10-22  4:34         ` Rusty Russell
2010-10-22  5:30           ` Li Zefan
2010-10-22 13:49             ` Steven Rostedt
2010-10-25  1:32               ` Li Zefan
2010-10-22  8:05 ` Ingo Molnar
2010-10-22 13:50   ` Steven Rostedt

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=1287700463.16971.603.camel@gandalf.stny.rr.com \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rusty@rustcorp.com.au \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /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

all inboxes | Powered by JetHome®