Re: [RFC][PATCH 19/23 v4] seq_buf: Create seq_buf_used() to find out how much was written

From: Steven Rostedt
Date: Fri Nov 14 2014 - 12:34:49 EST


On Fri, 14 Nov 2014 18:23:06 +0100
Petr Mladek <pmladek@xxxxxxx> wrote:

> On Thu 2014-11-13 20:13:03, Steven Rostedt wrote:
> > From: "Steven Rostedt (Red Hat)" <rostedt@xxxxxxxxxxx>
> >
> > Add a helper function seq_buf_used() that replaces the SEQ_BUF_USED()
> > private macro to let callers have a method to know how much of the
> > seq_buf was written to.
> >
> > Signed-off-by: Steven Rostedt <rostedt@xxxxxxxxxxx>
>
> Reviewed-by: Petr Mladek <pmladek@xxxxxxx>
>
> The patch is correct. But we should move it before "[RFC][PATCH 17/23
> v4] tracing: Have seq_buf use full buffer" and use it everywhere
> any code is accessing the internal buffer using the seq.len value.
> I mean to solve the potential buffer overflows mentioned for
> "[RFC][PATCH 13/23 v4] tracing: Create seq_buf layer in trace_seq"
>
> Best Regards,

Bah, I'm getting seq_buf_buffer_left() confused with seq_buf_used().
Yes, this should be moved before hand. I thought it was by looking at:

git show <patch-17-SHA1>:include/linux/seq_buf.h

I saw the seq_buf_buffer_left() and confused that with seq_buf_used()
and said to myself "oh good, it has the function I need". Not!

Thanks,

-- Steve
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/