From: tip-bot for Li Zefan <lizf@cn.fujitsu.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
rostedt@goodmis.org, lizf@cn.fujitsu.com, tglx@linutronix.de
Subject: [tip:tracing/core] tracing/filters: fix off-by-one bug
Date: Fri, 15 May 2009 14:43:02 GMT [thread overview]
Message-ID: <tip-5872144f64b34a5942f6b4acedc90b02de72c58b@git.kernel.org> (raw)
In-Reply-To: <4A0CDC8C.30602@cn.fujitsu.com>
Commit-ID: 5872144f64b34a5942f6b4acedc90b02de72c58b
Gitweb: http://git.kernel.org/tip/5872144f64b34a5942f6b4acedc90b02de72c58b
Author: Li Zefan <lizf@cn.fujitsu.com>
AuthorDate: Fri, 15 May 2009 11:07:56 +0800
Committer: Steven Rostedt <rostedt@goodmis.org>
CommitDate: Thu, 14 May 2009 23:55:12 -0400
tracing/filters: fix off-by-one bug
We should leave the last slot for the ending '\0'.
[ Impact: fix possible crash when the length of an operand is 128 ]
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
LKML-Reference: <4A0CDC8C.30602@cn.fujitsu.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
kernel/trace/trace_events_filter.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c
index 22c2998..a7430b1 100644
--- a/kernel/trace/trace_events_filter.c
+++ b/kernel/trace/trace_events_filter.c
@@ -736,7 +736,7 @@ static inline void clear_operand_string(struct filter_parse_state *ps)
static inline int append_operand_char(struct filter_parse_state *ps, char c)
{
- if (ps->operand.tail == MAX_FILTER_STR_VAL)
+ if (ps->operand.tail == MAX_FILTER_STR_VAL - 1)
return -EINVAL;
ps->operand.string[ps->operand.tail++] = c;
next prev parent reply other threads:[~2009-05-15 14:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-15 3:07 [PATCH 1/2] tracing/filters: add missing unlock in a failure path Li Zefan
2009-05-15 3:07 ` [PATCH 2/2] tracing/filters: fix off-by-one bug Li Zefan
2009-05-15 14:43 ` tip-bot for Li Zefan [this message]
2009-05-15 14:42 ` [tip:tracing/core] tracing/filters: add missing unlock in a failure path tip-bot for Li Zefan
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=tip-5872144f64b34a5942f6b4acedc90b02de72c58b@git.kernel.org \
--to=lizf@cn.fujitsu.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.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
all inboxes | Powered by JetHome®