Received: with ECARTIS (v1.0.0; list netdev); Thu, 18 Nov 2004 13:25:04 -0800 (PST) Received: from fire-1.osdl.org (fire.osdl.org [65.172.181.4]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iAILOuug004616 for ; Thu, 18 Nov 2004 13:24:59 -0800 Received: from zqx3.pdx.osdl.net (fw.osdl.org [65.172.181.6]) (authenticated bits=0) by fire-1.osdl.org (8.12.8/8.12.8) with ESMTP id iAILNqPE023652 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Thu, 18 Nov 2004 13:23:52 -0800 Date: Thu, 18 Nov 2004 13:27:00 -0800 From: Stephen Hemminger To: Herbert Xu Cc: "Chad N. Tindel" , netdev@oss.sgi.com, linux-net@vger.kernel.org Subject: Re: Wrong UIDs reported in /proc/net/tcp Message-Id: <20041118132700.29c23d00@zqx3.pdx.osdl.net> In-Reply-To: <20041118210307.GA9557@gondor.apana.org.au> References: <20041109205358.GA64015@calma.pair.com> <20041118190257.GA7084@calma.pair.com> <20041118210307.GA9557@gondor.apana.org.au> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.10claws (GTK+ 1.2.10; i686-suse-linux) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-MIMEDefang-Filter: osdl$Revision: 1.95 $ X-Scanned-By: MIMEDefang 2.36 X-archive-position: 11970 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev On Fri, 19 Nov 2004 08:03:07 +1100 Herbert Xu wrote: > On Thu, Nov 18, 2004 at 02:02:57PM -0500, Chad N. Tindel wrote: > > > > OK, so just out of sheer morbid curiousity, I added an ioctl which will > > accept 4 parameters (the address/port pairs), and will return the user id > > associated with that socket. I also changed pidentd to call this ioctl > > instead of looking at /proc/net/tcp. This should theoretically get rid > > of all race conditions. > > Please show us the code of your ioctl. > > Have you tried netlink yet? Does it exhibit the same problem? It could also be the sockets are shared between processes with uid's or that the real/effective uid or different or even the uid is that of the original creator and the file was inherited across exec.