summaryrefslogtreecommitdiff
path: root/tools/lib/python
diff options
context:
space:
mode:
authorChuck Lever <cel@kernel.org>2026-09-16 12:28:51 -0400
committerChuck Lever <cel@kernel.org>2026-10-11 23:12:48 -0400
commitf4a4dbb14461728d2d9b2d9512192ff0e9179ce9 (patch)
tree8e66bdc097aa20305811cc80fed4ffda7c072957 /tools/lib/python
parent0e1a98a6389efc207f2f42a5c221411c3aa2698e (diff)
downloadlinux-next-f4a4dbb14461728d2d9b2d9512192ff0e9179ce9.tar.gz
linux-next-f4a4dbb14461728d2d9b2d9512192ff0e9179ce9.zip
NFSD: Use xdrgen XDR functions for NFSv2 SYMLINK procedure
A SYMLINK request's target pathname can extend from the head of the receive buffer into its page data; the decoder reassembles it from a head segment and a page via svc_fill_symlink_pathname(). Represent the pathname in place rather than materializing it inline: the "pages" directive expresses it as a struct xdr_buf and decodes it with svcxdr_decode_opaque_payload(), which subsegments the source stream instead of pulling the string inline through the bounded xdr scratch buffer. Annotate the to member of symlinkargs with "pragma pages" and replace the NFSPROC_SYMLINK entry in nfsd_procedures2 with the generated nfs_svc_decode_symlinkargs and nfs_svc_encode_nfsstat. A wrapper structure bridges the generated symlinkargs type and the svc_fh and iattr representations the NFSD VFS layer still uses. nfsd_proc_symlink() copies the pathname out of the xdr_buf with read_bytes_from_xdr_buf(), so a target that lands in the receive buffer's tail, or straddles its pages and tail, is handled the same way as one in the head. The pc_argzero field is now set to zero for the NFSv2 SYMLINK procedure. The generated decoder initializes every argument in the argp->xdrgen field, making the early defensive memset unnecessary. The hand-coded nfsd_proc_symlink() accepts a target of any length from the decoder and answers one longer than NFS_MAXPATHLEN with NFSERR_NAMETOOLONG. The generated decoder enforces the path typedef's bound itself, so such a request now fails decoding and nfsd_dispatch() returns RPC GARBAGE_ARGS instead. The Linux NFS client sends targets up to PAGE_SIZE on an NFSv2 mount, and in that case it reports EIO to the application rather than ENAMETOOLONG. nfssvc_decode_symlinkargs() no longer has any callers, so it is removed. Acked-by: Jeff Layton <jlayton@kernel.org> Link: https://patch.msgid.link/20260916162859.2051-23-cel@kernel.org Signed-off-by: Chuck Lever <cel@kernel.org>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions