Skip to contentSkip to conversation

udev: allow udevadmin to extend socket recv buffer

PATCH Chris PeBenito 2 participants 2 messages Aug 7, 2025 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 21 lines · Virendra Thakur

Upstream systemd commit [eba449fa81f6] (PR #29872) modifies udevadm-trigger and sd-device-monitor to unconditionally increase the receive buffer size on netlink sockets. This helps avoid failures under high event loads,

References:
- https://github.com/systemd/systemd/pull/29872

To support this in SELinux, Allow udevadm to use CAP_NET_ADMIN to extend the socket receive buffer to hold more events.

---
  policy/modules/system/udev.te | 1 +
  1 file changed, 1 insertion(+)
policy/modules/system/udev.te +0 -0
index e245a66a4..911121771 100644

policy/modules/system/udev.te optional_policy(` · line 411

Quoted 6 lines
policy/modules/system/udev.te +1 -0
@@ -406,6 +406,7 @@ optional_policy(`
  allow udevadm_t self:capability dac_read_search;
  allow udevadm_t self:netlink_kobject_uevent_socket create_socket_perms;
  allow udevadm_t self:unix_stream_socket create_socket_perms;
+allow udevadm_t self:capability { net_admin };
 
  stream_connect_pattern(udevadm_t, udev_runtime_t, udev_runtime_t, udev_t)

Please put the permission on the same line as the existing dac_read_search capability.

Signature · 1 line
Chris PeBenito
#2 lore raw
Quoted 29 lines · On Thursday, 7 August 2025 23:57:34 AEST Chris PeBenito wrote:
Quoted 28 lines · Virendra Thakur

Upstream systemd commit [eba449fa81f6] (PR #29872) modifies udevadm-trigger
and sd-device-monitor to unconditionally increase the receive buffer size on netlink sockets. This helps avoid failures under high event loads,

References:
- https://github.com/systemd/systemd/pull/29872

To support this in SELinux, Allow udevadm to use CAP_NET_ADMIN to extend the socket receive buffer to hold more events.

---

  policy/modules/system/udev.te | 1 +
  1 file changed, 1 insertion(+)
policy/modules/system/udev.te +0 -0
index e245a66a4..911121771 100644
@@ -406,6 +406,7 @@ optional_policy(`
 
  allow udevadm_t self:capability dac_read_search;
  allow udevadm_t self:netlink_kobject_uevent_socket create_socket_perms;
  allow udevadm_t self:unix_stream_socket create_socket_perms;
 
Quoted 7 lines
Quoted 4 lines
policy/modules/system/udev.te +1 -0
+allow udevadm_t self:capability { net_admin };
 

stream_connect_pattern(udevadm_t, udev_runtime_t, udev_runtime_t, udev_t)

Please put the permission on the same line as the existing dac_read_search capability.

Please put a comment in the te file about this to make it clear it's not just another of the systemd daemons needlessly changing buffer sizes.

Signature · 2 lines
My Main Blog         http://etbe.coker.com.au/
My Documents Blog    http://doc.coker.com.au/