lkml.org 
[lkml]   [2008]   [Jan]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [patch 2/2] track and print last unloaded module in the oops trace
Date
On Wednesday 09 January 2008 03:18:46 Ingo Molnar wrote:
> * DM <dm.n9107@gmail.com> wrote:
> > On Jan 8, 2008 3:26 PM, Arjan van de Ven <arjan@infradead.org> wrote:
> > > > Why use sprintf? If a module name contains the % character we could
> > > > overflow the buffer. Or is module-unloading root-only and we don't
> > > > care?
> > >
> > > module loading isn't just root only; the name comes from an already
> > > loaded module. If you can load kernel modules of your choice you own
> > > the entire kernel already anway
> >
> > Still, strcpy seems like a better choice IMHO.
>
> agreed, this just isnt obvious IMO:
>
> + sprintf(last_unloaded_module, mod->name);
>
> Ingo

Yes, I've changed it to:
+ strlcpy(last_unloaded_module, mod->name, sizeof(last_unloaded_module));

In my tree.

Thanks,
Rusty.


\
 
 \ /
  Last update: 2008-01-08 22:27    [W:0.047 / U:0.808 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site