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
..
2011-04-22 11:04:14 -07:00
2011-04-22 11:04:14 -07:00
2011-03-12 15:08:49 -08:00
2010-10-25 13:09:45 -07:00
2011-04-28 13:16:35 -07:00
2011-04-12 13:58:33 -07:00
2011-03-31 11:26:23 -03:00
2011-04-22 11:04:14 -07:00
2011-04-22 11:04:14 -07:00
2011-02-01 15:35:25 -08:00
2011-02-01 15:35:25 -08:00
2011-04-28 13:16:35 -07:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2010-10-27 11:37:32 -07:00
2011-04-28 13:16:35 -07:00
2010-07-12 12:57:54 -07:00