Files
freebsd/sys/fs
Mark Johnston 8e6bc7b3e9 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
2026-09-28 18:17:20 +00:00
..
2025-11-14 15:43:38 +01:00
2025-08-28 21:14:23 +03:00
2025-08-12 12:49:42 +00:00
2025-11-19 11:57:40 +01:00
2025-08-28 21:14:23 +03:00