freebsd-src/sys/fs
Rick Macklem 4e7bf17e9d 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 026cdaa3b3)
(cherry picked from commit 9328ded386)
2024-08-07 13:25:36 +00:00
..
autofs sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
cd9660 sys: Remove $FreeBSD$: one-line bare tag 2023-08-16 11:55:17 -06:00
cuse
deadfs
devfs
ext2fs
fdescfs
fifofs
fuse fusefs: sanitize FUSE_READLINK results for embedded NULs 2023-10-14 20:13:05 -06:00
mntfs
msdosfs sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
nfs nfsclient: Propagate copyin() errors from nfsm_uiombuf() 2023-12-12 14:14:05 -05:00
nfsclient nfscl: Scan readdir reply filenames for invalid characters 2024-08-07 13:25:36 +00:00
nfsserver sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
nullfs
procfs sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
pseudofs Remove my middle name. 2023-08-17 15:08:30 +02:00
smbfs
tarfs
tmpfs sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
udf sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
unionfs