summaryrefslogtreecommitdiff
path: root/src/responder/nss/nsssrv_netgroup.h
diff options
context:
space:
mode:
authorLukas Slebodnik <lslebodn@redhat.com>2013-08-19 05:39:28 +0200
committerJakub Hrozek <jhrozek@redhat.com>2013-08-28 16:43:50 +0200
commit4662725ffef62b3b2502481438effa7c8fef9f80 (patch)
tree5a7c54965be57d31d9e2c25f8e50b1437ad7196c /src/responder/nss/nsssrv_netgroup.h
parent3575235d62fa242d9a650ee54425f42b19533cb0 (diff)
downloadsssd-4662725ffef62b3b2502481438effa7c8fef9f80.tar.gz
sssd-4662725ffef62b3b2502481438effa7c8fef9f80.tar.bz2
sssd-4662725ffef62b3b2502481438effa7c8fef9f80.zip
mmap_cache: Skip records which doesn't have same hash
The code uses 2 hashes for each record, but only one hash table to index them both, furthermore each record has only one single 'next' pointer. This means that in certain conditions a record main end up being on a hash chain even though its hashes do not match the hash chain. This can happen when another record 'drags' it in from another hash chain where they both belong. If the record without matching hashes happens to be the second of the chain and the first record is removed, then the non matching record is left on the wrong chain. On removal of the non-matching record the hash chain will not be updated and the hash chain will end up pointing to an invalid slot. This slot may be later reused for another record and may not be the first slot of this new record. In this case the hash chain will point to arbitrary data and may cause issues if the slot is interpreted as the head of a record. By skipping any block that has no matching hashes upon removing the first record in a chain we insure that dangling references cannot be left in the hash table Resolves: https://fedorahosted.org/sssd/ticket/2049
Diffstat (limited to 'src/responder/nss/nsssrv_netgroup.h')
0 files changed, 0 insertions, 0 deletions