[PATCH] modprobe-small: do dir-stripping in filename2modname

Isaac Dunham ibid.ag at gmail.com
Sun Jan 11 21:02:31 UTC 2015


On Sun, Jan 11, 2015 at 05:39:19PM +0100, Denys Vlasenko wrote:
> On Sun, Jan 11, 2015 at 7:23 AM, Isaac Dunham <ibid.ag at gmail.com> wrote:
> > filename2modname needs to do dir-stripping,
> 
> Well, it was doing that.
> 
> Which lead to "modprobe dir/dir/dir/file"
> work as if it was "modprobe file", and bug reports
> from users.


> So it was removed. Simply reinstating it would make
> _that_ bug to reappear.
> 
> Looks like we need dir-stripping somewhere else,
> in a less generic code path.
No, I participated the thread on alpine-devel where the bug was found,
and have tested.

The bug was that (for example)
modprobe dmi:1:svnMICRO_STARINTERNATIONAL1:pnU90/U100:1
died with 
modprobe: malformed module name 'dmi:1:svnMICRO_STARINTERNATIONAL1:pnU90/U100:1'
thanks to a little bit of code that checked whether a '/' was present
(before looking up the alias).
It did not get converted to 'U100:1'

This becomes a real problem when 
modprobe -a <list of modaliases>
is used in the init scripts, as no modules will be loaded.

Additionally, if you check for filename2modname(), it is used many times
in full modutils but only once in modprobe-small.c in the 
if (is_rmmod) block.
filename2modname() is only generic in modprobe.c, not modprobe-small.c--
and this bug only affects modprobe-small.

Thanks,
Isaac Dunham



More information about the busybox mailing list