aboutsummaryrefslogtreecommitdiffstats
path: root/security/selinux/hooks.c
diff options
context:
space:
mode:
Diffstat (limited to 'security/selinux/hooks.c')
-rw-r--r--security/selinux/hooks.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 195906bce266..1e8cfc4c2ed6 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -1285,6 +1285,8 @@ static int inode_doinit_with_dentry(struct inode *inode, struct dentry *opt_dent
1285 rc = inode->i_op->getxattr(dentry, XATTR_NAME_SELINUX, 1285 rc = inode->i_op->getxattr(dentry, XATTR_NAME_SELINUX,
1286 context, len); 1286 context, len);
1287 if (rc == -ERANGE) { 1287 if (rc == -ERANGE) {
1288 kfree(context);
1289
1288 /* Need a larger buffer. Query for the right size. */ 1290 /* Need a larger buffer. Query for the right size. */
1289 rc = inode->i_op->getxattr(dentry, XATTR_NAME_SELINUX, 1291 rc = inode->i_op->getxattr(dentry, XATTR_NAME_SELINUX,
1290 NULL, 0); 1292 NULL, 0);
@@ -1292,7 +1294,6 @@ static int inode_doinit_with_dentry(struct inode *inode, struct dentry *opt_dent
1292 dput(dentry); 1294 dput(dentry);
1293 goto out_unlock; 1295 goto out_unlock;
1294 } 1296 }
1295 kfree(context);
1296 len = rc; 1297 len = rc;
1297 context = kmalloc(len+1, GFP_NOFS); 1298 context = kmalloc(len+1, GFP_NOFS);
1298 if (!context) { 1299 if (!context) {
@@ -4495,7 +4496,7 @@ static unsigned int selinux_ip_postroute(struct sk_buff *skb, int ifindex,
4495 * when the packet is on it's final way out. 4496 * when the packet is on it's final way out.
4496 * NOTE: there appear to be some IPv6 multicast cases where skb->dst 4497 * NOTE: there appear to be some IPv6 multicast cases where skb->dst
4497 * is NULL, in this case go ahead and apply access control. */ 4498 * is NULL, in this case go ahead and apply access control. */
4498 if (skb->dst != NULL && skb->dst->xfrm != NULL) 4499 if (skb_dst(skb) != NULL && skb_dst(skb)->xfrm != NULL)
4499 return NF_ACCEPT; 4500 return NF_ACCEPT;
4500#endif 4501#endif
4501 secmark_active = selinux_secmark_enabled(); 4502 secmark_active = selinux_secmark_enabled();