1 autofs-5.0.4 - fix hosts map use after free
3 From: Ian Kent <raven@themaw.net>
5 This patch fixed use a map entry after it has been freed in the
6 hosts map lookup module.
10 modules/lookup_hosts.c | 8 +++++---
11 2 files changed, 6 insertions(+), 3 deletions(-)
14 diff --git a/CHANGELOG b/CHANGELOG
15 index eb4a189..3199e4d 100644
19 Valerie Aurora Henson).
20 - clear the quoted flag after each character from program map input.
21 - use CLOEXEC flag for setmntent also.
22 +- fix hosts map use after free.
24 4/11/2008 autofs-5.0.4
25 -----------------------
26 diff --git a/modules/lookup_hosts.c b/modules/lookup_hosts.c
27 index 93b975a..d3ae0e2 100644
28 --- a/modules/lookup_hosts.c
29 +++ b/modules/lookup_hosts.c
30 @@ -138,17 +138,19 @@ int lookup_mount(struct autofs_point *ap, const char *name, int name_len, void *
31 /* Check if we recorded a mount fail for this key anywhere */
32 me = lookup_source_mapent(ap, name, LKP_DISTINCT);
34 + struct mapent_cache *fmc = me->mc;
36 if (me->status >= time(NULL)) {
37 - cache_unlock(me->mc);
39 return NSS_STATUS_NOTFOUND;
43 - cache_delete(me->mc, name);
44 + cache_delete(fmc, name);
48 - cache_unlock(me->mc);