linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] tracing: disable seeking for trace_pipe_raw
@ 2009-04-02  7:16 Lai Jiangshan
  2009-04-10 11:06 ` [tip:tracing/core] " Lai Jiangshan
  0 siblings, 1 reply; 2+ messages in thread
From: Lai Jiangshan @ 2009-04-02  7:16 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: Ingo Molnar, Frederic Weisbecker, LKML


Impact: disable pread()

We set tracing_buffers_fops.llseek to no_llseek,
but we can still perform pread() to read this file.
That is not expected.

This fix uses nonseekable_open() to disable it.

tracing_buffers_fops.llseek is still set to no_llseek,
it mark this file is a "non-seekable device" and is used by
sys_splice(). See also do_splice() or manual of splice(2):

ERRORS
       EINVAL Target file system doesn't support  splicing;
              neither  of the descriptors refers to a pipe;
              or offset given for non-seekable device.

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
---
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 2a81dec..7283b99 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -3265,7 +3265,7 @@ static int tracing_buffers_open(struct inode *inode, struct file *filp)
 
 	filp->private_data = info;
 
-	return 0;
+	return nonseekable_open(inode, filp);
 
  out:
 	kfree(info);





^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [tip:tracing/core] tracing: disable seeking for trace_pipe_raw
  2009-04-02  7:16 [PATCH 1/4] tracing: disable seeking for trace_pipe_raw Lai Jiangshan
@ 2009-04-10 11:06 ` Lai Jiangshan
  0 siblings, 0 replies; 2+ messages in thread
From: Lai Jiangshan @ 2009-04-10 11:06 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, fweisbec, srostedt, tglx, laijs, mingo

Commit-ID:  d1e7e02f30be672c6f6ee40908be83877a0d49d1
Gitweb:     http://git.kernel.org/tip/d1e7e02f30be672c6f6ee40908be83877a0d49d1
Author:     Lai Jiangshan <laijs@cn.fujitsu.com>
AuthorDate: Thu, 2 Apr 2009 15:16:56 +0800
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Fri, 10 Apr 2009 12:44:42 +0200

tracing: disable seeking for trace_pipe_raw

Impact: disable pread()

We set tracing_buffers_fops.llseek to no_llseek,
but we can still perform pread() to read this file.

That is not expected.

This fix uses nonseekable_open() to disable it.

tracing_buffers_fops.llseek is still set to no_llseek,
it mark this file is a "non-seekable device" and is used by
sys_splice(). See also do_splice() or manual of splice(2):

ERRORS
       EINVAL Target file system doesn't support  splicing;
              neither  of the descriptors refers to a pipe;
              or offset given for non-seekable device.

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Steven Rostedt <srostedt@redhat.com>
LKML-Reference: <49D46668.8030806@cn.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>


---
 kernel/trace/trace.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 9d28476..24b0168 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -3285,7 +3285,7 @@ static int tracing_buffers_open(struct inode *inode, struct file *filp)
 
 	filp->private_data = info;
 
-	return 0;
+	return nonseekable_open(inode, filp);
 
  out:
 	kfree(info);

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-04-10 11:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-02  7:16 [PATCH 1/4] tracing: disable seeking for trace_pipe_raw Lai Jiangshan
2009-04-10 11:06 ` [tip:tracing/core] " Lai Jiangshan

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).