Skip to content

Commit ccfde6e

Browse files
committed
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec
Steffen Klassert says: ==================== pull request (net): ipsec 2018-05-31 1) Avoid possible overflow of the offset variable in _decode_session6(), this fixes an infinite lookp there. From Eric Dumazet. 2) We may use an error pointer in the error path of xfrm_bundle_create(). Fix this by returning this pointer directly to the caller. Please pull or let me know if there are problems. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents a95691b + 38369f5 commit ccfde6e

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

net/ipv6/xfrm6_policy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl, int reverse)
126126
struct flowi6 *fl6 = &fl->u.ip6;
127127
int onlyproto = 0;
128128
const struct ipv6hdr *hdr = ipv6_hdr(skb);
129-
u16 offset = sizeof(*hdr);
129+
u32 offset = sizeof(*hdr);
130130
struct ipv6_opt_hdr *exthdr;
131131
const unsigned char *nh = skb_network_header(skb);
132132
u16 nhoff = IP6CB(skb)->nhoff;

net/xfrm/xfrm_policy.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1658,7 +1658,6 @@ static struct dst_entry *xfrm_bundle_create(struct xfrm_policy *policy,
16581658
trailer_len -= xdst_prev->u.dst.xfrm->props.trailer_len;
16591659
}
16601660

1661-
out:
16621661
return &xdst0->u.dst;
16631662

16641663
put_states:
@@ -1667,8 +1666,8 @@ static struct dst_entry *xfrm_bundle_create(struct xfrm_policy *policy,
16671666
free_dst:
16681667
if (xdst0)
16691668
dst_release_immediate(&xdst0->u.dst);
1670-
xdst0 = ERR_PTR(err);
1671-
goto out;
1669+
1670+
return ERR_PTR(err);
16721671
}
16731672

16741673
static int xfrm_expand_policies(const struct flowi *fl, u16 family,

0 commit comments

Comments
 (0)