ipv6: add complete rcu protection around np->opt
[ Upstream commit 45f6fad84cc305103b28d73482b344d7f5b76f39 ] 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 b/28746669 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> Signed-off-by: Sasha Levin <sasha.levin@oracle.com> Signed-off-by: Dennis Cagle <dcagle@codeaurora.org> Git-commit: 45f6fad84cc305103b28d73482b344d7f5b76f39 Git-repo: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git (cherry picked from commit 46ddb98e2018a5a62cefa75b3c80882850c91e39) Change-Id: Ie893308ab0950d8d5494c090e04b8971940a2549
Loading
Please register or sign in to comment