subashab@codeaurora.org fc752f1f43 ping: Fix race in free in receive path
An exception is seen in ICMP ping receive path where the skb
destructor sock_rfree() tries to access a freed socket. This happens
because ping_rcv() releases socket reference with sock_put() and this
internally frees up the socket. Later icmp_rcv() will try to free the
skb and as part of this, skb destructor is called and which leads
to a kernel panic as the socket is freed already in ping_rcv().

-->|exception
-007|sk_mem_uncharge
-007|sock_rfree
-008|skb_release_head_state
-009|skb_release_all
-009|__kfree_skb
-010|kfree_skb
-011|icmp_rcv
-012|ip_local_deliver_finish

Fix this incorrect free by cloning this skb and processing this cloned
skb instead.

This patch was suggested by Eric Dumazet

Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Cc: Eric Dumazet <edumazet@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-01-27 00:04:53 -08:00
..
2014-10-15 10:25:04 +10:30
2014-11-24 04:28:48 -05:00
2014-12-09 16:29:03 -05:00
2014-11-24 04:28:48 -05:00
2014-12-09 16:29:03 -05:00
2014-12-07 21:22:05 +01:00
2015-01-16 01:02:42 -05:00
2014-11-24 04:28:51 -05:00
2015-01-25 16:00:54 -08:00
2015-01-25 22:09:51 -08:00
2014-11-24 04:28:48 -05:00
2014-10-09 01:40:05 -04:00
2014-11-24 04:28:48 -05:00
2014-11-24 04:28:48 -05:00
2014-12-14 16:10:09 -08:00
2014-11-24 04:28:48 -05:00
2014-12-09 16:29:03 -05:00
2014-12-09 16:29:03 -05:00
2014-10-07 20:28:44 -04:00
2014-11-24 04:28:48 -05:00
2014-12-09 16:29:03 -05:00
2014-12-19 07:13:21 -05:00