Commit f533ba4b authored by Stephen D. Smalley's avatar Stephen D. Smalley Committed by Hideaki Yoshifuji

[SELINUX]: Fix bugs introduced by skb_header_pointer() changes.

Lines assigning initial value to 'ret' were removed
erroneously.
Signed-off-by: default avatarStephen Smalley <sds@epoch.ncsc.mil>
Signed-off-by: default avatarDavid S. Miller <davem@redhat.com>
parent 646f6d4e
...@@ -2822,7 +2822,7 @@ static void selinux_task_to_inode(struct task_struct *p, ...@@ -2822,7 +2822,7 @@ static void selinux_task_to_inode(struct task_struct *p,
/* Returns error only if unable to parse addresses */ /* Returns error only if unable to parse addresses */
static int selinux_parse_skb_ipv4(struct sk_buff *skb, struct avc_audit_data *ad) static int selinux_parse_skb_ipv4(struct sk_buff *skb, struct avc_audit_data *ad)
{ {
int offset, ihlen, ret; int offset, ihlen, ret = -EINVAL;
struct iphdr _iph, *ih; struct iphdr _iph, *ih;
offset = skb->nh.raw - skb->data; offset = skb->nh.raw - skb->data;
...@@ -2836,6 +2836,7 @@ static int selinux_parse_skb_ipv4(struct sk_buff *skb, struct avc_audit_data *ad ...@@ -2836,6 +2836,7 @@ static int selinux_parse_skb_ipv4(struct sk_buff *skb, struct avc_audit_data *ad
ad->u.net.v4info.saddr = ih->saddr; ad->u.net.v4info.saddr = ih->saddr;
ad->u.net.v4info.daddr = ih->daddr; ad->u.net.v4info.daddr = ih->daddr;
ret = 0;
switch (ih->protocol) { switch (ih->protocol) {
case IPPROTO_TCP: { case IPPROTO_TCP: {
...@@ -2883,7 +2884,7 @@ static int selinux_parse_skb_ipv4(struct sk_buff *skb, struct avc_audit_data *ad ...@@ -2883,7 +2884,7 @@ static int selinux_parse_skb_ipv4(struct sk_buff *skb, struct avc_audit_data *ad
static int selinux_parse_skb_ipv6(struct sk_buff *skb, struct avc_audit_data *ad) static int selinux_parse_skb_ipv6(struct sk_buff *skb, struct avc_audit_data *ad)
{ {
u8 nexthdr; u8 nexthdr;
int ret, offset; int ret = -EINVAL, offset;
struct ipv6hdr _ipv6h, *ip6; struct ipv6hdr _ipv6h, *ip6;
offset = skb->nh.raw - skb->data; offset = skb->nh.raw - skb->data;
...@@ -2893,6 +2894,7 @@ static int selinux_parse_skb_ipv6(struct sk_buff *skb, struct avc_audit_data *ad ...@@ -2893,6 +2894,7 @@ static int selinux_parse_skb_ipv6(struct sk_buff *skb, struct avc_audit_data *ad
ipv6_addr_copy(&ad->u.net.v6info.saddr, &ip6->saddr); ipv6_addr_copy(&ad->u.net.v6info.saddr, &ip6->saddr);
ipv6_addr_copy(&ad->u.net.v6info.daddr, &ip6->daddr); ipv6_addr_copy(&ad->u.net.v6info.daddr, &ip6->daddr);
ret = 0;
nexthdr = ip6->nexthdr; nexthdr = ip6->nexthdr;
offset += sizeof(_ipv6h); offset += sizeof(_ipv6h);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment