Files
kernel_arpi/include/linux
Pablo Neira 3a36515f72 netlink: fix splat in skb_clone with large messages
Since (c05cdb1 netlink: allow large data transfers from user-space),
netlink splats if it invokes skb_clone on large netlink skbs since:

* skb_shared_info was not correctly initialized.
* skb->destructor is not set in the cloned skb.

This was spotted by trinity:

[  894.990671] BUG: unable to handle kernel paging request at ffffc9000047b001
[  894.991034] IP: [<ffffffff81a212c4>] skb_clone+0x24/0xc0
[...]
[  894.991034] Call Trace:
[  894.991034]  [<ffffffff81ad299a>] nl_fib_input+0x6a/0x240
[  894.991034]  [<ffffffff81c3b7e6>] ? _raw_read_unlock+0x26/0x40
[  894.991034]  [<ffffffff81a5f189>] netlink_unicast+0x169/0x1e0
[  894.991034]  [<ffffffff81a601e1>] netlink_sendmsg+0x251/0x3d0

Fix it by:

1) introducing a new netlink_skb_clone function that is used in nl_fib_input,
   that sets our special skb->destructor in the cloned skb. Moreover, handle
   the release of the large cloned skb head area in the destructor path.

2) not allowing large skbuffs in the netlink broadcast path. I cannot find
   any reasonable use of the large data transfer using netlink in that path,
   moreover this helps to skip extra skb_clone handling.

I found two more netlink clients that are cloning the skbs, but they are
not in the sendmsg path. Therefore, the sole client cloning that I found
seems to be the fib frontend.

Thanks to Eric Dumazet for helping to address this issue.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-06-27 22:44:16 -07:00
..
2013-05-17 14:31:05 -04:00
2013-06-13 17:51:04 -07:00
2013-06-17 14:38:54 -04:00
2013-05-07 19:46:02 -07:00
2013-04-29 15:40:23 -04:00
2013-05-10 14:37:17 +01:00
2013-05-01 16:36:22 +05:30
2013-05-07 18:38:27 -07:00
2013-04-29 18:28:40 -07:00
2013-05-07 02:16:31 -04:00
2013-05-06 13:07:33 +02:00
2013-06-13 17:51:04 -07:00
2013-04-30 17:04:06 -07:00
2013-05-31 00:48:22 -07:00
2013-04-30 17:04:00 -07:00
2013-05-04 14:47:26 -04:00
2013-04-29 15:54:28 -07:00
2013-05-31 17:19:05 -07:00
2013-04-29 15:54:28 -07:00
2013-05-23 14:23:17 +02:00
2013-06-27 22:29:05 -07:00
2013-04-30 15:50:12 +05:30
2013-04-29 15:54:37 -07:00