[Bug 627] New: modprobe-small: incorrect alias-based probe with dep_bb_fd < 0

bugzilla at busybox.net bugzilla at busybox.net
Fri Sep 25 22:43:23 UTC 2009


https://bugs.busybox.net/show_bug.cgi?id=627

           Summary: modprobe-small: incorrect alias-based probe with
                    dep_bb_fd < 0
           Product: Busybox
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P3
         Component: Other
        AssignedTo: unassigned at busybox.net
        ReportedBy: jirij.jabb at gmail.com
                CC: busybox-cvs at busybox.net
   Estimated Hours: 0.0


Hello,
I've built a small linux-based distribution where I mount /lib/modules as a
squashfs read-only filesystem and I've finally tracked down the issue of
loading ata_generic instead of ata_piix both in QEMU and on a real machine.
It's because the modprobe can't open /lib/modules/* for write, resulting in
dep_bb_fd == -1 (and thus < 0), which apparently isn't a fatal case for
find_alias() as it's author was aware of such case:

                if (result && dep_bb_fd < 0)
                        return result;

This indeed returns the result as soon as possible, because further searching
and parsing wouldn't make sense when we can't write the modules.dep.bb file.
In the other case, however, the loop finishes, find_alias() writes a new
modules.dep.bb file and returns LAST result found.

Two or more modules with the same alias shouldn't even exist (correct me if I'm
wrong), so this shouldn't be an issue. Unfortunatelly, it is.

I did a grep on several parts of the alias and only ata_piix.ko matches.

I'm able to attach - on a request - a three gzipped logs of "modprobe
pci:v00008086d00007010sv00000000sd00000000bc01sc01i80" with empty /proc/modules
and nonexisting modules.dep.bb on a:
- read-only filesystem (which loads incorrectly ata_generic)
- read-write filesystem (which loads correctly ata_piix)
- read-only filesystem with deleted ata_generic (loads ata_piix)


A snippet of the first case:
--------------------------------------------------
modprobe: alias:'pci:v00008086d00002653sv*sd*bc*sc*i*'
modprobe: alias:'pci:v00008086d00002652sv*sd*bc*sc*i*'
modprobe: grow stringbuf to 4553
modprobe: dep:'libata'
modprobe: parse_module('kernel/drivers/ata/ata_generic.ko')
modprobe: alias:'pci:v*d*sv*sd*bc01sc01i*'
modprobe: alias:'pci:v00001179d00000105sv*sd*bc*sc*i*'
modprobe: alias:'pci:v00001179d00000103sv*sd*bc*sc*i*'
modprobe: alias:'pci:v00001179d00000102sv*sd*bc*sc*i*'
modprobe: alias:'pci:v000016CAd00000001sv*sd*bc*sc*i*'
modprobe: alias:'pci:v00001045d0000C558sv*sd*bc*sc*i*'
modprobe: alias:'pci:v00001106d00000561sv*sd*bc*sc*i*'
modprobe: alias:'pci:v00003388d00008013sv*sd*bc*sc*i*'
modprobe: alias:'pci:v00001060d0000673Asv*sd*bc*sc*i*'
modprobe: alias:'pci:v00001060d0000886Asv*sd*bc*sc*i*'
modprobe: alias:'pci:v00001060d00000101sv*sd*bc*sc*i*'
modprobe: alias:'pci:v00009412d00006565sv*sd*bc*sc*i*'
modprobe: alias:'pci:v00001042d00003020sv*sd*bc*sc*i*'
modprobe: dep:'libata'
modprobe: found alias 'pci:v00008086d00007010sv00000000sd00000000bc01sc01i80'
in module 'kernel/drivers/ata/ata_generic.ko'
modprobe: recurse on dep 'libata'
modprobe: process_module('libata','(null)')
modprobe: already_loaded:0 is_rmmod:0
modprobe: process_module('libata'): options:'(null)'
modprobe: find_alias('libata')
modprobe: found 'libata' in module 'kernel/drivers/ata/libata.ko'
modprobe: parse_module('kernel/drivers/ata/libata.ko')
modprobe: alias:'symbol:ata_cable_sata'
modprobe: alias:'symbol:ata_cable_ignore'
modprobe: alias:'symbol:ata_cable_unknown'
--------------------------------------------------

and the second case:
--------------------------------------------------
modprobe: alias:'pci:v00008086d00007111sv*sd*bc*sc*i*'
modprobe: alias:'pci:v00008086d00007111sv000015ADsd00001976bc*sc*i*'
modprobe: alias:'pci:v00008086d00007010sv*sd*bc*sc*i*'
modprobe: dep:'libata'
modprobe: found alias 'pci:v00008086d00007010sv00000000sd00000000bc01sc01i80'
in module 'kernel/drivers/ata/ata_piix.ko'
modprobe: parse_module('kernel/drivers/ata/ata_generic.ko')
modprobe: alias:'pci:v*d*sv*sd*bc01sc01i*'
modprobe: alias:'pci:v00001179d00000105sv*sd*bc*sc*i*'
modprobe: alias:'pci:v00001179d00000103sv*sd*bc*sc*i*'
modprobe: alias:'pci:v00001179d00000102sv*sd*bc*sc*i*'
modprobe: alias:'pci:v000016CAd00000001sv*sd*bc*sc*i*'
modprobe: alias:'pci:v00001045d0000C558sv*sd*bc*sc*i*'
modprobe: alias:'pci:v00001106d00000561sv*sd*bc*sc*i*'
modprobe: alias:'pci:v00003388d00008013sv*sd*bc*sc*i*'
modprobe: alias:'pci:v00001060d0000673Asv*sd*bc*sc*i*'
modprobe: alias:'pci:v00001060d0000886Asv*sd*bc*sc*i*'
modprobe: alias:'pci:v00001060d00000101sv*sd*bc*sc*i*'
modprobe: alias:'pci:v00009412d00006565sv*sd*bc*sc*i*'
modprobe: alias:'pci:v00001042d00003020sv*sd*bc*sc*i*'
modprobe: dep:'libata'
modprobe: parse_module('kernel/drivers/ata/ahci.ko')
modprobe: alias:'pci:v*d*sv*sd*bc01sc06i01*'
modprobe: alias:'pci:v0000105Ad00003F20sv*sd*bc*sc*i*'
modprobe: alias:'pci:v000011ABd00006121sv*sd*bc*sc*i*'
--------------------------------------------------


I have to admit, I haven't found the real (code) reason for this bug, it might
be a counter mismatch (off-set by one) or something similar.


target: i486-linux-uclibc-gcc
git: 2009-09-25 (4ea0ca8)

Thanks.


-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the busybox-cvs mailing list