Skip to content

Commit cc741d0

Browse files
committed
merge #76 into cyphar/filepath-securejoin:main
Aleksa Sarai (1): openat2: increase retry count to 128 LGTMs: cyphar
2 parents b840126 + 28c6340 commit cc741d0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pathrs-lite/internal/fd/openat2_linux.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ func scopedLookupShouldRetry(how *unix.OpenHow, err error) bool {
3232
(errors.Is(err, unix.EAGAIN) || errors.Is(err, unix.EXDEV))
3333
}
3434

35-
const scopedLookupMaxRetries = 32
35+
// This is a fairly arbitrary limit we have just to avoid an attacker being
36+
// able to make us spin in an infinite retry loop -- callers can choose to
37+
// retry on EAGAIN if they prefer.
38+
const scopedLookupMaxRetries = 128
3639

3740
// Openat2 is an [Fd]-based wrapper around unix.Openat2, but with some retry
3841
// logic in case of EAGAIN errors.

0 commit comments

Comments
 (0)