autofs-5.1.9 - fix lookup_hosts module leaks read lock on early return

If a master map internal hosts map entry constructed from an NFS export
list results in an offset with the map entry mapent field being set to
NULL (such as a mount failure) then the internal hosts map lookup_mount()
function can return without releasing the cache readlock.

While we're at it, I don't know why I used pthread_cleanup_push() and
pthread_cleanup_pop() here, this function isn't subject to cancellation,
so remove it and ensure mapent is NULL terminated.

Reported-By: AISLE Research
Fixes: 8fdc8adb55 ("autofs-5.1.9 - fix invalidated map entry handling in hosts module")
Signed-off-by: Ian Kent <raven@themaw.net>
2 files changed