userns: Convert net/core/scm.c to use kuids and kgids
authorEric W. Biederman <ebiederm@xmission.com>
Wed, 23 May 2012 22:39:45 +0000 (16:39 -0600)
committerEric W. Biederman <ebiederm@xmission.com>
Wed, 15 Aug 2012 04:41:58 +0000 (21:41 -0700)
commitb2e4f544fddc812d6fe802bab5f600b4b783f45d
tree4b17b92fc11ff292a8c683217e8027c2d3fee09e
parent81abe27b10af98f861c955be63da700938dd59c1
userns: Convert net/core/scm.c to use kuids and kgids

With the existence of kuid_t and kgid_t we can take this further
and remove the usage of struct cred altogether, ensuring we
don't get cache line misses from reference counts.   For now
however start simply and do a straight forward conversion
I can be certain is correct.

In cred_to_ucred use from_kuid_munged and from_kgid_munged
as these values are going directly to userspace and we want to use
the userspace safe values not -1 when reporting a value that does not
map.  The earlier conversion that used from_kuid was buggy in that
respect.  Oops.

Cc: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: David S. Miller <davem@davemloft.net>
Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
net/core/scm.c
net/core/sock.c