TCP/IP connection stuck when called from UDEV rule

Bug #1839156 reported by Paskin
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
systemd (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

It seems that in Eoan there is a lock/any other issue preventing particular system calls to be executed by the triggered action handler. I have an action executing wget when USB-serial adapter is plugged:

SUBSYSTEM=="tty", ACTION=="add", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7523", MODE="0666", RUN+="/usr/bin/wget -v --method=POST http://127.0.0.1:4000/udev_trigger/add"
This action works perfectly in a prior versions - but in Eoan Ermine it hangs for ~30s and fails on a timeout. Analysis with strace shows that execution is stuck on connect() syscall - until it returns with ETIMEDOUT.

Same Wget command, being run from a command line, works perfectly.

The issue doesn't seem to be related to a particular IP (localhost/remote) and/or the status of a listener process - execution hangs also when listener is not running and port is free.

Revision history for this message
Paskin (khalatov) wrote :
affects: udev (Ubuntu) → systemd (Ubuntu)
Revision history for this message
Nick Rosbrook (enr0n) wrote :

udev restricts this sort of thing for security reasons, so this is working as expected.

Changed in systemd (Ubuntu):
status: New → Invalid
Revision history for this message
Paskin (khalatov) wrote :

Could you refer to some documentation on this restriction (especially - what actions are allowed/restricted)?

In addition - what was the reason of DROP behaviour? All known to me system restrictions behave as REJECT - i.e. restricted action gets an immediate result instead on being stuck until the timeout expires...

Revision history for this message
Nick Rosbrook (enr0n) wrote :

From the udev man page:

"Note that running programs that access the network or mount/unmount filesystems is not allowed inside of udev rules, due to the default sandbox that is enforced on systemd-udevd.service."

I have not tested or looked into the specifics of the implementation to be able to answer your second question.

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.