Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 314647
b: refs/heads/master
c: 01f534d
h: refs/heads/master
i:
  314645: b2ed34c
  314643: 1d831c1
  314639: 5103cff
v: v3
  • Loading branch information
David S. Miller committed Jun 27, 2012
1 parent def4fba commit 6357e05
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 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: b61bb01974730e2fd7d36ab4cc848ca6f44cffd4
refs/heads/master: 01f534d0ae9d7b3ad4dcd943d53418731da82ea7
11 changes: 7 additions & 4 deletions trunk/security/selinux/netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <linux/netlink.h>
#include <linux/selinux_netlink.h>
#include <net/net_namespace.h>
#include <net/netlink.h>

#include "security.h"

Expand Down Expand Up @@ -47,15 +48,15 @@ static void selnl_add_payload(struct nlmsghdr *nlh, int len, int msgtype, void *
{
switch (msgtype) {
case SELNL_MSG_SETENFORCE: {
struct selnl_msg_setenforce *msg = NLMSG_DATA(nlh);
struct selnl_msg_setenforce *msg = nlmsg_data(nlh);

memset(msg, 0, len);
msg->val = *((int *)data);
break;
}

case SELNL_MSG_POLICYLOAD: {
struct selnl_msg_policyload *msg = NLMSG_DATA(nlh);
struct selnl_msg_policyload *msg = nlmsg_data(nlh);

memset(msg, 0, len);
msg->seqno = *((u32 *)data);
Expand All @@ -81,15 +82,17 @@ static void selnl_notify(int msgtype, void *data)
goto oom;

tmp = skb->tail;
nlh = NLMSG_PUT(skb, 0, 0, msgtype, len);
nlh = nlmsg_put(skb, 0, 0, msgtype, len, 0);
if (!nlh)
goto out_kfree_skb;
selnl_add_payload(nlh, len, msgtype, data);
nlh->nlmsg_len = skb->tail - tmp;
NETLINK_CB(skb).dst_group = SELNLGRP_AVC;
netlink_broadcast(selnl, skb, 0, SELNLGRP_AVC, GFP_USER);
out:
return;

nlmsg_failure:
out_kfree_skb:
kfree_skb(skb);
oom:
printk(KERN_ERR "SELinux: OOM in %s\n", __func__);
Expand Down

0 comments on commit 6357e05

Please sign in to comment.