afs: Fix missing XDR advance in xdr_decode_{AFS,YFS}FSFetchStatus()
authorDavid Howells <dhowells@redhat.com>
Wed, 8 Apr 2020 15:13:20 +0000 (16:13 +0100)
committerDavid Howells <dhowells@redhat.com>
Mon, 13 Apr 2020 14:09:01 +0000 (15:09 +0100)
commitc72057b56f7e24865840a6961d801a7f21d30a5f
treede16f261dc5b0129ebc2aa22e0563f228764dd6e
parent8f3d9f354286745c751374f5f1fcafee6b3f3136
afs: Fix missing XDR advance in xdr_decode_{AFS,YFS}FSFetchStatus()

If we receive a status record that has VNOVNODE set in the abort field,
xdr_decode_AFSFetchStatus() and xdr_decode_YFSFetchStatus() don't advance
the XDR pointer, thereby corrupting anything subsequent decodes from the
same block of data.

This has the potential to affect AFS.InlineBulkStatus and
YFS.InlineBulkStatus operation, but probably doesn't since the status
records are extracted as individual blocks of data and the buffer pointer
is reset between blocks.

It does affect YFS.RemoveFile2 operation, corrupting the volsync record -
though that is not currently used.

Other operations abort the entire operation rather than returning an error
inline, in which case there is no decoding to be done.

Fix this by unconditionally advancing the xdr pointer.

Fixes: 684b0f68cf1c ("afs: Fix AFSFetchStatus decoder to provide OpenAFS compatibility")
Signed-off-by: David Howells <dhowells@redhat.com>
fs/afs/fsclient.c
fs/afs/yfsclient.c