[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <49C98727.9050802@cn.fujitsu.com>
Date: Wed, 25 Mar 2009 09:21:43 +0800
From: Li Zefan <lizf@...fujitsu.com>
To: Ingo Molnar <mingo@...e.hu>
CC: Jens Axboe <jens.axboe@...cle.com>,
Steven Rostedt <rostedt@...dmis.org>,
Frederic Weisbecker <fweisbec@...il.com>,
Arnaldo Carvalho de Melo <acme@...hat.com>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 3/5] blktrace: fix off-by-one bug
Li Zefan wrote:
> 'what' is used as the index of array what2act, so it can't >= the array size.
>
I think this patch is needed no matter we support output of "abort"
event or not?
> Signed-off-by: Li Zefan <lizf@...fujitsu.com>
> ---
> kernel/trace/blktrace.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
> index 9af4143..0e91caa 100644
> --- a/kernel/trace/blktrace.c
> +++ b/kernel/trace/blktrace.c
> @@ -1149,7 +1149,7 @@ static enum print_line_t blk_trace_event_print(struct trace_iterator *iter,
> if (!trace_print_context(iter))
> return TRACE_TYPE_PARTIAL_LINE;
>
> - if (unlikely(what == 0 || what > ARRAY_SIZE(what2act)))
> + if (unlikely(what == 0 || what >= ARRAY_SIZE(what2act)))
> ret = trace_seq_printf(s, "Bad pc action %x\n", what);
> else {
> const bool long_act = !!(trace_flags & TRACE_ITER_VERBOSE);
> @@ -1196,7 +1196,7 @@ static enum print_line_t blk_tracer_print_line(struct trace_iterator *iter)
> t = (const struct blk_io_trace *)iter->ent;
> what = t->action & ((1 << BLK_TC_SHIFT) - 1);
>
> - if (unlikely(what == 0 || what > ARRAY_SIZE(what2act)))
> + if (unlikely(what == 0 || what >= ARRAY_SIZE(what2act)))
> ret = trace_seq_printf(&iter->seq, "Bad pc action %x\n", what);
> else {
> const bool long_act = !!(trace_flags & TRACE_ITER_VERBOSE);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists