Re: [patch 2/2] track and print last unloaded module in the oops trace

Arjan van de Ven
2008-01-08T14:27:28Z

On Tue, 8 Jan 2008 14:51:37 +0100
DM <dm.n9107@gmail.com> wrote:

> On Jan 7, 2008 12:19 AM, Arjan van de Ven <arjan@infradead.org> wrote:
> [...]
> > This patch tracks the last unloaded module, and prints this as part
> > of the module list in the oops trace.
> >
> [...]
> > }
> > + /* Store the name of the last unloaded module for
> > diagnostic purposes */
> > + sprintf(last_unloaded_module, mod->name);
> > free_module(mod);
> >
>
> 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