public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: Steven Rostedt <srostedt@redhat.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 4/4] tracing: fix splice return too large
Date: Wed, 8 Apr 2009 11:55:09 +0200	[thread overview]
Message-ID: <20090408095509.GA22471@elte.hu> (raw)
In-Reply-To: <49DC6F01.6030203@cn.fujitsu.com>


* Lai Jiangshan <laijs@cn.fujitsu.com> wrote:

> Ingo Molnar wrote:
> > * Lai Jiangshan <laijs@cn.fujitsu.com> wrote:
> > 
> >> -	for (i = 0; i < PIPE_BUFFERS && len; i++, len -= size) {
> >> +	if (*ppos & (PAGE_SIZE - 1)) {
> >> +		WARN_ONCE(1, "Ftrace: previous read must page-align\n");
> >> +		return -EINVAL;
> >> +	}
> >> +
> >> +	if (len & (PAGE_SIZE - 1)) {
> >> +		WARN_ONCE(1, "Ftrace: splice_read should page-align\n");
> >> +		if (len < PAGE_SIZE)
> >> +			return -EINVAL;
> >> +		len &= PAGE_MASK;
> >> +	}
> > 
> > Hm, the fix looks good, but is it a good idea to allow the 
> > triggering of this message from user-space?
> > 
> 
> But it is only triggered once.
> 
> If user get content from trace_pipe_raw with non-page-align, the 
> content is garbage. It's wasting, the kernel disallows it. This 
> message tell user why he read failed.
> 
> These 4 patches make trace_pipe_raw more robustious and consistent 
> (read by read(2) and splice). I focus on handling raw ftrace data 
> in userspace, these raw ftrace data should be trustiness.

Ok, agreed.

i've applied these four fixes from you to tip:tracing/splice, 
thanks. Steve: i think they are tracing/urgent material - do you 
agree?

	Ingo

  reply	other threads:[~2009-04-08  9:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-02  7:17 [PATCH 4/4] tracing: fix splice return too large Lai Jiangshan
2009-04-03 13:16 ` Ingo Molnar
2009-04-08  9:31   ` Lai Jiangshan
2009-04-08  9:55     ` Ingo Molnar [this message]
2009-04-13 14:13       ` Steven Rostedt
2009-04-10 11:07 ` [tip:tracing/core] " Lai Jiangshan

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=20090408095509.GA22471@elte.hu \
    --to=mingo@elte.hu \
    --cc=fweisbec@gmail.com \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=srostedt@redhat.com \
    /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