]> git.michaelhowe.org Git - packages/o/openafs.git/commit
prdb_check: fix out of bounds array access in continuation entries
authorMichael Meffie <mmeffie@sinenomine.net>
Wed, 18 Feb 2015 02:54:46 +0000 (21:54 -0500)
committerStephan Wiesand <stephan.wiesand@desy.de>
Fri, 20 Nov 2015 13:25:49 +0000 (08:25 -0500)
commitcbc3f0813406af5becc516cbf462645f5f2819ff
treeb576e2e844c746bc19e5f1be847cc2a5924c1ad0
parent246338ef17620111ad50383b7fb5a65b8c369f67
prdb_check: fix out of bounds array access in continuation entries

A continuation entry (struct contentry) contains 39 id elements, however
a regular entry (struct prentry) contains only 10 id elements.
Attempting to access more than 10 elements of a regular entry is
undefined behavior.

Use a stuct contentry when when processing continuation entries in
prdb_check.  This is done to safely traverse the id arrays of the
continuation entries.  Use the new pr_PrintContEntry to print
continuation entries.

The undefined behavior manfests as a segmentation violation in
WalkNextChain() when built with GCC 4.8 with optimization enabled.

Reviewed-on: http://gerrit.openafs.org/11742
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 15e8678661ec49f5eac3954defad84c06b3e0164)

Change-Id: Ifc0682cd2b6b1590b10c44ccdda181fd4227c1c2
Reviewed-on: http://gerrit.openafs.org/12104
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/ptserver/db_verify.c