This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [RESEND-2][PATCH][BZ 13761] Fix allocation in nss_compat forlarge number of memberships to a group
- From: Siddhesh Poyarekar <siddhesh dot poyarekar at gmail dot com>
- To: Andreas Jaeger <aj at suse dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Wed, 28 Mar 2012 15:41:48 +0530
- Subject: Re: [RESEND-2][PATCH][BZ 13761] Fix allocation in nss_compat forlarge number of memberships to a group
- References: <20120326115258.665b2be5@spoyarek><4F72E110.6030202@suse.com>
On Wed, Mar 28, 2012 at 3:29 PM, Andreas Jaeger <aj@suse.com> wrote:
>> nss_compat allocates buffer space on stack using alloca (and
>> extend_alloca) for initgroup and keeps extending it to fit in larger
>> lines. This breaks for cases where the number of members in a gorup
>> are very large, causing the alloca reference to go beyond thread stack
>> boundary. Attached patch falls back to malloc/free if the buffer size
>> needed is beyond __libc_alloca_cutoff.
>
>
> Please state in your submission how and where this was tested.
>
> The patch itself looks fine to me but I'd like to hear about testing,
I tested this using the reproducer steps described in the bug report
as well as with an ldap group with large number of users. I've tried
this on x86_64 boxes with backports of the patch to RHEL-5 (patch
needed modifications), RHEL-6 and also on my F-16 box with glibc built
off HEAD.
--
Siddhesh Poyarekar
http://siddhesh.in