Skip to content

Commit 8e20ab4

Browse files
committed
CHANGELOG: mention openat2 retry loop changes
Signed-off-by: Aleksa Sarai <[email protected]>
1 parent cc741d0 commit 8e20ab4

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,31 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1919
and distributors can then opt-in to using `libpathrs` for the entire binary
2020
if they wish.
2121

22+
### Changed ###
23+
- `openat2` can return `-EAGAIN` if it detects a possible attack in certain
24+
scenarios (namely if there was a rename or mount while walking a path with a
25+
`..` component). While this is necessary to avoid a denial-of-service in the
26+
kernel, it does require retry loops in userspace.
27+
28+
In previous versions, `pathrs-lite` would retry `openat2` 32 times before
29+
returning an error, but we've received user reports that this limit can be
30+
hit on systems with very heavy load. In some synthetic benchmarks (testing
31+
the worst-case of an attacker doing renames in a tight loop on every core of
32+
a 16-core machine) we managed to get a ~3% failure rate in runc. We have
33+
improved this situation in two ways:
34+
35+
* We have now increased this limit to 128, which should be good enough for
36+
most use-cases without becoming a denial-of-service vector (the number of
37+
syscalls called by the `O_PATH` resolver in a typical case is within the
38+
same ballpark). The same benchmarks show a failure rate of ~0.12% which
39+
(while not zero) is probably sufficient for most users.
40+
41+
* In addition, we now return a `unix.EAGAIN` error that is bubbled up and can
42+
be detected by callers. This means that callers with stricter requirements
43+
to avoid spurious errors can choose to do their own infinite `EAGAIN` retry
44+
loop (though we would strongly recommend users use time-based deadlines in
45+
such retry loops to avoid potentially unbounded denials-of-service).
46+
2247
## [0.5.0] - 2025-09-26 ##
2348

2449
> Let the past die. Kill it if you have to.

0 commit comments

Comments
 (0)