summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorMarc Dionne <marc.dionne@auristor.com>2019-04-12 17:33:40 +0200
committerDavid S. Miller <davem@davemloft.net>2019-04-13 01:57:23 +0200
commit56d282d9db19f85f759b7a81f0829b58c00571b0 (patch)
treeb4b3bb72d318d8eff5abb5f8707d3adfcc37f106 /net
parentqede: fix write to free'd pointer error and double free of ptp (diff)
downloadlinux-56d282d9db19f85f759b7a81f0829b58c00571b0.tar.xz
linux-56d282d9db19f85f759b7a81f0829b58c00571b0.zip
rxrpc: Clear socket error
When an ICMP or ICMPV6 error is received, the error will be attached to the socket (sk_err) and the report function will get called. Clear any pending error here by calling sock_error(). This would cause the following attempt to use the socket to fail with the error code stored by the ICMP error, resulting in unexpected errors with various side effects depending on the context. Signed-off-by: Marc Dionne <marc.dionne@auristor.com> Signed-off-by: David Howells <dhowells@redhat.com> Tested-by: Jonathan Billings <jsbillin@umich.edu> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/rxrpc/peer_event.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/rxrpc/peer_event.c b/net/rxrpc/peer_event.c
index bc05af89fc38..6e84d878053c 100644
--- a/net/rxrpc/peer_event.c
+++ b/net/rxrpc/peer_event.c
@@ -157,6 +157,11 @@ void rxrpc_error_report(struct sock *sk)
_enter("%p{%d}", sk, local->debug_id);
+ /* Clear the outstanding error value on the socket so that it doesn't
+ * cause kernel_sendmsg() to return it later.
+ */
+ sock_error(sk);
+
skb = sock_dequeue_err_skb(sk);
if (!skb) {
_leave("UDP socket errqueue empty");