From: Herbert Xu Date: Mon, 13 Jul 2015 08:04:13 +0000 (+0800) Subject: net: Clone skb before setting peeked flag X-Git-Tag: omap-for-v4.3/fixes-merge-window~206^2~43 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=738ac1ebb96d;p=pandora-kernel.git net: Clone skb before setting peeked flag Shared skbs must not be modified and this is crucial for broadcast and/or multicast paths where we use it as an optimisation to avoid unnecessary cloning. The function skb_recv_datagram breaks this rule by setting peeked without cloning the skb first. This causes funky races which leads to double-free. This patch fixes this by cloning the skb and replacing the skb in the list when setting skb->peeked. Fixes: a59322be07c9 ("[UDP]: Only increment counter on first peek/recv") Reported-by: Konstantin Khlebnikov Signed-off-by: Herbert Xu Signed-off-by: David S. Miller --- Reading git-diff-tree failed