Problem Description:
In FreeBSD 13.2 and 14.0, the NFS client was optimized to improve
the performance of IO_APPEND writes, that is, writes which add data
to the end of a file and so extend its size. This uncovered an old
bug in some routines which copy userspace data into the kernel.
The bug also affects the NFS client's implementation of direct I/O;
however, this implementation is disabled by default by the
vfs.nfs.nfs_directio_enable sysctl and is only used to handle
synchronous writes.
Impact:
When a program running on an affected system appends data to a
file via an NFS client mount, the bug can cause the NFS client to
fail to copy in the data to be written but proceed as though the
copy operation had succeeded. This means that the data to be written
is instead replaced with whatever data had been in the packet buffer
previously. Thus, an unprivileged user with access to an affected
system may abuse the bug to trigger disclosure of sensitive
information. In particular, the leak is limited to data previously
stored in mbufs, which are used for network transmission and
reception, and for certain types of inter-process communication.
The bug can also be triggered unintentionally by system
applications, in which case the data written by the application to an
NFS mount may be corrupted. Corrupted data is written over the
network to the NFS server, and thus also susceptible to being snooped
by other hosts on the network.
Note that the bug exists only in the NFS client; the version and
implementation of the server has no effect on whether a given system
is affected by the problem.