[S] Change in ...nfs-ganesha[next]: XDR: reject empty file handles, client ids and state owners
Suhas Athani has uploaded this change for review. ( https://review.gerrithub.io/c/ffilz/nfs-ganesha/+/1252765?usp=email ) Change subject: XDR: reject empty file handles, client ids and state owners ...................................................................... XDR: reject empty file handles, client ids and state owners GitHub Issue: #1404 The variable length opaques that identify an object or a client were decoded with inline_xdr_bytes(), which accepts a zero length. An empty client id reached get_client_record() and used to trip an assert there (since replaced by a LogCrit and error return). Empty file handles and empty open/lock owners were likewise only caught, if at all, deep in the operation code. Add xdr_bytes_nonempty(), a wrapper around inline_xdr_bytes() that fails a zero length opaque on both decode and encode, and use it for: - nfs_fh4 (all file handles) - nfs_client_id4.id (SETCLIENTID) - client_owner4.co_ownerid (EXCHANGE_ID) - state_owner4.owner (open and lock owners) libntirpc's generic xdr_bytes() is unchanged, and opaques that may legitimately be empty (attrlist4, layoutupdate/layoutreturn bodies, notifylist4, SSV fields, sec_oid4, gsshandle4_t) keep using inline_xdr_bytes(). server_owner4.so_major_id is only ever encoded from server configuration and is also left alone. Change-Id: Iecd44e5719173f4b7be844683bc743535cff081d Signed-off-by: Suhas Athani <Suhas.Athani@ibm.com> --- M src/include/nfsv41.h 1 file changed, 29 insertions(+), 10 deletions(-) git pull ssh://review.gerrithub.io:29418/ffilz/nfs-ganesha refs/changes/65/1252765/1 -- To view, visit https://review.gerrithub.io/c/ffilz/nfs-ganesha/+/1252765?usp=email To unsubscribe, or for help writing mail filters, visit https://review.gerrithub.io/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: ffilz/nfs-ganesha Gerrit-Branch: next Gerrit-Change-Id: Iecd44e5719173f4b7be844683bc743535cff081d Gerrit-Change-Number: 1252765 Gerrit-PatchSet: 1 Gerrit-Owner: Suhas Athani <Suhas.Athani@ibm.com>
participants (1)
-
Suhas Athani (GerritHub)