systemd CapabilityBoundingSet blocks open(...O_NOATIME...) #1334

Closed
opened 2026-07-13 22:46:01 +00:00 by ramcq · 1 comment

What I'm trying to do and why

I noticed in strace that the openat syscalls made by borg were being duplicated, once with O_NOATIME and again without:

openat(11, "1768975546.M682270P2944579.78c139317d69,S=69013,W=70052:2,", O_RDONLY|O_NOCTTY|O_NONBLOCK|O_NOFOLLOW|O_NOATIME|O_CLOEXEC) = -1 EPERM (Operation not permitted)
openat(11, "1768975546.M682270P2944579.78c139317d69,S=69013,W=70052:2,", O_RDONLY|O_NOCTTY|O_NONBLOCK|O_NOFOLLOW|O_CLOEXEC) = 12
newfstatat(11, "1768975959.M797943P2944579.78c139317d69,S=52833,W=53553:2,", {st_mode=S_IFREG|0600, st_size=19280, ...}, AT_SYMLINK_NOFOLLOW) = 0
openat(11, "1768975959.M797943P2944579.78c139317d69,S=52833,W=53553:2,", O_RDONLY|O_NOCTTY|O_NONBLOCK|O_NOFOLLOW|O_NOATIME|O_CLOEXEC) = -1 EPERM (Operation not permitted)
openat(11, "1768975959.M797943P2944579.78c139317d69,S=52833,W=53553:2,", O_RDONLY|O_NOCTTY|O_NONBLOCK|O_NOFOLLOW|O_CLOEXEC) = 12
newfstatat(11, "1768979423.M181803P2946730.78c139317d69,S=117511,W=119866:2,", {st_mode=S_IFREG|0600, st_size=40495, ...}, AT_SYMLINK_NOFOLLOW) = 0

Steps to reproduce

use unmodified borgmatic.service

Actual behavior

CapabilityBoundingSet=CAP_DAC_READ_SEARCH CAP_NET_RAW

Expected behavior

change to CapabilityBoundingSet=CAP_DAC_READ_SEARCH CAP_FOWNER CAP_NET_RAW

Other notes / implementation ideas

CAP_FOWNER is documented to allow specify O_NOATIME for arbitrary files in open(2) and fcntl(2).

borgmatic version

1.9.14

borgmatic installation method

Debian package

Borg version

1.4.0

Python version

3.13.5

Database version (if applicable)

No response

Operating system and version

Debian GNU/Linux 13 (trixie)

### What I'm trying to do and why I noticed in strace that the openat syscalls made by borg were being duplicated, once with O_NOATIME and again without: ``` openat(11, "1768975546.M682270P2944579.78c139317d69,S=69013,W=70052:2,", O_RDONLY|O_NOCTTY|O_NONBLOCK|O_NOFOLLOW|O_NOATIME|O_CLOEXEC) = -1 EPERM (Operation not permitted) openat(11, "1768975546.M682270P2944579.78c139317d69,S=69013,W=70052:2,", O_RDONLY|O_NOCTTY|O_NONBLOCK|O_NOFOLLOW|O_CLOEXEC) = 12 newfstatat(11, "1768975959.M797943P2944579.78c139317d69,S=52833,W=53553:2,", {st_mode=S_IFREG|0600, st_size=19280, ...}, AT_SYMLINK_NOFOLLOW) = 0 openat(11, "1768975959.M797943P2944579.78c139317d69,S=52833,W=53553:2,", O_RDONLY|O_NOCTTY|O_NONBLOCK|O_NOFOLLOW|O_NOATIME|O_CLOEXEC) = -1 EPERM (Operation not permitted) openat(11, "1768975959.M797943P2944579.78c139317d69,S=52833,W=53553:2,", O_RDONLY|O_NOCTTY|O_NONBLOCK|O_NOFOLLOW|O_CLOEXEC) = 12 newfstatat(11, "1768979423.M181803P2946730.78c139317d69,S=117511,W=119866:2,", {st_mode=S_IFREG|0600, st_size=40495, ...}, AT_SYMLINK_NOFOLLOW) = 0 ``` ### Steps to reproduce use unmodified borgmatic.service ### Actual behavior https://projects.torsion.org/borgmatic-collective/borgmatic/src/commit/07d5a0129caa38c4999ce8e5b24f14998bfbcb27/sample/systemd/borgmatic.service#L63 ### Expected behavior change to `CapabilityBoundingSet=CAP_DAC_READ_SEARCH CAP_FOWNER CAP_NET_RAW` ### Other notes / implementation ideas `CAP_FOWNER` is documented to allow `specify O_NOATIME for arbitrary files in open(2) and fcntl(2)`. ### borgmatic version 1.9.14 ### borgmatic installation method Debian package ### Borg version 1.4.0 ### Python version 3.13.5 ### Database version (if applicable) _No response_ ### Operating system and version Debian GNU/Linux 13 (trixie)
Owner

Thanks for filing this! Fixed in main.

Thanks for filing this! Fixed in main.
Sign in to join this conversation.
No milestone
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
borgmatic-collective/borgmatic#1334
No description provided.