Linux NFS development
 help / color / mirror / Atom feed
* [PATCH 0/4] NFS: harden pNFS device address decoding
@ 2026-08-23 11:42 Prabhakar Pujeri
  2026-08-23 11:42 ` [PATCH 1/4] NFS: validate pNFS data server port octets Prabhakar Pujeri
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Prabhakar Pujeri @ 2026-08-23 11:42 UTC (permalink / raw)
  To: Trond Myklebust, Anna Schumaker; +Cc: linux-nfs, Prabhakar Pujeri

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-08-23 11:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-23 11:42 [PATCH 0/4] NFS: harden pNFS device address decoding Prabhakar Pujeri
2026-08-23 11:42 ` [PATCH 1/4] NFS: validate pNFS data server port octets Prabhakar Pujeri
2026-08-23 11:42 ` [PATCH 2/4] NFS: bound multipath address count in file-layout GETDEVICEINFO Prabhakar Pujeri
2026-08-23 11:42 ` [PATCH 3/4] NFS: bound multipath address count in flexfiles GETDEVICEINFO Prabhakar Pujeri
2026-08-23 11:42 ` [PATCH 4/4] NFS: add KUnit coverage for pNFS address decoding Prabhakar Pujeri

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox