<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<p><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: InterVariable, Twemoji_DISABLED, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-weight: 420; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration: none; display: inline !important; float: none;">Hi,</span></p>
<p>I'm currently trying to execute systemd-dissect from within a
quite sandboxed service. I've set PrivateDevices = "no" and DeviceAllow
to block-loop and loop-control. However, systemd-dissect still
runs into an error when trying to talk to the loop device: <br>
</p>
<p>ioctl(6, BLKPG, ***op=BLKPG_DEL_PARTITION, flags=0, datalen=152,
data=***start=0, length=0, pno=1, devname="/dev/loop0p1",
volname=""***) = -1 EACCES (Permission denied)</p>
<p>Do you guys have any pointers on which other sandboxing settings
I need to tweak? I've fiddled around with capabilities and syscall
filters (which both shouldn't be a problem), but no luck.</p>
<p>For reference, the (presumably) relevant parts of the service
config:<br>
</p>
<p>SecureBits=0<br>
User=root<br>
DynamicUser=no<br>
SetLoginEnvironment=no<br>
RemoveIPC=yes<br>
PrivateTmp=yes<br>
PrivateDevices=no<br>
ProtectClock=yes<br>
ProtectKernelTunables=yes<br>
ProtectKernelModules=yes<br>
ProtectKernelLogs=yes<br>
ProtectControlGroups=yes<br>
PrivateNetwork=no<br>
PrivateUsers=yes<br>
PrivateMounts=yes<br>
PrivateIPC=no<br>
ProtectHome=yes<br>
ProtectSystem=strict<br>
SameProcessGroup=no<br>
UtmpMode=init<br>
IgnoreSIGPIPE=yes<br>
NoNewPrivileges=yes</p>
<p>MemoryDenyWriteExecute=no<br>
RestrictRealtime=yes<br>
RestrictSUIDSGID=yes<br>
RestrictNamespaces=yes</p>
<p>ProtectProc=invisible<br>
ProcSubset=all<br>
ProtectHostname=yes</p>
<p><br>
</p>
<p>Moritz Sanft<br>
</p>
</body>
</html>