mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vitaly Mayatskikh <v.mayatskih@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Pekka Paalanen <pq@iki.fi>
Subject: [PATCH] ftrace: advance readpos in trace_seq_to_user() by really read bytes
Date: Thu, 26 Mar 2009 18:22:18 +0100	[thread overview]
Message-ID: <87zlf8kxmd.wl%vmayatsk@redhat.com> (raw)

If tracer will not provide input buffer of enough size, he will never
see data between cnt and len bytes.

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 17bb88d..0217615 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -477,7 +477,7 @@ ssize_t trace_seq_to_user(struct trace_seq *s, char __user *ubuf, size_t cnt)
 	if (ret)
 		return -EFAULT;
 
-	s->readpos += len;
+	s->readpos += cnt;
 	return cnt;
 }
 

-- 
wbr, Vitaly

             reply	other threads:[~2009-03-26 17:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-26 17:22 Vitaly Mayatskikh [this message]
2009-03-26 18:13 ` Pekka Paalanen
2009-03-26 18:55   ` Vitaly Mayatskikh

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=87zlf8kxmd.wl%vmayatsk@redhat.com \
    --to=v.mayatskih@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pq@iki.fi \
    /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®