The following commit has been merged in the openafs-stable-1_8_x branch: commit b46d63252b7b8575dd7a79fbd779725f63202afc Author: Andrew Deason <adea...@sinenomine.net> Date: Thu Jan 17 16:21:25 2019 -0600
afs: Check dcache size when checking DVs Currently, if the dcache for a file has nonsensical length (due to cache corruption or other bugs), we never notice, and we serve obviously bad data to applications. For example, the vcache metadata for a file may say the file is 2k bytes long, but the dcache for that file only has 1k bytes in it (or more commonly, 0 bytes). This situation is easily detectable, since the dcache and vcache refer to the same version of the same file (when the DVs match), and so we can check if the two lengths make sense together. So to avoid giving bad data to userspace applications, perform a sanity check on the lengths at the same time we check for DV matches (to see if the dcache looks "fresh" and not stale). If the lengths do not make sense together, we just pretend that the dcache is old, and so we'll ignore it and fetch a new copy from the fileserver. Also check the size of the data fetched from the fileserver for a newly-fetched dcache in afs_GetDCache, to avoid returning a bad dcache if the dcache isn't already present in the cache. Reviewed-on: https://gerrit.openafs.org/13436 Reviewed-by: Benjamin Kaduk <ka...@mit.edu> Tested-by: BuildBot <build...@rampaginggeek.com> (cherry picked from commit 7c60a0fba11dd24494a5f383df8bea5fdbabbdd7) Change-Id: I197d197f3f2eaf0473c76c60c9df842a3bed934a Reviewed-on: https://gerrit.openafs.org/15532 Tested-by: BuildBot <build...@rampaginggeek.com> Reviewed-by: Mark Vitale <mvit...@sinenomine.net> Reviewed-by: Stephan Wiesand <stephan.wies...@desy.de> src/afs/afs_dcache.c | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 93 insertions(+), 3 deletions(-) -- OpenAFS Master Repository _______________________________________________ OpenAFS-cvs mailing list OpenAFS-cvs@openafs.org https://lists.openafs.org/mailman/listinfo/openafs-cvs