]> 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)
commita6df443e66e505ba0348877b8663f4e1a37f2fc2
treede16f261dc5b0129ebc2aa22e0563f228764dd6e
parent9b8057e7f937f20763a90a8fc2333168af101732
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: f3c58063d49f ("afs: Fix AFSFetchStatus decoder to provide OpenAFS compatibility")
Signed-off-by: David Howells <dhowells@redhat.com>
fs/afs/fsclient.c
fs/afs/yfsclient.c