aboutsummaryrefslogtreecommitdiff
path: root/lib/libdevstat
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2026-09-28 14:44:04 +0000
committerMark Johnston <markj@FreeBSD.org>2026-09-29 15:56:01 +0000
commit46c9357418134ebcdb025dbcfdedff8adebb679a (patch)
tree9323a91d8d30e3466f2e6a3756695727443e0e8c /lib/libdevstat
parent4536e595eada166687db8f911ff142e36b02205c (diff)
fdescfs: Pass up additional metadata during lookups
When an fdescfs mount has the nodup option set, fdesc_lookup(/dev/fd/n) returns the vnode referenced by file descriptor n, rather than returning an fdescfs vnode. This meant that fd metadata attached to fd n was not preserved when reopening the file, which is contrary to the expected semantics for capsicum rights and the UF_RESOLVE_BENEATH fd flag. For regular fdescfs mounts, this metadata is copied via dupfdopen(). Fix the problem by passing up this metadata through the nameidata structure. Thus, if one opens /dev/fd/n, the returned fd will inherit UF_RESOLVE_BENEATH and the capability rights of fd n. Add some regression tests as well. Approved by: so Security: FreeBSD-SA-26:66.jail Security: CVE-2026-101304 Reported by: Jan Bramkamp Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D59886
Diffstat (limited to 'lib/libdevstat')
0 files changed, 0 insertions, 0 deletions