From f533ba4bb605195dca5ca1b312dc834e25fd4dc5 Mon Sep 17 00:00:00 2001 From: "Stephen D. Smalley" Date: Mon, 23 Aug 2004 21:35:14 -0700 Subject: [PATCH] [SELINUX]: Fix bugs introduced by skb_header_pointer() changes. Lines assigning initial value to 'ret' were removed erroneously. Signed-off-by: Stephen Smalley Signed-off-by: David S. Miller --- security/selinux/hooks.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 587d63bd68610..36d93745eb2a1 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -2822,7 +2822,7 @@ static void selinux_task_to_inode(struct task_struct *p, /* Returns error only if unable to parse addresses */ 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; 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 ad->u.net.v4info.saddr = ih->saddr; ad->u.net.v4info.daddr = ih->daddr; + ret = 0; switch (ih->protocol) { case IPPROTO_TCP: { @@ -2883,7 +2884,7 @@ out: static int selinux_parse_skb_ipv6(struct sk_buff *skb, struct avc_audit_data *ad) { u8 nexthdr; - int ret, offset; + int ret = -EINVAL, offset; struct ipv6hdr _ipv6h, *ip6; 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 ipv6_addr_copy(&ad->u.net.v6info.saddr, &ip6->saddr); ipv6_addr_copy(&ad->u.net.v6info.daddr, &ip6->daddr); + ret = 0; nexthdr = ip6->nexthdr; offset += sizeof(_ipv6h); -- 2.53.0