Skip to content

Commit 9e55458

Browse files
committed
memfd-bind: fixup systemd unit file and README
The example of starting memfd-bind via systemd in README did not work for me (Fedora 40, systemd 255): # systemctl status memfd-bind@/usr/bin/runc Invalid unit name "memfd-bind@/usr/bin/runc" escaped as "memfd-bind@-usr-bin-runc" (maybe you should use systemd-escape?). ○ [email protected] Loaded: bad-setting (Reason: Unit [email protected] has a bad unit file setting.) Active: inactive (dead) Docs: https://github.com/opencontainers/runc So, let's use systemd-escape -p ("path") in the README example, and use %f in the systemd unit file to prepend the slash to the filename. Signed-off-by: Kir Kolyshkin <[email protected]>
1 parent f2d5624 commit 9e55458

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

contrib/cmd/memfd-bind/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ The provided `[email protected]` file can be used to get systemd to manage
2525
this daemon. You can supply the path like so:
2626

2727
```
28-
% systemctl start memfd-bind@/usr/bin/runc
28+
% systemctl start memfd-bind@$(systemd-escape -p /usr/bin/runc)
2929
```
3030

3131
Thus, there are three ways of protecting against CVE-2019-5736, in order of how
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[Unit]
2-
Description=Manage memfd-bind of %I
2+
Description=Manage memfd-bind of %f
33
Documentation=https://github.com/opencontainers/runc
44

55
[Service]
66
Type=simple
7-
ExecStart=memfd-bind "%I"
8-
ExecStop=memfd-bind --cleanup "%I"
7+
ExecStart=memfd-bind "%f"
8+
ExecStop=memfd-bind --cleanup "%f"
99

1010
[Install]
1111
WantedBy=multi-user.target

0 commit comments

Comments
 (0)