public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug nptl/10563] New: supplementary groups are not shared between (p)threads
@ 2009-08-25 22:50 kamil dot 76934 at iskra dot name
  2009-08-25 22:52 ` [Bug nptl/10563] " kamil dot 76934 at iskra dot name
  0 siblings, 1 reply; 6+ messages in thread
From: kamil dot 76934 at iskra dot name @ 2009-08-25 22:50 UTC (permalink / raw)
  To: glibc-bugs

I noticed that supplementary groups (getgroups(2)/setgroups(2)) are not shared
between the threads in a multithreaded program.  I would expect that since
[e]uid and [e]gid are, so should the supplementary groups?  I checked the source
and I can see that set*id() calls use the setxid API to synchronize the ids
between the threads, but setgroups() does not do that; I guess that's the
problem.  I didn't try to compile the latest version, but the source is the same
in that respect...

This is with kernel 2.6.30, gcc 4.3.2, binutils 2.18, but I don't think this
matters all that much, as I first saw it on a completely different platform
(PPC64 SLES 10).

I'll attach a self-contained testcode.  It needs to be run as root.  I'm getting
the following output:

"Initial groups:
0, 1, 2, 3, 4, 6, 10, 11, 20, 26, 27

Launched a new thread

Changing groups in the main thread...

Main thread groups:
12345

Launched thread groups:
0, 1, 2, 3, 4, 6, 10, 11, 20, 26, 27"

Instead, I would expect the last line to be "12345".

-- 
           Summary: supplementary groups are not shared between (p)threads
           Product: glibc
           Version: 2.9
            Status: NEW
          Severity: normal
          Priority: P2
         Component: nptl
        AssignedTo: drepper at redhat dot com
        ReportedBy: kamil dot 76934 at iskra dot name
                CC: glibc-bugs at sources dot redhat dot com
  GCC host triplet: x86_64-pc-linux-gnu


http://sourceware.org/bugzilla/show_bug.cgi?id=10563

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-07-01  8:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-10563-131@http.sourceware.org/bugzilla/>
2011-01-11  1:52 ` [Bug nptl/10563] supplementary groups are not shared between (p)threads mark at heily dot com
2011-01-11  2:11 ` mark at heily dot com
2011-01-14 13:43 ` drepper.fsp at gmail dot com
2014-07-01  6:59 ` fweimer at redhat dot com
2014-07-01  8:34 ` fweimer at redhat dot com
2009-08-25 22:50 [Bug nptl/10563] New: " kamil dot 76934 at iskra dot name
2009-08-25 22:52 ` [Bug nptl/10563] " kamil dot 76934 at iskra dot name

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).