lkml.org 
[lkml]   [2008]   [Jul]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 02/04] s390: bus_id -> dev_set_name() changes
On Wed, 2 Jul 2008 16:07:42 -0700,
Greg KH <greg@kroah.com> wrote:

> On Thu, Jul 03, 2008 at 02:14:01AM +0400, Anton Vorontsov wrote:
> > On Wed, Jul 02, 2008 at 08:48:11AM -0700, Greg KH wrote:
> > > --- a/drivers/s390/block/dcssblk.c
> > > +++ b/drivers/s390/block/dcssblk.c
> > > @@ -349,7 +349,7 @@ dcssblk_add_store(struct device *dev, st
> > > }
> > >
> > > strcpy(dev_info->segment_name, local_buf);
> > > - strlcpy(dev_info->dev.bus_id, local_buf, BUS_ID_SIZE);
> > > + dev_set_name(&dev_info->dev, local_buf);
> >
> > As I see it, dev_set_name accepts printf like string, so this
> > dev_set_name is quite dangerous (since local_buf is formed
> > by the module param), no?
>
> So you would rather see:
> dev_set_name(&dev_info->dev, "%s", local_buf);
>
> instead?

Hm, I thought the string had already been sanitized at that time, but
looking again it doesn't do many checks... so this looks better.


\
 
 \ /
  Last update: 2008-07-03 10:55    [from the cache]
©2003-2011 Jasper Spaans