Bug 2027627 - systemd-udevd syscall filtering blocks access to bpf() syscall
Summary: systemd-udevd syscall filtering blocks access to bpf() syscall
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: 35
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: systemd-maint
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-11-30 10:05 UTC by Maciek Borzecki
Modified: 2022-01-15 01:21 UTC (History)
11 users (show)

Fixed In Version: systemd-250~rc3-1.fc36 systemd-249.9-1.fc35
Clone Of:
Environment:
Last Closed: 2022-01-15 01:21:17 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 2025264 1 unspecified CLOSED /usr/libexec/snapd/snap-device-helper always fail 2023-07-24 07:34:45 UTC

Description Maciek Borzecki 2021-11-30 10:05:13 UTC
Description of problem:

Snapd uses a helper program /usr/libexec/snapd/snap-device-helper to update device access rules for a running snap application. This is done by updating entries in a bpf map under /sys/fs/bpf/snap/<snap-cookie>. Snapd sets up udev rules to invoke the helper whenever a matching device is added/changed. However, since systemd-udevd syscall filtering is limited to @system-service @module @raw-io, bpf() gets blocked with EPERM like so:

3309  bpf(BPF_OBJ_GET, {pathname="/sys/fs/bpf/snap/snap_ghostscript-printer-app_ghostscript-printer-app-server", bpf_fd=0, file_flags=0}, 128 <unfinished ...>
...
3309  <... bpf resumed>)                = -1 EPERM (Operation not permitted)

The program was also seen on Fedora 35 where fixes for #2025264 were pushed to testing but the problem was still not resolved

Version-Release number of selected component (if applicable):
systemd-249.7-2.fc35.x86_64
systemd-libs-249.7-2.fc35.x86_64
systemd-networkd-249.7-2.fc35.x86_64
systemd-oomd-defaults-249.7-2.fc35.noarch
systemd-pam-249.7-2.fc35.x86_64
systemd-resolved-249.7-2.fc35.x86_64
systemd-udev-249.7-2.fc35.x86_64


How reproducible:
always

Actual results:
bpf() getting blocke

Comment 1 Maciek Borzecki 2021-11-30 10:17:34 UTC
Proposed an upstream fix: https://github.com/systemd/systemd/pull/21576

Comment 2 Fedora Update System 2022-01-11 21:42:51 UTC
FEDORA-2022-f38f479b8f has been submitted as an update to Fedora 35. https://bodhi.fedoraproject.org/updates/FEDORA-2022-f38f479b8f

Comment 3 Fedora Update System 2022-01-12 01:49:32 UTC
FEDORA-2022-f38f479b8f has been pushed to the Fedora 35 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2022-f38f479b8f`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-f38f479b8f

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 4 Fedora Update System 2022-01-12 22:17:38 UTC
FEDORA-2022-f38f479b8f has been submitted as an update to Fedora 35. https://bodhi.fedoraproject.org/updates/FEDORA-2022-f38f479b8f

Comment 5 Fedora Update System 2022-01-13 01:10:41 UTC
FEDORA-2022-f38f479b8f has been pushed to the Fedora 35 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2022-f38f479b8f`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-f38f479b8f

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 6 Fedora Update System 2022-01-15 01:21:17 UTC
FEDORA-2022-f38f479b8f has been pushed to the Fedora 35 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.