aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/dev.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2008-11-13 18:39:10 -0500
committerJames Morris <jmorris@namei.org>2008-11-13 18:39:10 -0500
commit8192b0c482d7078fcdcb4854341b977426f6f09b (patch)
tree6ab545ac9adff7fdc994c7b120b1c9d0915dd62e /net/core/dev.c
parent19d65624d38d6296dddf725d1b03baa8a491a553 (diff)
CRED: Wrap task credential accesses in the networking subsystem
Wrap access to task credentials so that they can be separated more easily from the task_struct during the introduction of COW creds. Change most current->(|e|s|fs)[ug]id to current_(|e|s|fs)[ug]id(). Change some task->e?[ug]id to task_e?[ug]id(). In some places it makes more sense to use RCU directly rather than a convenient wrapper; these will be addressed by later patches. Signed-off-by: David Howells <dhowells@redhat.com> Reviewed-by: James Morris <jmorris@namei.org> Acked-by: Serge Hallyn <serue@us.ibm.com> Cc: netdev@vger.kernel.org Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r--net/core/dev.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index d9038e328cc1..262df226b3c9 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2958,6 +2958,8 @@ static void dev_change_rx_flags(struct net_device *dev, int flags)
2958static int __dev_set_promiscuity(struct net_device *dev, int inc) 2958static int __dev_set_promiscuity(struct net_device *dev, int inc)
2959{ 2959{
2960 unsigned short old_flags = dev->flags; 2960 unsigned short old_flags = dev->flags;
2961 uid_t uid;
2962 gid_t gid;
2961 2963
2962 ASSERT_RTNL(); 2964 ASSERT_RTNL();
2963 2965
@@ -2982,15 +2984,17 @@ static int __dev_set_promiscuity(struct net_device *dev, int inc)
2982 printk(KERN_INFO "device %s %s promiscuous mode\n", 2984 printk(KERN_INFO "device %s %s promiscuous mode\n",
2983 dev->name, (dev->flags & IFF_PROMISC) ? "entered" : 2985 dev->name, (dev->flags & IFF_PROMISC) ? "entered" :
2984 "left"); 2986 "left");
2985 if (audit_enabled) 2987 if (audit_enabled) {
2988 current_uid_gid(&uid, &gid);
2986 audit_log(current->audit_context, GFP_ATOMIC, 2989 audit_log(current->audit_context, GFP_ATOMIC,
2987 AUDIT_ANOM_PROMISCUOUS, 2990 AUDIT_ANOM_PROMISCUOUS,
2988 "dev=%s prom=%d old_prom=%d auid=%u uid=%u gid=%u ses=%u", 2991 "dev=%s prom=%d old_prom=%d auid=%u uid=%u gid=%u ses=%u",
2989 dev->name, (dev->flags & IFF_PROMISC), 2992 dev->name, (dev->flags & IFF_PROMISC),
2990 (old_flags & IFF_PROMISC), 2993 (old_flags & IFF_PROMISC),
2991 audit_get_loginuid(current), 2994 audit_get_loginuid(current),
2992 current->uid, current->gid, 2995 uid, gid,
2993 audit_get_sessionid(current)); 2996 audit_get_sessionid(current));
2997 }
2994 2998
2995 dev_change_rx_flags(dev, IFF_PROMISC); 2999 dev_change_rx_flags(dev, IFF_PROMISC);
2996 } 3000 }