public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/6] Fixes for server-side xdr_stream overhaul
@ 2022-09-01 19:09 Chuck Lever
  2022-09-01 19:09 ` [PATCH v3 1/6] SUNRPC: Fix svcxdr_init_decode's end-of-buffer calculation Chuck Lever
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Chuck Lever @ 2022-09-01 19:09 UTC (permalink / raw)
  To: linux-nfs

During review of the v2 of this series, Jeff suggested looking at
svc_max_payload() call sites for similar issues, and I found some.
I've included fixes for NFSv2 and NFSv3 operations in v3 of this
series.

The NFSv4 stack is different than NFSv2/3, so the simple fixes
proposed here are not appropriate there. For one thing, NFSv4 has
these op_rsize_bop helpers that use svc_max_payload() to estimate
the reply size -- but these are called well before
svcxdr_init_encode() has set rq_res.buflen. I'm still working on
fixes for those (including get/listxattr, getattr, read, readdir,
etc).


Changes since v2:
- Dropped the clean-up patches; will re-post those separately, later
- Added fixes for NFSv3 READ and for NFSv2 READ and READDIR
- Hopefully addressed a crash when @dircount is too large

Changes since v1:
- Dropped the xdr_buf_length() helper
- Replaced 7/7 with patch that cleans up an unneeded use of xdr_buf::len
- Dropped the checks for oversized RPC records
- Fixed narrow problem with NFSv2 and NFSv3 READDIR processing

---

Chuck Lever (6):
      SUNRPC: Fix svcxdr_init_decode's end-of-buffer calculation
      SUNRPC: Fix svcxdr_init_encode's buflen calculation
      NFSD: Protect against send buffer overflow in NFSv2 READDIR
      NFSD: Protect against send buffer overflow in NFSv3 READDIR
      NFSD: Protect against send buffer overflow in NFSv2 READ
      NFSD: Protect against send buffer overflow in NFSv3 READ


 fs/nfsd/nfs3proc.c         | 11 ++++++-----
 fs/nfsd/nfsproc.c          |  6 +++---
 include/linux/sunrpc/svc.h | 19 +++++++++++++++----
 3 files changed, 24 insertions(+), 12 deletions(-)

--
Chuck Lever


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

end of thread, other threads:[~2022-09-02 14:03 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-01 19:09 [PATCH v3 0/6] Fixes for server-side xdr_stream overhaul Chuck Lever
2022-09-01 19:09 ` [PATCH v3 1/6] SUNRPC: Fix svcxdr_init_decode's end-of-buffer calculation Chuck Lever
2022-09-01 19:09 ` [PATCH v3 2/6] SUNRPC: Fix svcxdr_init_encode's buflen calculation Chuck Lever
2022-09-01 19:10 ` [PATCH v3 3/6] NFSD: Protect against send buffer overflow in NFSv2 READDIR Chuck Lever
2022-09-02 13:09   ` Jeff Layton
2022-09-01 19:10 ` [PATCH v3 4/6] NFSD: Protect against send buffer overflow in NFSv3 READDIR Chuck Lever
2022-09-02 13:12   ` Jeff Layton
2022-09-01 19:10 ` [PATCH v3 5/6] NFSD: Protect against send buffer overflow in NFSv2 READ Chuck Lever
2022-09-02 13:14   ` Jeff Layton
2022-09-01 19:10 ` [PATCH v3 6/6] NFSD: Protect against send buffer overflow in NFSv3 READ Chuck Lever
2022-09-02 13:15   ` Jeff Layton

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