Bug 2149625

Summary: usbguard tries to access non-existent device path
Product: Red Hat Enterprise Linux 9 Reporter: Dalibor Pospíšil <dapospis>
Component: usbguardAssignee: Attila Lakatos <alakatos>
Status: CLOSED MIGRATED QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 9.1CC: dapospis
Target Milestone: rcKeywords: MigratedToJIRA, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-08-03 12:48:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Dalibor Pospíšil 2022-11-30 12:42:00 UTC
Description of problem:
Usbguard tries to access non-existent device path during the system boot.

Version-Release number of selected component (if applicable):
usbguard-1.0.0-12.el9.x86_64
usbguard-1.0.0-8.el8_7.2.x86_64

How reproducible:
100% at least in the libvirt VM

Steps to Reproduce:
1. systemctl enable usbguard
2. reboot
3. journalctl -u usbguard

Actual results:
Nov 30 13:17:03 sopos-rhel9-brq systemd[1]: Starting USBGuard daemon...
Nov 30 13:17:04 sopos-rhel9-brq systemd[1]: Started USBGuard daemon.
Nov 30 13:17:04 sopos-rhel9-brq usbguard-daemon[745]: uid=0 pid=740 result='SUCCESS' device.rule='allow id 1d6b:0002 serial "0000:02:00.0" name "xHCI Host Controller" hash "4+i1fOQzh6/Cdbdfiwr>
Nov 30 13:17:04 sopos-rhel9-brq usbguard-daemon[745]: uid=0 pid=740 result='SUCCESS' device.system_name='/devices/pci0000:00/0000:00:02.1/0000:02:00.0/usb1' target.new='allow' device.rule='all>
Nov 30 13:17:04 sopos-rhel9-brq usbguard-daemon[745]: uid=0 pid=740 result='SUCCESS' device.rule='allow id 1d6b:0003 serial "0000:02:00.0" name "xHCI Host Controller" hash "kMlilF7kSjfNYbDD2q8>
Nov 30 13:17:04 sopos-rhel9-brq usbguard-daemon[745]: uid=0 pid=740 result='SUCCESS' device.system_name='/devices/pci0000:00/0000:00:02.1/0000:02:00.0/usb2' target.new='allow' device.rule='all>
Nov 30 13:17:04 sopos-rhel9-brq usbguard-daemon[745]: uid=0 pid=740 result='SUCCESS' device.rule='allow id 0627:0001 serial "28754-0000:00:02.1:00.0-1" name "QEMU USB Tablet" hash "9f6ZIqpK5OG>
Nov 30 13:17:04 sopos-rhel9-brq usbguard-daemon[745]: uid=0 pid=740 result='SUCCESS' device.system_name='/devices/pci0000:00/0000:00:02.1/0000:02:00.0/usb1/1-1' target.new='block' device.rule=>
Nov 30 13:17:04 sopos-rhel9-brq usbguard-daemon[745]: Cannot resolve realpath for /sys/bus/usb/devices/../../../devices/pci0000:00/0000:00:02.1/0000:02:00.0/usb1/1-1/1-1:1.0
Nov 30 13:17:04 sopos-rhel9-brq usbguard-daemon[745]: Ignoring unknown UEvent action: sysfs_devpath=/devices/pci0000:00/0000:00:02.1/0000:02:00.0/usb1/1-1 action=change

Expected results:
no attempt to access non-existent path logged

Additional info:
the last path component does not exist
[root@sopos-rhel9-brq ~]# ls -l /sys/devices/pci0000:00/0000:00:02.1/0000:02:00.0/usb1/1-1/
total 0
-rw-r--r--. 1 root root  4096 Nov 30 13:17 authorized
-rw-r--r--. 1 root root  4096 Nov 30 13:27 avoid_reset_quirk
-r--r--r--. 1 root root  4096 Nov 30 13:16 bcdDevice
-rw-r--r--. 1 root root  4096 Nov 30 13:27 bConfigurationValue
-r--r--r--. 1 root root  4096 Nov 30 13:16 bDeviceClass
-r--r--r--. 1 root root  4096 Nov 30 13:27 bDeviceProtocol
-r--r--r--. 1 root root  4096 Nov 30 13:27 bDeviceSubClass
-r--r--r--. 1 root root  4096 Nov 30 13:27 bmAttributes
-r--r--r--. 1 root root  4096 Nov 30 13:27 bMaxPacketSize0
-r--r--r--. 1 root root  4096 Nov 30 13:27 bMaxPower
-r--r--r--. 1 root root  4096 Nov 30 13:27 bNumConfigurations
-r--r--r--. 1 root root  4096 Nov 30 13:27 bNumInterfaces
-r--r--r--. 1 root root  4096 Nov 30 13:27 busnum
-r--r--r--. 1 root root  4096 Nov 30 13:27 configuration
-r--r--r--. 1 root root 65553 Nov 30 13:16 descriptors
-r--r--r--. 1 root root  4096 Nov 30 13:27 dev
-r--r--r--. 1 root root  4096 Nov 30 13:27 devnum
-r--r--r--. 1 root root  4096 Nov 30 13:27 devpath
lrwxrwxrwx. 1 root root     0 Nov 30 13:16 driver -> ../../../../../../bus/usb/drivers/usb
drwxr-xr-x. 3 root root     0 Nov 30 13:25 ep_00
-r--r--r--. 1 root root  4096 Nov 30 13:16 idProduct
-r--r--r--. 1 root root  4096 Nov 30 13:16 idVendor
-r--r--r--. 1 root root  4096 Nov 30 13:27 ltm_capable
-r--r--r--. 1 root root  4096 Nov 30 13:16 manufacturer
-r--r--r--. 1 root root  4096 Nov 30 13:27 maxchild
lrwxrwxrwx. 1 root root     0 Nov 30 13:17 port -> ../1-0:1.0/usb1-port1
drwxr-xr-x. 2 root root     0 Nov 30 13:16 power
-r--r--r--. 1 root root  4096 Nov 30 13:16 product
-r--r--r--. 1 root root  4096 Nov 30 13:27 quirks
-r--r--r--. 1 root root  4096 Nov 30 13:27 removable
--w-------. 1 root root  4096 Nov 30 13:27 remove
-r--r--r--. 1 root root  4096 Nov 30 13:27 rx_lanes
-r--r--r--. 1 root root  4096 Nov 30 13:16 serial
-r--r--r--. 1 root root  4096 Nov 30 13:27 speed
lrwxrwxrwx. 1 root root     0 Nov 30 13:16 subsystem -> ../../../../../../bus/usb
-r--r--r--. 1 root root  4096 Nov 30 13:27 tx_lanes
-rw-r--r--. 1 root root  4096 Nov 30 13:16 uevent
-r--r--r--. 1 root root  4096 Nov 30 13:27 urbnum
-r--r--r--. 1 root root  4096 Nov 30 13:27 version