]> git.michaelhowe.org Git - packages/o/openafs.git/commit
dir: Protect against circular hash chains
authorSimon Wilkinson <sxw@your-file-system.com>
Fri, 15 Apr 2011 18:40:45 +0000 (19:40 +0100)
committerDerrick Brashear <shadow@dementix.org>
Sun, 14 Aug 2011 02:16:49 +0000 (19:16 -0700)
commite32e873b89e2d7f73e17fbc7d1f89501ad5afc2c
treed56b2c6c9778f84622918a79b1a3025a4e6d3200
parenta1e2aeb3f060c15313b271bfc66b7797c8cadf1f
dir: Protect against circular hash chains

The dir package didn't protect against circular hash chains when
performing directory lookups. A corrupt directory could therefore
cause a client or a fileserver to go into an endless loop if that
directory contained a loop in its hash chain pointers.

Fix this by exiting the lookup if the hash chain has more elements
than the total number of entries in a directory. This maximum number
of entries is taken as being (number of entries per page) * (max
number of pages), which is considerably more than the real maximum
value.
(cherry picked from commit bb25bdfcb059fc54a57fd4733ce3184e231ca88d)

Change-Id: I7290dbaad66bccfe3b03a843184464f0681f9429
Reviewed-on: http://gerrit.openafs.org/5250
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
src/dir/dir.c