lkml.org 
[lkml]   [2014]   [Apr]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] staging: line6: fix possible overrun
On Sat, Apr 26, 2014 at 11:59:46PM +0200, Mateusz Guzik wrote:
> > And sadly enough some of those ->id strings are more than 15 characters
> > and a NUL which will fit in card->id. So this overflow is real. The
> > card->shortname is a 32 char array so none of those overflow.
> >
> > If we want to sovle the truncation issue then we need to think of
> > shorter names for BassPODxtLive, BassPODxtPro, PODStudioUX1, and
> > PODStudioUX2.
> >
>
> In that case I suggest compile time assertions that ids and names fit

That sounds like some magic code which I would love to see. :)

> and a WARN_ON + -EINVAL in line6_init_audio to catch future
> offenders.

Returning -EINVAL is a bad idea because it would break the driver
completely and make it unusable.

>
> As a side note I'm not sure if pod_try_init from drivers/staging/line6/pod.c
> cleans up properly after failed line6_init_audio.

Yeah. It doesn't seem to clean up at all.

regards,
dan carpenter



\
 
 \ /
  Last update: 2014-04-28 00:01    [W:0.094 / U:0.348 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site