android_kernel_google_msm/net/dccp
Eric Dumazet d5127daf88 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

BUG: 28746669

Change-Id: I207da29ac48bb6dd7c40d65f9e27c4e3ff508da0
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: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Pierre Imai <imaipi@google.com>
2016-06-17 02:54:32 +00:00
..
ccids dccp ccid-3: replace incorrect BUG_ON 2012-03-03 09:02:36 -07:00
ackvec.c net: Add export.h for EXPORT_SYMBOL/THIS_MODULE to non-modules 2011-10-31 19:30:30 -04:00
ackvec.h dccp ccid-2: Separate option parsing from CCID processing 2010-11-15 07:12:01 +01:00
ccid.c dccp: cosmetics of info message 2011-07-04 12:37:13 -06:00
ccid.h dccp: Return-value convention of hc_tx_send_packet() 2010-10-28 10:27:00 -07:00
dccp.h module_param: make bool parameters really bool (net & drivers/net) 2011-12-19 22:27:29 -05:00
diag.c inet_diag: Rename inet_diag_req into inet_diag_req_v2 2012-01-11 12:56:06 -08:00
feat.c net: fix assignment of 0/1 to bool variables. 2011-12-19 22:27:29 -05:00
feat.h dccp: support for the exchange of NN options in established state 1/2 2011-08-01 07:52:34 -06:00
input.c dccp: Clean up slow-path input processing 2011-07-04 12:36:33 -06:00
ipv4.c dccp: fix bug in sequence number validation during connection setup 2012-03-03 09:02:52 -07:00
ipv6.c ipv6: add complete rcu protection around np->opt 2016-06-17 02:54:32 +00:00
ipv6.h
Kconfig Docs/Kconfig: Update: osdl.org -> linuxfoundation.org 2010-11-15 23:50:13 +01:00
Makefile dccp: Policy-based packet dequeueing infrastructure 2010-12-07 13:47:12 +01:00
minisocks.c dccp: fix bug in sequence number validation during connection setup 2012-03-03 09:02:52 -07:00
options.c net: fix assignment of 0/1 to bool variables. 2011-12-19 22:27:29 -05:00
output.c dccp: fix bug in sequence number validation during connection setup 2012-03-03 09:02:52 -07:00
probe.c dccp: Fix compile warning in probe code. 2011-12-01 14:45:49 -05:00
proto.c module_param: make bool parameters really bool (net & drivers/net) 2011-12-19 22:27:29 -05:00
qpolicy.c dccp qpolicy: Parameter checking of cmsg qpolicy parameters 2010-12-07 13:47:12 +01:00
sysctl.c dccp: make upper bound for seq_window consistent on 32/64 bit 2011-01-07 12:22:44 +01:00
timer.c net: Add export.h for EXPORT_SYMBOL/THIS_MODULE to non-modules 2011-10-31 19:30:30 -04:00