nfs: fix NFSv4.x client name generation problems
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest5 patches 0 repliesNew
- v24 patches 0 repliesSuperseded
- v14 patches 5 repliesSuperseded
Changes in v3 from the cover letter
- add preliminary patch that just increases the buffer in struct nfs41_exchange_id_args, and mark it for stable.
- no need to use GFP_NOFS to allocate cl_owner_id. That will now always be successfully allocated at mount time, and there is no potential for reclaim deadlock. Also add comments to explicitly spell this out.
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | nfs: increase size of EXCHANGE_ID name string bufferinclude/ | +1 | 0 replies | |
| 2/5 | nfs: convert setclientid and exchange_id encoders to use clp->cl_owner_idfs/ fs/ include/ | +22 | 0 replies | |
| 3/5 | nfs: update maxsz values for SETCLIENTID and EXCHANGE_IDfs/ | +4 | 0 replies | |
| 4/5 | nfs: make nfs4_init_nonuniform_client_string use a dynamically allocated bufferfs/ | +51 | 0 replies | |
| 5/5 | nfs: make nfs4_init_uniform_client_string use a dynamically allocated bufferfs/ include/ | +77 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.
Cover letter [PATCH v3 0/5] nfs: fix NFSv4.x client name generation problems
Hi Trond,
This patchset is essentially the same as the v2 set, but prepends one patch that just increases the size of the on-stack buffer for EXCHANGE_ID, and marks that patch for stable.That should be enough for a minimal fix for stable.
These patches and all of the others that I have queued for v4.2 are in my nfs-4.2 branch here (which may be easier for cherry-picking):
https://git.samba.org/?p=jlayton/linux.git;a=shortlog;h=refs/heads/nfs-4.2
v3:
- add preliminary patch that just increases the buffer in struct nfs41_exchange_id_args, and mark it for stable.
- no need to use GFP_NOFS to allocate cl_owner_id. That will now always be successfully allocated at mount time, and there is no potential for reclaim deadlock. Also add comments to explicitly spell this out.
v2:
- improve patch description on fourth patch
- fix potential memory leak in uniform name string generation
- remove unneeded NULL cl_owner_id string check
- account for name blob length word in encode_setclientid_maxsz and encode_exchange_id_maxsz
Original patch description follows:
Michael Skralivetsky reported some problems recently that turned out to be client name string collisions. He has a test environment where the hostnames are quite long, and only differ at the very end.
The v4.1 name string buffer is currently limited to 48 bytes, which is very small. When we go to build the name string, the end can be truncated and if the hostnames are long enough, this can allow the client identifiers to be duplicates of one another.
This patchset should fix the problem by allowing the client name string to be as long as the spec allows (1k). It also gets rid of the large-ish on-stack buffers that are currently used to build these strings, and fixes some potential memory reclaim recursion problems that could occur when these strings are generated.
Jeff Layton (5):
nfs: increase size of EXCHANGE_ID name string buffer
nfs: convert setclientid and exchange_id encoders to use
clp->cl_owner_id
nfs: update maxsz values for SETCLIENTID and EXCHANGE_ID
nfs: make nfs4_init_nonuniform_client_string use a dynamically
allocated buffer
nfs: make nfs4_init_uniform_client_string use a dynamically allocated
buffer
fs/nfs/nfs4proc.c | 171 +++++++++++++++++++++++++++++++++++------------- fs/nfs/nfs4xdr.c | 14 ++-- include/linux/nfs_xdr.h | 8 +-- 3 files changed, 136 insertions(+), 57 deletions(-)
Signature · 1 line
2.4.2