public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, stable@kernel.org
Cc: stable-review@kernel.org, torvalds@linux-foundation.org,
	akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk,
	Chris Wright <chrisw@sous-sol.org>,
	Tavis Ormandy <taviso@google.com>, Eugene Teo <eugene@redhat.com>,
	vendor-sec@lst.de, Steven Rostedt <rostedt@goodmis.org>
Subject: [03/11] tracing: Do not allow llseek to set_ftrace_filter
Date: Sat, 18 Sep 2010 11:44:59 -0700	[thread overview]
Message-ID: <20100918184621.147642702@clark.site> (raw)
In-Reply-To: <20100918184651.GA14224@kroah.com>

2.6.27-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Steven Rostedt <srostedt@redhat.com>

commit 9c55cb12c1c172e2d51e85fbb5a4796ca86b77e7 upstream.

Reading the file set_ftrace_filter does three things.

1) shows whether or not filters are set for the function tracer
2) shows what functions are set for the function tracer
3) shows what triggers are set on any functions

3 is independent from 1 and 2.

The way this file currently works is that it is a state machine,
and as you read it, it may change state. But this assumption breaks
when you use lseek() on the file. The state machine gets out of sync
and the t_show() may use the wrong pointer and cause a kernel oops.

Luckily, this will only kill the app that does the lseek, but the app
dies while holding a mutex. This prevents anyone else from using the
set_ftrace_filter file (or any other function tracing file for that matter).

A real fix for this is to rewrite the code, but that is too much for
a -rc release or stable. This patch simply disables llseek on the
set_ftrace_filter() file for now, and we can do the proper fix for the
next major release.

Reported-by: Robert Swiecki <swiecki@google.com>
Cc: Chris Wright <chrisw@sous-sol.org>
Cc: Tavis Ormandy <taviso@google.com>
Cc: Eugene Teo <eugene@redhat.com>
Cc: vendor-sec@lst.de
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 kernel/trace/ftrace.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -1456,7 +1456,7 @@ static struct file_operations ftrace_fil
 	.open = ftrace_filter_open,
 	.read = ftrace_regex_read,
 	.write = ftrace_filter_write,
-	.llseek = ftrace_regex_lseek,
+	.llseek = no_llseek,
 	.release = ftrace_filter_release,
 };
 



  parent reply	other threads:[~2010-09-18 18:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-18 18:46 [00/11] 2.6.27.54-stable review Greg KH
2010-09-18 18:44 ` [01/11] ALSA: seq/oss - Fix double-free at error path of snd_seq_oss_open() Greg KH
2010-09-18 18:44 ` [02/11] ath9k_hw: fix parsing of HT40 5 GHz CTLs Greg KH
2010-09-18 18:44 ` Greg KH [this message]
2010-09-18 18:45 ` [04/11] irda: off by one Greg KH
2010-09-18 18:45 ` [05/11] bounce: call flush_dcache_page() after bounce_copy_vec() Greg KH
2010-09-18 18:45 ` [06/11] x86-64, compat: Test %rax for the syscall number, not %eax Greg KH
2010-09-18 18:45 ` [07/11] compat: Make compat_alloc_user_space() incorporate the access_ok() Greg KH
2010-09-18 18:45 ` [08/11] hwmon: (f75375s) Shift control mode to the correct bit position Greg KH
2010-09-18 18:45 ` [09/11] hwmon: (f75375s) Do not overwrite values read from registers Greg KH
2010-09-18 18:45 ` [10/11] apm_power: Add missing break statement Greg KH
2010-09-18 18:45 ` [11/11] x86-64, compat: Retruncate rax after ia32 syscall entry tracing Greg KH

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=20100918184621.147642702@clark.site \
    --to=gregkh@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=chrisw@sous-sol.org \
    --cc=eugene@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=stable-review@kernel.org \
    --cc=stable@kernel.org \
    --cc=taviso@google.com \
    --cc=torvalds@linux-foundation.org \
    --cc=vendor-sec@lst.de \
    /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