opnsense-src/sys/fs
Mark Johnston f601bcf731 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-30 11:46:46 +02:00
..
autofs Reduce reliance on sys/sysproto.h pollution 2024-04-15 21:35:40 +01:00
cd9660 cd9660: Add length checks to Rock Ridge parser 2026-04-07 15:52:08 +00:00
cuse execve_block(): a mechanism for mutual exclusion with execve() on the process 2026-07-06 10:29:25 +02:00
deadfs vn_delayed_setsize(): post-commit review' changes 2026-03-15 08:58:57 +02:00
devfs devfs: unlock the directory vnode around the call to dev_clone handler 2026-02-09 02:51:57 +02:00
ext2fs ext2fs: Use __sdt_used for variables only used by SDT probes 2026-04-24 11:33:29 -04:00
fdescfs fdescfs: Pass up additional metadata during lookups 2026-09-30 11:46:46 +02:00
fifofs sys: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
fuse fusefs: Handle buggy servers' LISTXATTR response 2026-05-20 13:51:59 +00:00
mntfs sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
msdosfs msdosfs(4): Fix two typos in source code comments 2026-04-22 11:21:43 +02:00
nfs nfs_diskless: Fix handling of nfsuserd case for NFSv4 2026-04-13 20:26:32 -07:00
nfsclient nfs_diskless: Add support for an NFSv4 root fs 2026-04-11 17:38:44 -07:00
nfsserver nfs_nfsdsocket.c: Allow Copy/Clone from a read-only fs 2026-04-11 17:36:51 -07:00
nullfs nullfs: Clear inotify flags during reclaim 2026-05-07 13:40:04 -07:00
p9fs p9fs: Remove the "cancel" transport method 2026-07-09 08:58:45 +02:00
procfs execve_block(): a mechanism for mutual exclusion with execve() on the process 2026-07-06 10:29:25 +02:00
pseudofs execve_block(): a mechanism for mutual exclusion with execve() on the process 2026-07-06 10:29:25 +02:00
smbfs VOP_RENAME(9): add flags argument 2026-03-10 13:41:31 +02:00
tarfs tarfs: swap deprecated ZSTD_resetDStream() with ZSTD_DCtx_reset() 2026-03-18 09:49:53 -04:00
tmpfs tmpfs: allow recurse as that does happen when using unionfs 2026-06-19 09:47:29 +02:00
udf style(9): white space after ; and around binary operators 2026-02-05 22:52:32 +01:00
unionfs Revert "unionfs: Support renaming symbolic links" 2026-07-06 10:20:26 +02:00