android_kernel_xiaomi_sm7250/net/l2tp
Eric Dumazet f6d8bd051c inet: add RCU protection to inet->opt
We lack proper synchronization to manipulate inet->opt ip_options

Problem is ip_make_skb() calls ip_setup_cork() and
ip_setup_cork() possibly makes a copy of ipc->opt (struct ip_options),
without any protection against another thread manipulating inet->opt.

Another thread can change inet->opt pointer and free old one under us.

Use RCU to protect inet->opt (changed to inet->inet_opt).

Instead of handling atomic refcounts, just copy ip_options when
necessary, to avoid cache line dirtying.

We cant insert an rcu_head in struct ip_options since its included in
skb->cb[], so this patch is large because I had to introduce a new
ip_options_rcu structure.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-04-28 13:16:35 -07:00
..
Kconfig l2tp: Add debugfs files for dumping l2tp debug info 2010-04-03 14:56:07 -07:00
l2tp_core.c l2tp: static functions should not be exported 2010-10-24 22:26:41 -07:00
l2tp_core.h l2tp: make local function static 2010-10-24 14:55:47 -07:00
l2tp_debugfs.c l2tp: kzalloc with swapped params in l2tp_dfs_seq_open 2010-11-01 06:56:02 -07:00
l2tp_eth.c l2tp: fix possible oops on l2tp_eth module unload 2011-03-21 18:10:25 -07:00
l2tp_ip.c inet: add RCU protection to inet->opt 2011-04-28 13:16:35 -07:00
l2tp_netlink.c l2tp: Fix set-but-unused variables. 2011-04-17 17:01:05 -07:00
l2tp_ppp.c net: constify some ppp/pptp structs 2010-09-21 18:04:47 -07:00
Makefile l2tp: Add debugfs files for dumping l2tp debug info 2010-04-03 14:56:07 -07:00