diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2015-07-13 16:04:13 +0800 |
---|---|---|
committer | Jiri Slaby <jslaby@suse.cz> | 2015-08-27 09:26:59 +0200 |
commit | 339b0b16eddd5ac63419f0176ef95cc3c917b0f9 (patch) | |
tree | b07a1bd26a02dee78189c9a42ef19c2f8df04f6b /net/dns_resolver | |
parent | d5f8ff935843779207a4100b38b6a43b0bf5cd07 (diff) |
net: Clone skb before setting peeked flag
[ Upstream commit 738ac1ebb96d02e0d23bc320302a6ea94c612dec ]
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 <khlebnikov@yandex-team.ru>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Diffstat (limited to 'net/dns_resolver')
0 files changed, 0 insertions, 0 deletions