Merge branch 'next' into for-linus
This commit is contained in:
@@ -2961,6 +2961,8 @@ static void dev_change_rx_flags(struct net_device *dev, int flags)
|
||||
static int __dev_set_promiscuity(struct net_device *dev, int inc)
|
||||
{
|
||||
unsigned short old_flags = dev->flags;
|
||||
uid_t uid;
|
||||
gid_t gid;
|
||||
|
||||
ASSERT_RTNL();
|
||||
|
||||
@@ -2985,15 +2987,17 @@ static int __dev_set_promiscuity(struct net_device *dev, int inc)
|
||||
printk(KERN_INFO "device %s %s promiscuous mode\n",
|
||||
dev->name, (dev->flags & IFF_PROMISC) ? "entered" :
|
||||
"left");
|
||||
if (audit_enabled)
|
||||
if (audit_enabled) {
|
||||
current_uid_gid(&uid, &gid);
|
||||
audit_log(current->audit_context, GFP_ATOMIC,
|
||||
AUDIT_ANOM_PROMISCUOUS,
|
||||
"dev=%s prom=%d old_prom=%d auid=%u uid=%u gid=%u ses=%u",
|
||||
dev->name, (dev->flags & IFF_PROMISC),
|
||||
(old_flags & IFF_PROMISC),
|
||||
audit_get_loginuid(current),
|
||||
current->uid, current->gid,
|
||||
uid, gid,
|
||||
audit_get_sessionid(current));
|
||||
}
|
||||
|
||||
dev_change_rx_flags(dev, IFF_PROMISC);
|
||||
}
|
||||
|
@@ -44,11 +44,13 @@
|
||||
|
||||
static __inline__ int scm_check_creds(struct ucred *creds)
|
||||
{
|
||||
const struct cred *cred = current_cred();
|
||||
|
||||
if ((creds->pid == task_tgid_vnr(current) || capable(CAP_SYS_ADMIN)) &&
|
||||
((creds->uid == current->uid || creds->uid == current->euid ||
|
||||
creds->uid == current->suid) || capable(CAP_SETUID)) &&
|
||||
((creds->gid == current->gid || creds->gid == current->egid ||
|
||||
creds->gid == current->sgid) || capable(CAP_SETGID))) {
|
||||
((creds->uid == cred->uid || creds->uid == cred->euid ||
|
||||
creds->uid == cred->suid) || capable(CAP_SETUID)) &&
|
||||
((creds->gid == cred->gid || creds->gid == cred->egid ||
|
||||
creds->gid == cred->sgid) || capable(CAP_SETGID))) {
|
||||
return 0;
|
||||
}
|
||||
return -EPERM;
|
||||
|
Reference in New Issue
Block a user