Skip to content

Fix unwanted memory overwrites

Chuck Lever linux-nfs 5 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest4 patches 0 repliesNew
  2. v44 patches 6 repliesSuperseded
  3. v35 patches 5 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v24 patches13 repliesSuperseded
v12 patches4 repliesSuperseded

Changes in v5 from the cover letter

* Replace 3/4 and 4/4 with Neil's "nfds: fix up v4.1 slot-based replay handling" series

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4NFSD: Skip close replay processing if XDR encoding failsfs/nfsd/nfs4xdr.c+1 -20 replies
2/4NFSD: Never cache a COMPOUND when the SEQUENCE operation failsfs/nfsd/nfs4state.c+14 -10 replies
3/4nfsd: ensure SEQUENCE replay sends a valid reply.fs/nfsd/nfs4state.c fs/nfsd/nfs4xdr.c fs/nfsd/xdr4.h+36 -190 replies
4/4nfsd: stop pretending that we cache the SEQUENCE reply.fs/nfsd/nfs4state.c fs/nfsd/xdr4.h+18 -610 replies

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchJeff LaytonNeilBrownOlga Kornievskaia
1/4R-b R-b
2/4R-b
3/4R-b T-b
4/4R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v5 thread

Cover letter [PATCH v5 0/4] Fix unwanted memory overwrites

From: Chuck Lever <[email protected]>

<[email protected]> reported some memory overwrites that can be triggered by NFS client input. I was able to observe overwrites by enabling KASAN and running his reproducer [1].

NFSD caches COMPOUNDs containing only a single SEQUENCE operation whether the client requests it to or not, in order to work around a quirk in the NFSv4.1 protocol. However, the predicate that identifies solo SEQUENCE operations was incorrect.

Changes since v4:
* Replace 3/4 and 4/4 with Neil's "nfds: fix up v4.1 slot-based replay handling" series

Changes since v3:
* Neil observes that in this code path, SEQUENCE always the first op
* Expanding the size of the replay cache buffer is unnecessary
* Reordered and simplified the remaining patches
* Haven't yet addressed imbalanced maxresponsesize values

Changes since v2:
* Never cache a COMPOUND if SEQUENCE fails
* Enable caching of solo SEQUENCE operations again
* Reserve enough slot replay cache space to cache solo SEQUENCE

Changes since v1:
* Reordered patches
* Disable caching of solo SEQUENCE operations
* Additional clean up

Chuck Lever (2):
NFSD: Skip close replay processing if XDR encoding fails
NFSD: Never cache a COMPOUND when the SEQUENCE operation fails

NeilBrown (2):
nfsd: ensure SEQUENCE replay sends a valid reply.
nfsd: stop pretending that we cache the SEQUENCE reply.

 fs/nfsd/nfs4state.c | 123 +++++++++++++++++++++++---------------------
 fs/nfsd/nfs4xdr.c   |   5 +-
 fs/nfsd/xdr4.h      |  24 +--------
 3 files changed, 69 insertions(+), 83 deletions(-)
Signature · 1 line
2.51.0