This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [patch] Fix for bz22161: ncsd: avoid dangling lock in netgroup cache timeout code
- From: Andreas Schwab <schwab at suse dot de>
- To: DJ Delorie <dj at redhat dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Thu, 21 Sep 2017 09:08:30 +0200
- Subject: Re: [patch] Fix for bz22161: ncsd: avoid dangling lock in netgroup cache timeout code
- Authentication-results: sourceware.org; auth=none
- References: <xnd16lt1vd.fsf@greed.delorie.com>
On Sep 20 2017, DJ Delorie <dj@redhat.com> wrote:
> Patch for https://sourceware.org/bugzilla/show_bug.cgi?id=22161
>
> "From the bz: in nscd/netgroupcache.c in addinnetgrX() we call
> mempool_alloc(..., 1) which takes a lock on the database. If we
> exit via the "bump timeout" clause, the lock is not released."
>
> This patch adds an unlock if mempool_alloc actually took a lock, in
> the case where we return early because the timeout hasn't timed out.
What about the uses of mempool_alloc in the other *cache.c
implementations. Are they ok?
Andreas.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."