Suhas Athani has uploaded this change for review.

View Change

XDR: add per-field reasonableness limits for arrays and opaques

Part of GitHub issue #867.

Coverity and issue #867 ask for upper bounds on XDR lengths used as
array sizes. A single global max is wrong: WRITE/READ data is an
opaque that must allow XDR_BYTES_MAXLEN_IO, while file handles, ACLs
and bitmaps need much smaller caps.

Bound bitmap4_len with BITMAP4_XDR_MAXLEN while still skipping modest
excess words for forward compatibility. Cap the decode_filehandle()
skip path at NFS4_FHSIZE. Reject io_data lengths above
XDR_BYTES_MAXLEN_IO. Use NFS4_FHSIZE as the maxsize for pNFS FH
xdr_bytes(). Align NFSv4 ACL ACE limits on NFS4_ACL_MAX_ACES and
name the existing POSIX ACL cap POSIX_ACL_MAX_ENTRIES.

Change-Id: I0aee6ccf0e45be4e657b501b1d0471acb00b040b
Signed-off-by: Suhas Athani <Suhas.Athani@ibm.com>
---
M src/FSAL/common_pnfs.c
M src/Protocols/NFS/nfs_proto_tools.c
M src/Protocols/XDR/xdr_nfsacl.c
M src/RPCAL/rpc_tools.c
M src/include/nfsacl.h
M src/include/nfsv41.h
6 files changed, 35 insertions(+), 6 deletions(-)

git pull ssh://review.gerrithub.io:29418/ffilz/nfs-ganesha refs/changes/04/1257204/1

To view, visit change 1257204. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: ffilz/nfs-ganesha
Gerrit-Branch: next
Gerrit-Change-Id: I0aee6ccf0e45be4e657b501b1d0471acb00b040b
Gerrit-Change-Number: 1257204
Gerrit-PatchSet: 1
Gerrit-Owner: Suhas Athani <Suhas.Athani@ibm.com>