Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 80885
b: refs/heads/master
c: da5645a
h: refs/heads/master
i:
  80883: c0aa458
v: v3
  • Loading branch information
Paul Moore authored and James Morris committed Jan 29, 2008
1 parent 58cdbb9 commit 0faec0a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e8bfdb9d0dfc1231a6a71e849dfbd4447acdfff6
refs/heads/master: da5645a28a15aed2e541a814ecf9f7ffcd4c4673
15 changes: 12 additions & 3 deletions trunk/security/selinux/avc.c
Original file line number Diff line number Diff line change
Expand Up @@ -661,9 +661,18 @@ void avc_audit(u32 ssid, u32 tsid,
"daddr", "dest");
break;
}
if (a->u.net.netif)
audit_log_format(ab, " netif=%s",
a->u.net.netif);
if (a->u.net.netif > 0) {
struct net_device *dev;

/* NOTE: we always use init's namespace */
dev = dev_get_by_index(&init_net,
a->u.net.netif);
if (dev) {
audit_log_format(ab, " netif=%s",
dev->name);
dev_put(dev);
}
}
break;
}
}
Expand Down
4 changes: 2 additions & 2 deletions trunk/security/selinux/hooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -3928,7 +3928,7 @@ static int selinux_socket_sock_rcv_skb(struct sock *sk, struct sk_buff *skb)
family = PF_INET;

AVC_AUDIT_DATA_INIT(&ad, NET);
ad.u.net.netif = skb->dev ? skb->dev->name : "[unknown]";
ad.u.net.netif = skb->iif;
ad.u.net.family = family;

err = selinux_parse_skb(skb, &ad, &addrp, &len, 1, NULL);
Expand Down Expand Up @@ -4259,7 +4259,7 @@ static unsigned int selinux_ip_postroute_last(unsigned int hooknum,
sksec = sk->sk_security;

AVC_AUDIT_DATA_INIT(&ad, NET);
ad.u.net.netif = dev->name;
ad.u.net.netif = dev->ifindex;
ad.u.net.family = family;

err = selinux_parse_skb(skb, &ad, &addrp, &len, 0, &proto);
Expand Down
2 changes: 1 addition & 1 deletion trunk/security/selinux/include/avc.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ struct avc_audit_data {
struct inode *inode;
} fs;
struct {
char *netif;
int netif;
struct sock *sk;
u16 family;
__be16 dport;
Expand Down

0 comments on commit 0faec0a

Please sign in to comment.