From: Prabhakar Pujeri <prabhakar.pujeri@dell.com>
To: Trond Myklebust <trondmy@kernel.org>, Anna Schumaker <anna@kernel.org>
Cc: linux-nfs@vger.kernel.org, Prabhakar Pujeri <prabhakar.pujeri@dell.com>
Subject: [PATCH 0/4] NFS: harden pNFS device address decoding
Date: Sun, 23 Aug 2026 11:42:40 +0000 [thread overview]
Message-ID: <20260823114244.3883-1-prabhakar.pujeri@dell.com> (raw)
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
next reply other threads:[~2026-08-23 11:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-23 11:42 Prabhakar Pujeri [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260823114244.3883-1-prabhakar.pujeri@dell.com \
--to=prabhakar.pujeri@dell.com \
--cc=anna@kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=trondmy@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox