From: Li Zefan <lizf@cn.fujitsu.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
Andrew Morton <akpm@linux-foundation.org>,
Frederic Weisbecker <fweisbec@gmail.com>,
Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH 6/7] tracing: reset ring buffer when removing modules with events
Date: Thu, 07 May 2009 11:51:18 +0800 [thread overview]
Message-ID: <4A025AB6.6070109@cn.fujitsu.com> (raw)
In-Reply-To: <20090507031434.586509269@goodmis.org>
> From: Steven Rostedt <srostedt@redhat.com>
>
> Li Zefan found that there's a race using the event ids of events and
> modules. When a module is loaded, an event id is incremented. We only
> have 16 bits for event ids (65536) and there is a possible (but highly
> unlikely) race that we could load and unload a module that registers
> events so many times that the event id counter overflows.
>
> When it overflows, it then restarts and goes looking for available
> ids. An id is available if it was added by a module and released.
>
> The race is if you have one module add an id, and then is removed.
> Another module loaded can use that same event id. But if the old module
> still had events in the ring buffer, the new module's call back would
> get bogus data. At best (and most likely) the output would just be
> garbage. But if the module for some reason used pointers (not recommended)
> then this could potentially crash.
>
> The safest thing to do is just reset the ring buffer if a module that
> registered events is removed.
>
> [ Impact: prevent unpredictable results of event id overflows ]
>
> Reported-by: Li Zefan <lizf@cn.fujitsu.com>
> LKML-Reference: <49FEAFD0.30106@cn.fujitsu.com>
> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Reviewed-by: Li Zefan <lizf@cn.fujitsu.com>
next prev parent reply other threads:[~2009-05-07 3:50 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-07 3:13 [PATCH 0/7] [GIT PULL] tracing/ring-buffer: more updates for tip Steven Rostedt
2009-05-07 3:13 ` [PATCH 1/7] ring-buffer: remove unneeded conditional in rb_reserve_next Steven Rostedt
2009-05-07 8:23 ` Ingo Molnar
2009-05-07 3:13 ` [PATCH 2/7] ring-buffer: check for failed allocation in ring buffer benchmark Steven Rostedt
2009-05-07 3:13 ` [PATCH 3/7] ring-buffer: make moving the tail page a separate function Steven Rostedt
2009-05-07 8:27 ` Ingo Molnar
2009-05-07 13:26 ` Steven Rostedt
2009-05-07 13:56 ` Ingo Molnar
2009-05-07 3:13 ` [PATCH 4/7] ring-buffer: change test to be more latency friendly Steven Rostedt
2009-05-07 8:31 ` Ingo Molnar
2009-05-07 8:34 ` Ingo Molnar
2009-05-07 13:51 ` Steven Rostedt
2009-05-07 3:13 ` [PATCH 5/7] tracing: update sample with TRACE_INCLUDE_FILE Steven Rostedt
2009-05-07 3:13 ` [PATCH 6/7] tracing: reset ring buffer when removing modules with events Steven Rostedt
2009-05-07 3:51 ` Li Zefan [this message]
2009-05-07 16:24 ` Frederic Weisbecker
2009-05-07 3:13 ` [PATCH 7/7] tracing: add hierarchical enabling of events Steven Rostedt
2009-05-07 3:51 ` Li Zefan
2009-05-07 13:21 ` Steven Rostedt
2009-05-08 1:11 ` Li Zefan
2009-05-08 1:23 ` Steven Rostedt
2009-05-08 1:24 ` Steven Rostedt
2009-05-07 16:28 ` Frederic Weisbecker
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=4A025AB6.6070109@cn.fujitsu.com \
--to=lizf@cn.fujitsu.com \
--cc=akpm@linux-foundation.org \
--cc=fweisbec@gmail.com \
--cc=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rostedt@goodmis.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.