aboutsummaryrefslogtreecommitdiff
path: root/lib/libsys/aarch64
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2026-10-30 16:02:34 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2026-10-30 19:07:39 +0000
commit99a58803f9a306253df36c82f11991bc1e36e5a5 (patch)
tree1214069bb21af1dd948e963a8e1b74bfdcb94e65 /lib/libsys/aarch64
parenteb0f28db1bfa5b4e6b0eda0a3dc25820bff1acba (diff)
fdcopy(): properly update fd_freefile when skipping non-copyable fdHEADmain
fd_freefile is maintained to fulfill the POSIX guarantee that the lowest possible file descriptor is allocated on open. If we skip copying an fd, it is a possible candidate for the lowest index. First, the file descriptor installed with a kqueue created without KQUEUE_CPONFORK missed this handling [*]. Second, fd_freefile should be updated only when the current fd index is below it. A skipped fd above fd_freefile could raise it past a free slot. PR: 300234 [*] Reported by: Andrea Venturoli <freebsd@netfence.it> Reviewed by: markj Fixes: 1265516c5c61 ("struct file: add DFLAG_FORK, indicate copying on fork") Fixes: 809f3121be66 ("fd: assign fd_freefile early when copying") MFC after: 1 week Differential revision: https://reviews.freebsd.org/D61054
Diffstat (limited to 'lib/libsys/aarch64')
0 files changed, 0 insertions, 0 deletions