All of lore.kernel.org
 help / color / mirror / Atom feed
* Wrong UIDs reported in /proc/net/tcp
@ 2004-11-09 20:53 Chad N. Tindel
  2004-11-09 21:06 ` Herbert Xu
  2004-11-09 21:11 ` akepner
  0 siblings, 2 replies; 19+ messages in thread
From: Chad N. Tindel @ 2004-11-09 20:53 UTC (permalink / raw)
  To: netdev; +Cc: linux-net

Hello-

In our testing we've found some occurrences of identd reporting back the
wrong username for the owner of a socket.  We added some instrumentation
to identd so that we can tell it what we expect the username to be, and when
what it discovers doesn't match what we expect, it logs a message.  Sometimes
non-root users appear as root, and sometimes the root user appears as a non-root
user.  Here's an example log message from our instrumented identd:

Nov  9 00:55:11 rock identd[4139]: ERROR: Expected username 'root' but got 'ident'. Proc line was ' 299: AFAF0D0F:CEE1 ACAF0D0F:14B6 01 00000000:00000000 00:00000000 00000000   100        0 880370 1 f22bb980 21 4 8 3 -1 '.  EUID was 100

As you can see, our client was running as root, but identd reported that
the username was "ident".  /proc/net/tcp reported that the EUID was 100.  
Clearly it isn't correct that the ident user is associated with a socket that
doesn't have port 113 as one of the endpoints.

Here's another example:

Nov  8 17:19:06 rock identd[4139]: ERROR: Expected username 'rba0001f' but got 'root'. Proc line was '  19: AFAF0D0F:8FFD AFAF0D0F:14B6 01 00000000:00000000 02:000AFC6F 00000000     0        0 0 2 f04ed980 '.  EUID was 0

The user rba0001f has a UID of 65535 on this system.

We have seen this problem on RH3u3 as well as SLES9, so our current thoughts
are that it is a generic kernel issue.  We're starting to dive down in the
code to look for possible problems, but I wanted to bring it up to the list
and see if anybody had any ideas.  

In our cursory analysis of the code, we've seen that the inode structure which
holds the user id comes out of a cache.  In the function sock_alloc(), the
UID gets assigned as:

inode->i_uid = current->fsuid;

Is it possible for this code to be invoked in a context where current doesn't
actually point to the right task structure?

Is it possible for the socket to get added to the established hash table
before the uid pointer gets initialized, thus causing /proc/net/tcp to report
the UID of whoever used this socket memory earlier?

We can reproduce this problem fairly easily here, so if anybody has any ideas
or suggestions on kernel instrumentation that would help track this down, I'm
all ears.

Regards,

Chad

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

end of thread, other threads:[~2004-11-19 21:01 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-09 20:53 Wrong UIDs reported in /proc/net/tcp Chad N. Tindel
2004-11-09 21:06 ` Herbert Xu
2004-11-09 22:43   ` Chad N. Tindel
2004-11-09 22:58     ` Herbert Xu
2004-11-09 23:04       ` Chad N. Tindel
2004-11-09 23:18         ` Herbert Xu
2004-11-18 19:02   ` Chad N. Tindel
2004-11-18 21:03     ` Herbert Xu
2004-11-18 21:27       ` Stephen Hemminger
2004-11-18 22:07         ` Herbert Xu
2004-11-18 22:16           ` David Stevens
2004-11-18 23:40             ` Herbert Xu
2004-11-18 23:49             ` Chad N. Tindel
2004-11-18 23:56               ` David Stevens
2004-11-19  1:26                 ` Herbert Xu
2004-11-19 21:01       ` Chad N. Tindel
2004-11-19 14:27     ` Henrik Nordstrom
2004-11-09 21:11 ` akepner
2004-11-09 22:41   ` Chad N. Tindel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.