lkml.org 
[lkml]   [2021]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] tracing/histogram: Do not copy the fixed-size char array field over the field size
[ Resending to linux-kernel instead of ilinux-kernel ]

On Tue, 16 Nov 2021 13:34:31 -0500
Steven Rostedt <rostedt@goodmis.org> wrote:

> On Tue, 16 Nov 2021 09:53:59 -0800
> Beau Belgrave <beaub@linux.microsoft.com> wrote:
>
> > > @@ -3025,7 +3026,7 @@ static inline void __update_field_vars(struct tracing_map_elt *elt,
> > > char *str = elt_data->field_var_str[j++];
> > > char *val_str = (char *)(uintptr_t)var_val;
> > >
> > > - strscpy(str, val_str, STR_VAR_LEN_MAX);
> > > + strscpy(str, val_str, val->size);
> >
> > Is it possible for val->size to be larger than STR_VAR_LEN_MAX?
> > field_var_str is alloc'd to be the size of STR_VAR_LEN_MAX (256).
>
> Yes.
>
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=938aa33f14657c9ed9deea348b7d6f14b6d69cb7
>
> ;-)
>
> -- Steve
>
> >
> > > var_val = (u64)(uintptr_t)str;
> > > }
> > > tracing_map_set_var(elt, var_idx, var_val);
> > > @@ -4920,7 +4921,7 @@ static void hist_trigger_elt_update(struct hist_trigger_data *hist_data,
> > >
> > > str = elt_data->field_var_str[idx];
> > > val_str = (char *)(uintptr_t)hist_val;
> > > - strscpy(str, val_str, STR_VAR_LEN_MAX);
> > > + strscpy(str, val_str, hist_field->size);
> >
> > Same as above.
>

\
 
 \ /
  Last update: 2021-11-16 20:02    [W:0.025 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site