Wei Yongjun
a454f0ccef
xfrm: Fix initialize repl field of struct xfrm_state
Commit 'xfrm: Move IPsec replay detection functions to a separate file'
(9fdc4883d9)
introduce repl field to struct xfrm_state, and only initialize it
under SA's netlink create path, the other path, such as pf_key,
ipcomp/ipcomp6 etc, the repl field remaining uninitialize. So if
the SA is created by pf_key, any input packet with SA's encryption
algorithm will cause panic.
int xfrm_input()
{
...
x->repl->advance(x, seq);
...
}
This patch fixed it by introduce new function __xfrm_init_state().
Pid: 0, comm: swapper Not tainted 2.6.38-next+ #14 Bochs Bochs
EIP: 0060:[<c078e5d5>] EFLAGS: 00010206 CPU: 0
EIP is at xfrm_input+0x31c/0x4cc
EAX: dd839c00 EBX: 00000084 ECX: 00000000 EDX: 01000000
ESI: dd839c00 EDI: de3a0780 EBP: dec1de88 ESP: dec1de64
DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
Process swapper (pid: 0, ti=dec1c000 task=c09c0f20 task.ti=c0992000)
Stack:
00000000 00000000 00000002 c0ba27c0 00100000 01000000 de3a0798 c0ba27c0
00000033 dec1de98 c0786848 00000000 de3a0780 dec1dea4 c0786868 00000000
dec1debc c074ee56 e1da6b8c de3a0780 c074ed44 de3a07a8 dec1decc c074ef32
Call Trace:
[<c0786848>] xfrm4_rcv_encap+0x22/0x27
[<c0786868>] xfrm4_rcv+0x1b/0x1d
[<c074ee56>] ip_local_deliver_finish+0x112/0x1b1
[<c074ed44>] ? ip_local_deliver_finish+0x0/0x1b1
[<c074ef32>] NF_HOOK.clone.1+0x3d/0x44
[<c074ef77>] ip_local_deliver+0x3e/0x44
[<c074ed44>] ? ip_local_deliver_finish+0x0/0x1b1
[<c074ec03>] ip_rcv_finish+0x30a/0x332
[<c074e8f9>] ? ip_rcv_finish+0x0/0x332
[<c074ef32>] NF_HOOK.clone.1+0x3d/0x44
[<c074f188>] ip_rcv+0x20b/0x247
[<c074e8f9>] ? ip_rcv_finish+0x0/0x332
[<c072797d>] __netif_receive_skb+0x373/0x399
[<c0727bc1>] netif_receive_skb+0x4b/0x51
[<e0817e2a>] cp_rx_poll+0x210/0x2c4 [8139cp]
[<c072818f>] net_rx_action+0x9a/0x17d
[<c0445b5c>] __do_softirq+0xa1/0x149
[<c0445abb>] ? __do_softirq+0x0/0x149
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-03-21 18:08:28 -07:00
..
2011-03-15 09:57:38 -05:00
2011-02-27 16:56:41 -03:00
2010-11-15 11:07:16 -08:00
2011-02-17 11:59:56 -08:00
2010-03-30 22:02:32 +09:00
2011-02-19 19:17:35 -08:00
2011-03-15 09:36:50 +09:00
2011-03-09 11:59:32 -08:00
2011-01-19 20:25:45 -08:00
2010-08-20 01:42:59 -07:00
2010-06-11 18:37:08 -07:00
2010-12-02 13:27:33 -08:00
2010-11-29 09:45:15 -08:00
2011-01-13 21:48:25 -08:00
2011-01-10 16:10:37 -08:00
2010-03-30 22:02:32 +09:00
2011-03-11 14:16:58 -05:00
2010-10-07 09:43:45 +02:00
2009-12-11 15:07:56 -08:00
2010-12-31 10:47:46 -08:00
2011-03-02 21:58:55 -08:00
2010-11-08 13:50:08 -08:00
2011-03-12 15:08:55 -08:00
2010-06-03 03:21:52 -07:00
2011-03-12 15:08:55 -08:00
2011-03-12 15:08:55 -08:00
2011-01-26 20:51:05 -08:00
2011-03-02 13:27:41 -08:00
2010-10-27 11:37:32 -07:00
2011-03-12 15:08:55 -08:00
2010-10-25 13:09:44 -07:00
2009-11-04 05:06:25 -08:00
2011-02-03 20:47:08 -08:00
2010-08-21 23:05:39 -07:00
2011-02-04 15:59:53 -08:00
2011-01-28 15:44:29 -05:00
2009-11-06 14:32:18 +03:00
2010-11-24 11:16:42 -08:00
2010-12-02 10:59:22 -08:00
2009-12-08 20:17:51 -08:00
2010-07-12 20:21:46 -07:00
2010-12-19 21:59:35 -08:00
2010-09-23 14:33:39 -07:00
2010-06-30 13:44:29 -07:00
2010-10-21 13:06:43 +02:00
2011-03-01 12:35:02 -08:00
2010-12-09 20:05:58 -08:00
2011-02-10 13:29:30 -08:00
2011-03-12 15:08:54 -08:00
2011-03-12 15:08:54 -08:00
2010-10-25 13:09:45 -07:00
2011-03-12 15:08:47 -08:00
2011-03-15 09:37:02 +09:00
2011-03-01 12:35:03 -08:00
2010-02-16 23:05:38 -08:00
2010-10-27 11:37:32 -07:00
2011-03-12 15:08:54 -08:00
2010-06-03 03:21:52 -07:00
2010-03-31 14:49:12 -04:00
2010-07-26 15:09:04 -04:00
2009-12-26 20:43:57 -08:00
2009-12-26 20:46:28 -08:00
2011-03-11 15:34:10 -05:00
2010-06-03 03:21:52 -07:00
2010-04-23 13:35:55 +09:00
2010-12-02 13:27:33 -08:00
2010-11-19 13:13:47 -08:00
2011-03-15 09:36:50 +09:00
2011-02-08 16:17:55 -08:00
2010-03-30 22:02:32 +09:00
2011-02-01 15:20:14 +01:00
2010-03-30 22:02:32 +09:00
2010-12-21 12:43:16 -08:00
2010-06-02 03:23:51 -07:00
2011-01-24 15:32:47 -08:00
2010-09-08 13:42:22 -07:00
2011-01-12 19:00:39 -08:00
2010-11-22 15:48:51 -05:00
2010-01-17 19:09:39 -08:00
2011-03-12 15:08:54 -08:00
2010-11-27 22:56:08 -08:00
2011-03-03 21:27:42 -08:00
2010-11-24 11:16:43 -08:00
2010-12-02 13:27:33 -08:00
2011-02-22 10:19:31 -08:00
2011-02-20 11:10:14 -08:00
2010-12-01 18:09:13 -08:00
2011-03-12 15:08:54 -08:00
2011-03-01 12:35:03 -08:00
2011-03-01 12:35:03 -08:00
2009-10-07 16:39:43 -04:00
2009-12-09 19:43:33 -08:00
2009-11-06 14:32:24 +03:00
2010-11-28 11:12:20 -08:00
2010-04-22 16:12:36 -07:00
2011-03-21 18:08:28 -07:00