summaryrefslogtreecommitdiff
path: root/net/ipv6/tcp_ipv6.c
diff options
context:
space:
mode:
authorJon Maxwell <jmaxwell37@gmail.com>2017-03-22 11:31:33 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-03-22 11:31:33 +0000
commitdaa1fae0fb67e7a3ce347176cecdba8b0c39c309 (patch)
treee88128593c6ef3789972da8b54815ffbb5d525f9 /net/ipv6/tcp_ipv6.c
parent857b945b132c36d3407e5f47e9944db57e76b484 (diff)
parent4ab956b561334866dfe1b17d9c7567313e07cfa2 (diff)
dccp/tcp: fix routing redirect race
am: 4ab956b561 Change-Id: I9cb352108500198e4d94eb8e08b53065e29e31d4
Diffstat (limited to 'net/ipv6/tcp_ipv6.c')
-rw-r--r--net/ipv6/tcp_ipv6.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index f2652fd91b20..48e3f2f99b95 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -377,10 +377,12 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
np = inet6_sk(sk);
if (type == NDISC_REDIRECT) {
- struct dst_entry *dst = __sk_dst_check(sk, np->dst_cookie);
+ if (!sock_owned_by_user(sk)) {
+ struct dst_entry *dst = __sk_dst_check(sk, np->dst_cookie);
- if (dst)
- dst->ops->redirect(dst, sk, skb);
+ if (dst)
+ dst->ops->redirect(dst, sk, skb);
+ }
goto out;
}