[PATCH 0/4] NFS: harden pNFS device address decoding
Prabhakar Pujeri <[email protected]>
| Newsgroups | org.kernel.vger.linux-nfs |
|---|---|
| Message-ID | <[email protected]> |
pNFS GETDEVICEINFO replies contain server-provided universal addresses and multipath counts. The current decoders accept malformed port octets and can spend billions of iterations on a count that is not bounded by the reply length. Patch 1 validates both decimal port octets. Patches 2 and 3 bound the file-layout and flexfiles multipath loops by the minimum XDR space needed for each remaining netaddr4. Patch 4 adds focused KUnit coverage. This series is based on the NFS client linux-next integration commit 10f307e525a1, as published in next-20260821. Tested on a Dell PowerEdge R660: the pNFS decoder KUnit suite passed 16/16 and the flexfiles suite passed 3/3, with an empty kmemleak scan. No pNFS-capable server was available, so the affected decoder paths were exercised directly by KUnit. NFSv3, v4.1, and v4.2 data, locking, and parallel workloads passed, together with NFSv3 ACL and NFSv4.2 xattr checks. The series builds cleanly with GCC and Clang W=1 and passes Sparse C=2. Strict checkpatch is clean Prabhakar Pujeri (4): NFS: validate pNFS data server port octets NFS: bound multipath address count in file-layout GETDEVICEINFO NFS: bound multipath address count in flexfiles GETDEVICEINFO NFS: add KUnit coverage for pNFS address decoding fs/nfs/Kconfig | 34 +++ fs/nfs/Makefile | 3 + fs/nfs/filelayout/filelayoutdev.c | 5 + fs/nfs/flexfilelayout/Makefile | 3 + fs/nfs/flexfilelayout/flexfilelayoutdev.c | 9 + fs/nfs/flexfilelayout/tests/deviceid_kunit.c | 188 ++++++++++++++++ fs/nfs/pnfs.h | 8 + fs/nfs/pnfs_nfs.c | 47 ++-- fs/nfs/tests/pnfs_decode_kunit.c | 222 +++++++++++++++++++ 9 files changed, 500 insertions(+), 19 deletions(-) create mode 100644 fs/nfs/flexfilelayout/tests/deviceid_kunit.c create mode 100644 fs/nfs/tests/pnfs_decode_kunit.c base-commit: 10f307e525a1783570a39eb9ac146d45f4f16b3e -- 2.54.0