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; 7+ 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] 7+ messages in thread

* [Bug nptl/10563] supplementary groups are not shared between (p)threads
  2009-08-25 22:50 [Bug nptl/10563] New: supplementary groups are not shared between (p)threads kamil dot 76934 at iskra dot name
@ 2009-08-25 22:52 ` kamil dot 76934 at iskra dot name
  0 siblings, 0 replies; 7+ messages in thread
From: kamil dot 76934 at iskra dot name @ 2009-08-25 22:52 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From kamil dot 76934 at iskra dot name  2009-08-25 22:51 -------
Created an attachment (id=4151)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=4151&action=view)
self-contained testcase


-- 


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] 7+ messages in thread

* [Bug nptl/10563] supplementary groups are not shared between (p)threads
       [not found] <bug-10563-131@http.sourceware.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2014-07-01  6:59 ` fweimer at redhat dot com
@ 2014-07-01  8:34 ` fweimer at redhat dot com
  4 siblings, 0 replies; 7+ messages in thread
From: fweimer at redhat dot com @ 2014-07-01  8:34 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #6 from Florian Weimer <fweimer at redhat dot com> ---
Fixed in commit 70181fddf1467996bea393d13294ffe76b8a0853, which went into glibc
2.13.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

* [Bug nptl/10563] supplementary groups are not shared between (p)threads
       [not found] <bug-10563-131@http.sourceware.org/bugzilla/>
                   ` (2 preceding siblings ...)
  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
  4 siblings, 0 replies; 7+ messages in thread
From: fweimer at redhat dot com @ 2014-07-01  6:59 UTC (permalink / raw)
  To: glibc-bugs

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

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fweimer at redhat dot com
              Flags|                            |security+

--- Comment #5 from Florian Weimer <fweimer at redhat dot com> ---
This should probably treated as a security issue because it can interact with
relinquishing privileges.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

* [Bug nptl/10563] supplementary groups are not shared between (p)threads
       [not found] <bug-10563-131@http.sourceware.org/bugzilla/>
  2011-01-11  1:52 ` 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
  4 siblings, 0 replies; 7+ messages in thread
From: drepper.fsp at gmail dot com @ 2011-01-14 13:43 UTC (permalink / raw)
  To: glibc-bugs

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

Ulrich Drepper <drepper.fsp at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #4 from Ulrich Drepper <drepper.fsp at gmail dot com> 2011-01-14 13:42:57 UTC ---
I checked in some changes.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug nptl/10563] supplementary groups are not shared between (p)threads
       [not found] <bug-10563-131@http.sourceware.org/bugzilla/>
  2011-01-11  1:52 ` 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
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: mark at heily dot com @ 2011-01-11  2:11 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #3 from Mark Heily <mark at heily dot com> 2011-01-11 02:11:32 UTC ---
Created attachment 5188
  --> http://sourceware.org/bugzilla/attachment.cgi?id=5188
Additional testcase

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug nptl/10563] supplementary groups are not shared between (p)threads
       [not found] <bug-10563-131@http.sourceware.org/bugzilla/>
@ 2011-01-11  1:52 ` mark at heily dot com
  2011-01-11  2:11 ` mark at heily dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: mark at heily dot com @ 2011-01-11  1:52 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #2 from Mark Heily <mark at heily dot com> 2011-01-11 01:51:47 UTC ---
Created attachment 5187
  --> http://sourceware.org/bugzilla/attachment.cgi?id=5187
use INLINE_SETXID_SYSCALL for setgroups()

The attached patch converts setgroups() to use INLINE_SETXID_SYSCALL which
should hopefully fix the problem. I havn't tested it, and don't know if there
is anything else that needs to be done.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

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

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-25 22:50 [Bug nptl/10563] New: supplementary groups are not shared between (p)threads kamil dot 76934 at iskra dot name
2009-08-25 22:52 ` [Bug nptl/10563] " kamil dot 76934 at iskra dot name
     [not found] <bug-10563-131@http.sourceware.org/bugzilla/>
2011-01-11  1:52 ` 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

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).