]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit755ef13c11ee790e71051bd7c95a4758ba5d3735
treede16f261dc5b0129ebc2aa22e0563f228764dd6e
parent0e6c92ce1d170795a396f8108369eb2c8412797f
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: 770e63cd64a1 ("afs: Fix AFSFetchStatus decoder to provide OpenAFS compatibility")
Signed-off-by: David Howells <dhowells@redhat.com>
fs/afs/fsclient.c
fs/afs/yfsclient.c