Custom properties set with ENV{WHATEVER} in parent no longer imported with IMPORT{parent} in udev rule

Bug #1916418 reported by Jonathan Kamens on 2021-02-22
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
systemd (Ubuntu)
Undecided
Unassigned
Focal
Undecided
Unassigned
Groovy
Undecided
Unassigned

Bug Description

DisplayLink uses these udev rules to start the displaylink service when a displaylink device is plugged in:

ACTION=="add", SUBSYSTEM=="usb", DRIVERS=="usb", ATTR{idVendor}=="17e9", IMPORT{builtin}="usb_id", ENV{DISPLAYLINK_DEVNAME}="$env{DEVNAME}", ENV{DISPLAYLINK_DEVICE_ID}="$env{ID_BUS}-$env{BUSNUM}-$env{DEVNUM}-$env{ID_SERIAL}", ENV{REMOVE_CMD}="/opt/displaylink/udev.sh $root $env{DISPLAYLINK_DEVICE_ID} $env{DISPLAYLINK_DEVNAME}"

ACTION=="add", SUBSYSTEM=="usb", DRIVERS=="usb", ATTRS{idVendor}=="17e9", ATTR{bInterfaceClass}=="ff", ATTR{bInterfaceProtocol}=="03", IMPORT{parent}="DISPLAYLINK*", RUN+="/opt/displaylink/udev.sh $root $env{DISPLAYLINK_DEVICE_ID} $env{DISPLAYLINK_DEVNAME}"

The important thing to note here is that the first rule is for the device that is the parent of the device triggers the second rule, and the first rule sets ENV{DISPLAYLINK_DEVNAME} and ENV{DISPLAYLINK_DEVICE_ID}, and the second rule attempts to import them with IMPORT{parent} and then use them.

This worked fine in 20.04.

It does not work in 21.04.

When the second rule is triggered, DISPLAYLINK_DEVICE_ID and DISPLAYLINK_DEVNAME are not set.

I have confirmed via udevadm monitor that the variables are getting set on the parent.

I have confirmed via udevadm info --attribute-walk that the device triggering the second rule is the child of the device triggering the first one.

I have tried to import the variables explicitly instead of using a glob pattern and that doesn't work either.

When I modify the rule to import DEVNAME, ID_BUS, BUSNUM, DEVNUM, and ID_SERIAL directly, that works. The problem appears to be that these custom properties we are setting in the parent can't be imported in the child.

ProblemType: Bug
DistroRelease: Ubuntu 21.04
Package: udev 247.3-1ubuntu2
ProcVersionSignature: Ubuntu 5.10.0-14.15-generic 5.10.11
Uname: Linux 5.10.0-14-generic x86_64
NonfreeKernelModules: nvidia_modeset nvidia
ApportVersion: 2.20.11-0ubuntu59
Architecture: amd64
CasperMD5CheckResult: unknown
CurrentDesktop: ubuntu:GNOME
CustomUdevRuleFiles: 60-brother-libsane-type1.rules 99-displaylink.rules~ 70-snap.core.rules 70-snap.snap-store.rules 99-x10.rules 60-brother-brscan4-libsane-type1.rules 50-yubikey.rules 70-snap.canonical-livepatch.rules 70-snap.gnome-system-monitor.rules 70-snap.chromium.rules 99-displaylink.rules
Date: Sun Feb 21 19:21:20 2021
InstallationDate: Installed on 2019-01-02 (781 days ago)
InstallationMedia: Ubuntu 18.10 "Cosmic Cuttlefish" - Release amd64 (20181017.3)
MachineType: Acer Predator G6-710
ProcKernelCmdLine: BOOT_IMAGE=/vmlinuz-5.10.0-14-generic root=/dev/mapper/ubuntu--vg-root ro quiet splash vt.handoff=7
SourcePackage: systemd
UpgradeStatus: Upgraded to hirsute on 2021-02-21 (0 days ago)
dmi.bios.date: 05/18/2016
dmi.bios.release: 5.11
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: R01-A4
dmi.board.name: Predator G6-710
dmi.board.vendor: Acer
dmi.chassis.type: 3
dmi.chassis.vendor: Acer
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvrR01-A4:bd05/18/2016:br5.11:svnAcer:pnPredatorG6-710:pvr:rvnAcer:rnPredatorG6-710:rvr:cvnAcer:ct3:cvr:
dmi.product.family: Acer Desktop
dmi.product.name: Predator G6-710
dmi.sys.vendor: Acer

Revision history for this message
Jonathan Kamens (jik) wrote :
tags: added: rls-hh-incoming
tags: added: fr-1173
tags: removed: rls-hh-incoming
Changed in systemd (Ubuntu Focal):
status: New → Invalid
Changed in systemd (Ubuntu):
milestone: none → hirsute-updates
Revision history for this message
Dan Streetman (ddstreet) wrote :

can you reproduce with debug enabled for udevd and attach the logs

Changed in systemd (Ubuntu Groovy):
status: New → Incomplete
Changed in systemd (Ubuntu):
status: New → Incomplete
Revision history for this message
Jonathan Kamens (jik) wrote :

Please tell me specifically how to enable debug and afterward capture the logs that you want to see.

Revision history for this message
Dan Streetman (ddstreet) wrote :

run this command:

$ systemctl edit systemd-udevd

that will open an editor, add this text to the file:

[Service]
Environment=SYSTEMD_LOG_LEVEL=debug

then save the file, and reboot or restart udevd. then reproduce the problem, and check the output of:

$ journalctl -b -u systemd-udevd

Revision history for this message
Jonathan Kamens (jik) wrote :

This appears to no longer be an issue with the current versions of systemd and udev in 21.04.

Changed in systemd (Ubuntu):
status: Incomplete → Fix Released
Changed in systemd (Ubuntu Groovy):
status: Incomplete → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers