lkml.org 
[lkml]   [2021]   [Jan]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] staging: greybus: fix stack size warning with UBSAN
On Sun, Jan 03, 2021 at 11:35:32PM +0100, Arnd Bergmann wrote:
> @@ -1050,78 +1088,28 @@ static int gbaudio_tplg_create_widget(struct gbaudio_module_info *module,
> strlcpy(temp_name, w->name, NAME_SIZE);
> snprintf(w->name, NAME_SIZE, "GB %d %s", module->dev_id, temp_name);
>
> + if (w->type > ARRAY_SIZE(gbaudio_widgets)) {
^^

Off by one. >= here.


> + ret = -EINVAL;
> + goto error;
> + }
> + *dw = gbaudio_widgets[w->type];
> + dw->name = w->name;

regards,
dan carpenter

\
 
 \ /
  Last update: 2021-01-04 07:25    [W:0.033 / U:24.988 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site