lshw incorrectly detects frame buffer devices

Bug #2127480 reported by Robert Malz
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
lshw (Ubuntu)
Status tracked in Resolute
Focal
Confirmed
Undecided
Unassigned
Jammy
Confirmed
Undecided
Unassigned
Noble
Confirmed
Undecided
Unassigned
Plucky
Confirmed
Undecided
Unassigned
Questing
Confirmed
Undecided
Unassigned
Resolute
Confirmed
Undecided
Nick Rosbrook

Bug Description

[ Impact ]

 * Executing lshw can provide incorrect output for devices if frame buffer (fb) devices are present in the system.

 * Issue happens when lshw parses fb devices, internally it tries to look for a PCI device which matches a set of requirements (it's looking for iommu address ranges for device based on data from FB device IOCTL). If a device is matched it will append it's metadata to it and later print it.
Problem is in logic used to detect fb devices metadata. As a result the first device on the list with iommu resource can be correlated with fb device.

 * In following example, fb metadata has been added to network adapter.
        *-network:0
             description: Ethernet interface
             product: Ethernet Controller XXV710 for 25GbE SFP28
             vendor: Intel Corporation
             physical id: 0
             bus info: pci@0000:5e:00.0
             logical name: enp94s0f0
             logical name: /dev/fb0
             version: 02
             serial: 50:7c:6f:45:ca:23
             capacity: 25Gbit/s
             width: 64 bits
             clock: 33MHz
             capabilities: pm msi msix pciexpress vpd bus_master cap_list rom ethernet physical fibre 25000bt-fd autonegotiation fb
             configuration: autonegotiation=off broadcast=yes depth=32 driver=i40e driverversion=5.15.0-107-generic duplex=full firmware=9.50 0x8000f251 23.0.8 latency=0 link=yes mode=1024x768 multicast=yes slave=yes visual=truecolor xres=1024 yres=768
             resources: iomemory:38c00-38bff iomemory:38c00-38bff irq:36 memory:38c000000000-38c000ffffff memory:38c002800000-38c002807fff memory:b8800000-b887ffff memory:38c002000000-38c0023fffff memory:38c002810000-38c00290ffff

 * More discussion on the issue in [0]

[ Test Plan ]

 * FB (/dev/fb0) device is required to reproduce the issue, then run "lshw" and check output of all devices.

In my local local laptop fb data is added to 3D controller device:
           *-display
                description: 3D controller
                product: NVIDIA Corporation
                vendor: NVIDIA Corporation
                physical id: 0
                bus info: pci@0000:01:00.0
                logical name: /dev/fb0
                version: a1
                width: 64 bits
                clock: 33MHz
                capabilities: pm msi pciexpress bus_master cap_list rom fb
                configuration: depth=32 driver=nvidia latency=0 mode=1920x1200 visual=truecolor xres=1920 yres=1200
                resources: iomemory:600-5ff iomemory:620-61f irq:180 memory:be000000-beffffff memory:6000000000-61ffffffff memory:6200000000-6201ffffff ioport:3000(size=128)
        *-display
             description: VGA compatible controller
             product: Intel Corporation
             vendor: Intel Corporation
             physical id: 2
             bus info: pci@0000:00:02.0
             logical name: /dev/fb0
             version: 04
             width: 64 bits
             clock: 33MHz
             capabilities: pciexpress msi pm vga_controller bus_master cap_list rom fb
             configuration: depth=32 driver=i915 latency=0 resolution=1920,1200

With fix:
           *-display
                description: 3D controller
                product: NVIDIA Corporation
                vendor: NVIDIA Corporation
                physical id: 0
                bus info: pci@0000:01:00.0
                version: a1
                width: 64 bits
                clock: 33MHz
                capabilities: pm msi pciexpress bus_master cap_list rom
                configuration: driver=nvidia latency=0
                resources: iomemory:600-5ff iomemory:620-61f irq:180 memory:be000000-beffffff memory:6000000000-61ffffffff memory:6200000000-6201ffffff ioport:3000(size=128)
        *-display
             description: VGA compatible controller
             product: Intel Corporation
             vendor: Intel Corporation
             physical id: 2
             bus info: pci@0000:00:02.0
             logical name: /dev/fb0
             version: 04
             width: 64 bits
             clock: 33MHz
             capabilities: pciexpress msi pm vga_controller bus_master cap_list rom fb
             configuration: depth=32 driver=i915 latency=0 mode=1920x1200 visual=truecolor xres=1920 yres=1200
             resources: iomemory:620-61f iomemory:400-3ff irq:181 memory:6288000000-6288ffffff memory:4000000000-400fffffff ioport:4000(size=64) memory:c0000-dffff memory:4010000000-4016ffffff memory:4020000000-40ffffffff

[ Where problems could occur ]

 * Fix is written in a way that if new way of detecting fb metadata does not work it will fall back to previous method.

 * Worst case scenario is that fb data will not be printed

[ Other Info ]

 * To workaround the problem disable fb detection by adding -disable fb

 * Upstream patches [1]

[0] - https://github.com/lyonel/lshw/pull/106
[1] - https://ezix.org/src/pkg/lshw/commits/branch/master af7c69e1b6 8798c9f1a2

Revision history for this message
Robert Malz (rmalz) wrote :
Revision history for this message
Robert Malz (rmalz) wrote :
Revision history for this message
Robert Malz (rmalz) wrote :
Revision history for this message
Robert Malz (rmalz) wrote :
Revision history for this message
Robert Malz (rmalz) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "focal debdiff" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

tags: added: patch
Revision history for this message
Robert Malz (rmalz) wrote :

resolute debdiff

Revision history for this message
Simon Chopin (schopin) wrote :

Hi,

Thanks for the patches!

Please note that typically we wouldn't upload the fix to Focal, as it is out of standard support.

tags: added: dcr-incoming
John Chittum (jchittum)
Changed in lshw (Ubuntu Resolute):
assignee: nobody → Nick Rosbrook (enr0n)
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in lshw (Ubuntu Focal):
status: New → Confirmed
Changed in lshw (Ubuntu Jammy):
status: New → Confirmed
Changed in lshw (Ubuntu Noble):
status: New → Confirmed
Changed in lshw (Ubuntu Plucky):
status: New → Confirmed
Changed in lshw (Ubuntu Questing):
status: New → Confirmed
Changed in lshw (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.