This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug nptl/10563] New: supplementary groups are not shared between (p)threads

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:

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

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]