Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 89145 - useradd uses uninitialized memory
useradd uses uninitialized memory
Product: Red Hat Raw Hide
Classification: Retired
Component: shadow-utils (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Peter Vrabec
David Lawrence
: 106218 (view as bug list)
Depends On:
Blocks: CambridgeTarget
  Show dependency treegraph
Reported: 2003-04-18 08:05 EDT by Enrico Scholz
Modified: 2007-04-18 12:53 EDT (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-04-11 07:27:22 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
fixes usage of uninitialized 'user_groups' variable (486 bytes, patch)
2003-04-18 08:06 EDT, Enrico Scholz
no flags Details | Diff
shadow-4.0.0-alt-user_groups.patch (948 bytes, patch)
2004-01-21 06:57 EST, Dmitry V. Levin
no flags Details | Diff

  None (edit)
Description Enrico Scholz 2003-04-18 08:05:47 EDT
This a CC of a mail to shadow@pld.org.pl (I could not find an archive; the given
link is dead):



the attached patch fixes the usage of an uninitialized 'user_groups'

This variable will be initialized by the get_groups() method, which
will not be called in all cases (only when '-G' flag is given). But the
grp_update() function (which uses this variable) can be called in other
cases also (e.g. on RHL systems which are adding user-groups).


Description of problem:

Comment 1 Enrico Scholz 2003-04-18 08:06:19 EDT
Created attachment 91187 [details]
fixes usage of uninitialized 'user_groups' variable
Comment 2 Warren Togami 2003-04-18 08:50:11 EDT
The combination of glibc-2.3.2 and libsafe causes this to segfault on RH9 and
Mandrake 9.1.  We didn't discover this before because libsafe and older glibc
didn't trigger a segfault.

I have confirmed that the segfault no longer happens on RH9 with this patch to
Comment 3 Warren Togami 2003-04-18 09:24:24 EDT
Mandrake equivalent
Comment 4 Bob T. 2003-10-08 08:00:01 EDT
*** Bug 106218 has been marked as a duplicate of this bug. ***
Comment 5 Warren Togami 2003-12-02 02:44:21 EST
Can we please apply this to rawhide?  This is still an issue in FC1.
Comment 6 Dmitry V. Levin 2004-01-09 18:00:30 EST
Could you look at shadow cvs from time to time, please: 
2003-06-30  Tomasz Kloczko  <kloczek@pld.org.pl> 
        * src/useradd.c, src/usermod.c: 
        Added initializing memory in variables when get_groups() function is not 
        and memory allocated for user_groups is not initialized (in both useradd 
        usermod when -G options is used and in usermod when -l option is used). 
        That causing segfaults sometimes. 
        This fix is importand but not critical because usermod and usermod aren't 
        Problem reported and fixed by Alexey Voinov <voins@altlinux.ru>. 
Comment 7 Warren Togami 2004-01-21 06:24:58 EST
I just noticed that nalin checked in the fix into CVS on January 7th
for rawhide shadow-utils-4.0.3-17.  Perhaps external contributors
should review the SRPM to be safe.
Comment 8 Dmitry V. Levin 2004-01-21 06:55:56 EST
usermod.c hunk is missing in the shadow-4.0.3-uninitialized.patch from 
Comment 9 Dmitry V. Levin 2004-01-21 06:57:18 EST
Created attachment 97144 [details]
Comment 10 Warren Togami 2004-01-21 06:58:31 EST
Arg... re-opening and bugging nalin...
Comment 11 Enrico Scholz 2004-01-21 08:09:15 EST
btw, shadow-utils has been released which contains this fix

Note You need to log in before you can comment on or make changes to this bug.