Bug #1948812 “Bad busybox modinfo output on exactly 3 modules” : Bugs : Ubuntu

Trying on Ubuntu 20.04.3 with linux-modules-5.4.0-88-generic and busybox

    for a in $(find /lib/modules/5.4.0-88-generic/ -name ‘*.ko’)
    do
       [ $(busybox modinfo -F name $a|wc -w) = 1 ] || echo $a
    done

This code should output nothing because every module reports just a name. Instead it outputs exactly three lines:

    /lib/modules/5.4.0-88-generic/kernel/net/ceph/libceph.ko
    /lib/modules/5.4.0-88-generic/kernel/fs/nfs/nfs.ko
    /lib/modules/5.4.0-88-generic/kernel/zfs/zfs.ko

Let’s try them

     $ busybox modinfo -F name /lib/modules/5.4.0-88-generic/kernel/fs/nfs/nfsv4.ko
     nfsv4
This is correct, I put it just for the reference.

     $ busybox modinfo -F name /lib/modules/5.4.0-88-generic/kernel/net/ceph/libceph.ko

     %s
     libceph
The above incorrectly reports one empty line, one literal %s and the name of the module

     $ busybox modinfo -F name /lib/modules/5.4.0-88-generic/kernel/fs/nfs/nfs.ko
     %02x:%02x:%llu/%s

     nfs
This reports a strange format and empty line and then nfs

     $ busybox modinfo -F name /lib/modules/5.4.0-88-generic/kernel/zfs/zfs.ko
     %s
     %s creation_txg=%llu target_snap=%llu
     zfs
Yet another strange format

No other module, except those 3, misbehaved when tried to get a name from busybox modinfo

Just for your information I used the busybox from the package busybox version 1:1.30.1-4ubuntu6.3 amd64 but the very same result was generated by the latest compiled busybox

Read more here: Source link