afs: Deal with an empty callback array
authorMarc Dionne <marc.dionne@auristor.com>
Thu, 16 Mar 2017 16:27:44 +0000 (16:27 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Dec 2017 09:07:24 +0000 (10:07 +0100)
commiteaaad7646d3de73ca30653e635261827242be124
treee70b3cef90c9ffc98888da05877c5ea563e02afc
parent900048089cc135fea39452ec32aa44415e1c8dba
afs: Deal with an empty callback array

[ Upstream commit bcd89270d93b7edebb5de5e5e7dca1a77a33496e ]

Servers may send a callback array that is the same size as
the FID array, or an empty array.  If the callback count is
0, the code would attempt to read (fid_count * 12) bytes of
data, which would fail and result in an unmarshalling error.
This would lead to stale data for remotely modified files
or directories.

Store the callback array size in the internal afs_call
structure and use that to determine the amount of data to
read.

Signed-off-by: Marc Dionne <marc.dionne@auristor.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/afs/cmservice.c
fs/afs/internal.h