diff options
author | Hong zhi guo <honkiko@gmail.com> | 2013-03-27 02:49:35 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-03-28 14:25:49 -0400 |
commit | 77954983ad76e4f10cee8d2e06fcd085fae11780 (patch) | |
tree | 71bdf43c7d6954818718606c4b6ed09ff4cdf91a /security/selinux | |
parent | 941912133025926307c7a65b203fa38403b1063a (diff) |
selinux: replace obsolete NLMSG_* with type safe nlmsg_*
Signed-off-by: Hong Zhiguo <honkiko@gmail.com>
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'security/selinux')
-rw-r--r-- | security/selinux/hooks.c | 4 | ||||
-rw-r--r-- | security/selinux/netlink.c | 3 |
2 files changed, 3 insertions, 4 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 2fa28c88900c..0a0609fce28b 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c | |||
@@ -60,7 +60,7 @@ | |||
60 | #include <linux/bitops.h> | 60 | #include <linux/bitops.h> |
61 | #include <linux/interrupt.h> | 61 | #include <linux/interrupt.h> |
62 | #include <linux/netdevice.h> /* for network interface checks */ | 62 | #include <linux/netdevice.h> /* for network interface checks */ |
63 | #include <linux/netlink.h> | 63 | #include <net/netlink.h> |
64 | #include <linux/tcp.h> | 64 | #include <linux/tcp.h> |
65 | #include <linux/udp.h> | 65 | #include <linux/udp.h> |
66 | #include <linux/dccp.h> | 66 | #include <linux/dccp.h> |
@@ -4475,7 +4475,7 @@ static int selinux_nlmsg_perm(struct sock *sk, struct sk_buff *skb) | |||
4475 | struct nlmsghdr *nlh; | 4475 | struct nlmsghdr *nlh; |
4476 | struct sk_security_struct *sksec = sk->sk_security; | 4476 | struct sk_security_struct *sksec = sk->sk_security; |
4477 | 4477 | ||
4478 | if (skb->len < NLMSG_SPACE(0)) { | 4478 | if (skb->len < NLMSG_HDRLEN) { |
4479 | err = -EINVAL; | 4479 | err = -EINVAL; |
4480 | goto out; | 4480 | goto out; |
4481 | } | 4481 | } |
diff --git a/security/selinux/netlink.c b/security/selinux/netlink.c index 14d810ead420..828fb6a4e941 100644 --- a/security/selinux/netlink.c +++ b/security/selinux/netlink.c | |||
@@ -16,7 +16,6 @@ | |||
16 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
17 | #include <linux/export.h> | 17 | #include <linux/export.h> |
18 | #include <linux/skbuff.h> | 18 | #include <linux/skbuff.h> |
19 | #include <linux/netlink.h> | ||
20 | #include <linux/selinux_netlink.h> | 19 | #include <linux/selinux_netlink.h> |
21 | #include <net/net_namespace.h> | 20 | #include <net/net_namespace.h> |
22 | #include <net/netlink.h> | 21 | #include <net/netlink.h> |
@@ -77,7 +76,7 @@ static void selnl_notify(int msgtype, void *data) | |||
77 | 76 | ||
78 | len = selnl_msglen(msgtype); | 77 | len = selnl_msglen(msgtype); |
79 | 78 | ||
80 | skb = alloc_skb(NLMSG_SPACE(len), GFP_USER); | 79 | skb = nlmsg_new(len, GFP_USER); |
81 | if (!skb) | 80 | if (!skb) |
82 | goto oom; | 81 | goto oom; |
83 | 82 | ||