[Bug 256730] linsysfs adds duplicate pathnames

From: <bugzilla-noreply_at_freebsd.org>
Date: Sun, 20 Jun 2021 14:18:31 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=256730

            Bug ID: 256730
           Summary: linsysfs adds duplicate pathnames
           Product: Base System
           Version: 13.0-STABLE
          Hardware: arm64
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: jfc@mit.edu

Created attachment 225948
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=225948&action=edit
dmesg output

On my Ampere arm64 server (but not on a Raspberry Pi 3B) I get a panic trying
to load linsysfs with INVARIANTS defined.  The panic message is
"pfs_add_node(): homonymous siblings".  With a debugging printf instead of a
panic I see linsysfs_run_bus is trying to add several instances of
"0000:00:00.0".

# ls /usr/jail/0/linux/sys/devices/pci0000:00
0000:00:00.0    0000:00:00.0    0000:00:00.0    0000:00:00.0
0000:00:00.0    0000:00:00.0    0000:00:00.0

There might be two bugs here -- bad PCI enumeration code for the Ampere server
and a lack of defensive programming in the linsysfs kernel module.

I see some warnings from PCI code in attached dmesg output which might be
related.

-- 
You are receiving this mail because:
You are the assignee for the bug.