aboutsummaryrefslogtreecommitdiffstats
path: root/security/selinux/hooks.c
diff options
context:
space:
mode:
authorDave Kleikamp <shaggy@austin.ibm.com>2005-08-04 16:56:15 -0400
committerDave Kleikamp <shaggy@austin.ibm.com>2005-08-04 16:56:15 -0400
commita5c96cab8f3c4ca9b2177dceb5de5a0edb31418e (patch)
tree45692a1b3d770f721f4586ad81c206f1b8509b75 /security/selinux/hooks.c
parent30db1ae8640d3527ca7ac8df4bcbf14ccc6ae9cd (diff)
parent1c5ad84516ae7ea4ec868436a910a6bd8d20215a (diff)
Merge with /home/shaggy/git/linus-clean/
Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com>
Diffstat (limited to 'security/selinux/hooks.c')
-rw-r--r--security/selinux/hooks.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 6be273851144..2253f388234f 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -826,7 +826,8 @@ static int inode_doinit_with_dentry(struct inode *inode, struct dentry *opt_dent
826 sid = sbsec->def_sid; 826 sid = sbsec->def_sid;
827 rc = 0; 827 rc = 0;
828 } else { 828 } else {
829 rc = security_context_to_sid(context, rc, &sid); 829 rc = security_context_to_sid_default(context, rc, &sid,
830 sbsec->def_sid);
830 if (rc) { 831 if (rc) {
831 printk(KERN_WARNING "%s: context_to_sid(%s) " 832 printk(KERN_WARNING "%s: context_to_sid(%s) "
832 "returned %d for dev=%s ino=%ld\n", 833 "returned %d for dev=%s ino=%ld\n",
@@ -3125,12 +3126,12 @@ static int selinux_socket_connect(struct socket *sock, struct sockaddr *address,
3125 3126
3126 if (sk->sk_family == PF_INET) { 3127 if (sk->sk_family == PF_INET) {
3127 addr4 = (struct sockaddr_in *)address; 3128 addr4 = (struct sockaddr_in *)address;
3128 if (addrlen != sizeof(struct sockaddr_in)) 3129 if (addrlen < sizeof(struct sockaddr_in))
3129 return -EINVAL; 3130 return -EINVAL;
3130 snum = ntohs(addr4->sin_port); 3131 snum = ntohs(addr4->sin_port);
3131 } else { 3132 } else {
3132 addr6 = (struct sockaddr_in6 *)address; 3133 addr6 = (struct sockaddr_in6 *)address;
3133 if (addrlen != sizeof(struct sockaddr_in6)) 3134 if (addrlen < SIN6_LEN_RFC2133)
3134 return -EINVAL; 3135 return -EINVAL;
3135 snum = ntohs(addr6->sin6_port); 3136 snum = ntohs(addr6->sin6_port);
3136 } 3137 }