opnsense-src/sys/fs
Rick Macklem 9328ded386 nfscl: Scan readdir reply filenames for invalid characters
The NFS RFCs are pretty loose with respect to what characters
can be in a filename returned by a Readdir.  However, FreeBSD,
as a POSIX system will not handle imbedded '/' or nul characters
in file names.  Also, for NFSv4, the file names "." and ".."
are handcrafted on the client and should not be returned by a
NFSv4 server.

This patch scans for the above in filenames returned by Readdir and
ignores any entry returned by Readdir which has them in it.
Because an imbedded nul would be a string terminator, it was
not possible to code this check efficiently using string(3)
functions.

Reported by:	Apple Security Engineering and Architecture (SEAR)

(cherry picked from commit 026cdaa3b3a92574d9ac3155216e5cc0b0bd4c51)
2024-07-27 20:53:17 -07:00
..
autofs sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
cd9660 cd9660: Add support for mask,dirmask,uid,gid options 2024-04-08 10:25:46 -07:00
cuse sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
deadfs sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
devfs devfs_allocv(): style 2024-05-19 03:57:54 +03:00
ext2fs Fix build with gcc12. 2023-10-31 08:59:28 -07:00
fdescfs Fix MNT_IGNORE for devfs, fdescfs and nullfs 2024-04-22 15:48:15 +02:00
fifofs sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
fuse fusefs: correct a comment 2024-04-21 08:10:47 -06:00
mntfs sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
msdosfs fs/msdosfs fatblock: use ulmin() rather than min() 2024-03-01 06:12:02 +02:00
nfs nfsd: Fix nfsrv_cleanclient so that it can be called with a mutex 2024-07-21 16:06:02 -07:00
nfsclient nfscl: Scan readdir reply filenames for invalid characters 2024-07-27 20:53:17 -07:00
nfsserver nfsd: Make modifying vfs.nfsd.enable_locallocks safe 2024-07-22 17:29:54 -07:00
nullfs nullfs: Show correct exported flag. 2024-04-22 15:48:15 +02:00
procfs sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
pseudofs pseudofs: fix off by one in hash iteration in pfs_purge 2023-11-24 17:22:15 +00:00
smbfs Add vnode_pager_clean_{a,}sync(9) 2024-01-18 02:51:33 +02:00
tarfs tarfs: Implement VOP_BMAP 2024-04-15 10:06:12 -04:00
tmpfs tmpfs_destroy_vobject(): clear v_object under the object lock 2024-05-19 03:57:54 +03:00
udf udf: uma_zcreate() does not fail 2024-05-02 09:25:08 -04:00
unionfs unionfs_lookup(): fix wild accesses to vnode private data 2024-04-27 12:42:36 -05:00