Package: libnss-extrausers
Version: 0.6-3

The implementation uses three static global pointer variables:

static FILE *groupsfile = NULL;
static FILE *shadowfile = NULL;
static FILE *usersfile = NULL;

Since these are used without locks or atomic operations, this is not 
thread-safe, even though NSS functions are supposed to be reentrant. This is 
leading to occasional "double free or corruption" crashes in libvirtd for us, 
specifically in fclose(groupsfile); in _nss_extrausers_endgrent.

As a quick fix, I suggest declaring these variables thread-local:

static __thread FILE *groupsfile = NULL;
static __thread FILE *shadowfile = NULL;
static __thread FILE *usersfile = NULL;

It's not necessarily the most elegant solution, but it should make the code 
fully reentrant.

Reply via email to