diff options
| author | Eric Dumazet <edumazet@google.com> | 2015-11-29 19:37:57 -0800 |
|---|---|---|
| committer | Luis Henriques <luis.henriques@canonical.com> | 2015-12-18 16:06:24 +0000 |
| commit | 93d2f2509b98181f3f0630ae3a5a45e8ddcd75a3 (patch) | |
| tree | 2e0ab6cd039cef0d30712c31e0b7753e7a15697e /include/linux/ipv6.h | |
| parent | 6aba289f4f75f39a459158cd22d3829368c6787b (diff) | |
ipv6: add complete rcu protection around np->opt
commit 45f6fad84cc305103b28d73482b344d7f5b76f39 upstream.
This patch addresses multiple problems :
UDP/RAW sendmsg() need to get a stable struct ipv6_txoptions
while socket is not locked : Other threads can change np->opt
concurrently. Dmitry posted a syzkaller
(http://github.com/google/syzkaller) program desmonstrating
use-after-free.
Starting with TCP/DCCP lockless listeners, tcp_v6_syn_recv_sock()
and dccp_v6_request_recv_sock() also need to use RCU protection
to dereference np->opt once (before calling ipv6_dup_options())
This patch adds full RCU protection to np->opt
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Diffstat (limited to 'include/linux/ipv6.h')
| -rw-r--r-- | include/linux/ipv6.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index 2faef339d8f2..f3d5d11b8871 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h @@ -210,7 +210,7 @@ struct ipv6_pinfo { struct ipv6_ac_socklist *ipv6_ac_list; struct ipv6_fl_socklist __rcu *ipv6_fl_list; - struct ipv6_txoptions *opt; + struct ipv6_txoptions __rcu *opt; struct sk_buff *pktoptions; struct sk_buff *rxpmtu; struct { |
