opnsense-src/sys/fs/nfsclient
Rick Macklem db4f457f16 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.

Approved by:	so
Security:	FreeBSD-SA-24:07.nfsclient
Security:	CVE-2024-6759
Reported by:	Apple Security Engineering and Architecture (SEAR)

(cherry picked from commit 026cdaa3b3a92574d9ac3155216e5cc0b0bd4c51)
(cherry picked from commit 9328ded386)
2024-08-07 17:14:11 +02:00
..
nfs.h nfscl: Clear out a lot of cruft related to B_DIRECT 2024-04-30 18:06:36 -07:00
nfs_clbio.c nfscl: Clear out a lot of cruft related to B_DIRECT 2024-04-30 18:06:36 -07:00
nfs_clcomsubs.c nfsclient: Propagate copyin() errors from nfsm_uiombuf() 2023-12-12 14:11:51 -05:00
nfs_clkdtrace.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
nfs_clkrpc.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
nfs_clnfsiod.c nfscl: Clear out a lot of cruft related to B_DIRECT 2024-04-30 18:06:36 -07:00
nfs_clnode.c Add vnode_pager_clean_{a,}sync(9) 2024-01-18 02:51:33 +02:00
nfs_clport.c nfsclient: eliminate ncl_writebp() 2024-01-11 18:46:52 +02:00
nfs_clrpcops.c nfscl: Scan readdir reply filenames for invalid characters 2024-08-07 17:14:11 +02:00
nfs_clstate.c nfscl: Revert part of commit 196787f79e67 2024-04-27 17:35:22 -07:00
nfs_clsubs.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
nfs_clvfsops.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
nfs_clvnops.c nfscl: Clear out a lot of cruft related to B_DIRECT 2024-04-30 18:06:36 -07:00
nfs_kdtrace.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
nfsmount.h nfscl: Revert part of commit 196787f79e67 2024-04-27 17:35:22 -07:00
nfsnode.h nfscl: Clear out a lot of cruft related to B_DIRECT 2024-04-30 18:06:36 -07:00
nlminfo.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00