[SSSD] [PATCH] gracefully handle mmap_cache calls when uninitialized

Simo Sorce simo at redhat.com
Fri Dec 14 14:32:58 UTC 2012


On Fri, 2012-12-14 at 15:17 +0100, Michal Židek wrote:
> On 12/14/2012 02:59 PM, Simo Sorce wrote:
> > Failure to init the mmap_cache is a soft error, so just gracefully
> > return a EINVAL error from public functions if the mc context is NULL
> > and do not segfault.
> >
> > Fixes: https://fedorahosted.org/sssd/ticket/1716
> >
> > Simo.
> >
> >
> >
> 
> Looks good to me. Tested with uninitialized mmap cache and worked fine.
> 
> But I have failed to find were we explicitly set the context of memory 
> caches to NULL when not initialized properly. Maybe we should place it 
> to nss_process_init to the "if (ret)" branch when memory cache 
> initialization fails to make it more obvious.

Here:
http://git.fedorahosted.org/cgit/sssd.git/tree/src/responder/nss/nsssrv.c#n405

> If it is set to NULL explicitly somewhere else, than it is ACK, 

All nctx is set to zero on init, so unless you successfully init a mmap
you have a guaranteed NULL there.

> otherwise, please, add it to the nss_process_init and it will be ACK.

Ok, it's an ACK then :)

Simo.

-- 
Simo Sorce * Red Hat, Inc * New York




More information about the sssd-devel mailing list