From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28955 invoked by alias); 25 Aug 2009 22:50:03 -0000 Received: (qmail 28004 invoked by uid 48); 25 Aug 2009 22:49:47 -0000 Date: Tue, 25 Aug 2009 22:50:00 -0000 From: "kamil dot 76934 at iskra dot name" To: glibc-bugs@sources.redhat.com Message-ID: <20090825224946.10563.kamil.76934@iskra.name> Reply-To: sourceware-bugzilla@sourceware.org Subject: [Bug nptl/10563] New: supplementary groups are not shared between (p)threads X-Bugzilla-Reason: CC Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org X-SW-Source: 2009-08/txt/msg00073.txt.bz2 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.