Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e1ba8be6 authored by Subash Abhinov Kasiviswanathan's avatar Subash Abhinov Kasiviswanathan
Browse files

net: Copy ndisc_nodetype from original skb in skb_clone



skb_clone does not copy all fields from original skb. Fields
which are uninitialized may cause unexpected behavior when they
are passed down to network stack. In case ndisc_nodetype is set
to a random value for a router advertisement, kernel looks at this
field and drops it assuming that this packet originates from a
node and not a router.

Fix this by copying the ndisc_nodetype from the original skb
rather than relying on an uninitialized cloned skb.

CRs-Fixed: 2233026
Change-Id: I9686e31808c94a3bbf309007f521c0e06bac2e96
Signed-off-by: default avatarSubash Abhinov Kasiviswanathan <subashab@codeaurora.org>
parent 8b7fffb4
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -870,6 +870,10 @@ static struct sk_buff *__skb_clone(struct sk_buff *n, struct sk_buff *skb)
	atomic_inc(&(skb_shinfo(skb)->dataref));
	skb->cloned = 1;

#ifdef CONFIG_IPV6_NDISC_NODETYPE
	C(ndisc_nodetype);
#endif

	return n;
#undef C
}