Masahiro Fujiwara
b520e574fd
gtp: fix an use-before-init in gtp_newlink()
[ Upstream commit 5146743120 ]
*_pdp_find() from gtp_encap_recv() would trigger a crash when a peer
sends GTP packets while creating new GTP device.
RIP: 0010:gtp1_pdp_find.isra.0+0x68/0x90 [gtp]
<SNIP>
Call Trace:
<IRQ>
gtp_encap_recv+0xc2/0x2e0 [gtp]
? gtp1_pdp_find.isra.0+0x90/0x90 [gtp]
udp_queue_rcv_one_skb+0x1fe/0x530
udp_queue_rcv_skb+0x40/0x1b0
udp_unicast_rcv_skb.isra.0+0x78/0x90
__udp4_lib_rcv+0x5af/0xc70
udp_rcv+0x1a/0x20
ip_protocol_deliver_rcu+0xc5/0x1b0
ip_local_deliver_finish+0x48/0x50
ip_local_deliver+0xe5/0xf0
? ip_protocol_deliver_rcu+0x1b0/0x1b0
gtp_encap_enable() should be called after gtp_hastable_new() otherwise
*_pdp_find() will access the uninitialized hash table.
Fixes: 1e3a3abd8b ("gtp: make GTP sockets in gtp_newlink optional")
Signed-off-by: Masahiro Fujiwara <fujiwara.masahiro@gmail.com>
Link: https://lore.kernel.org/r/20201027114846.3924-1-fujiwara.masahiro@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-01 12:45:38 +01:00
..
2020-06-14 01:57:21 +09:00
2020-08-21 13:15:03 +02:00
2020-06-15 23:08:28 -05:00
2020-10-29 10:07:34 +01:00
2020-09-09 19:14:30 +02:00
2020-10-01 17:36:26 +02:00
2020-06-14 01:57:21 +09:00
2020-11-01 12:45:36 +01:00
2020-09-23 12:59:49 +02:00
2020-10-29 10:08:27 +01:00
2020-10-29 10:07:48 +01:00
2020-06-10 16:05:54 -07:00
2020-10-29 10:07:49 +01:00
2020-10-29 10:08:08 +01:00
2020-10-29 10:07:45 +01:00
2020-06-14 01:57:21 +09:00
2020-06-14 14:46:52 +01:00
2020-10-29 10:08:01 +01:00
2020-10-07 08:02:49 +02:00
2020-11-01 12:45:38 +01:00
2020-09-23 13:00:03 +02:00
2020-10-01 17:36:31 +02:00
2020-06-17 10:57:41 -07:00
2020-10-29 10:08:29 +01:00
2020-10-01 17:36:34 +02:00
2020-10-29 10:07:14 +01:00
2020-06-14 01:57:21 +09:00
2020-05-29 17:36:02 +09:00
2020-06-15 23:08:31 -05:00
2020-11-01 12:45:36 +01:00
2020-07-13 22:11:17 -07:00
2020-06-14 01:57:21 +09:00
2020-06-14 01:57:21 +09:00
2020-10-14 11:55:48 +02:00
2020-10-29 10:08:29 +01:00
2020-06-14 01:57:21 +09:00
2020-10-29 10:08:26 +01:00
2020-06-14 01:57:21 +09:00
2020-09-23 12:59:55 +02:00
2020-10-29 10:07:26 +01:00
2020-10-29 10:07:46 +01:00
2020-10-29 10:08:17 +01:00
2020-10-29 10:08:01 +01:00
2020-06-14 01:57:21 +09:00
2020-10-29 10:07:46 +01:00
2020-10-29 10:08:03 +01:00
2020-10-29 10:08:09 +01:00
2020-09-23 12:59:50 +02:00
2020-10-29 10:07:46 +01:00
2020-06-14 01:57:21 +09:00
2020-09-09 19:14:10 +02:00
2020-06-14 01:57:21 +09:00
2020-08-19 08:26:33 +02:00
2020-10-29 10:08:15 +01:00
2020-08-19 08:26:45 +02:00
2020-10-29 10:08:04 +01:00
2020-11-01 12:45:37 +01:00
2020-10-29 10:08:21 +01:00
2020-10-29 10:08:12 +01:00
2020-10-07 08:02:46 +02:00
2020-06-26 22:51:53 -04:00
2020-10-29 10:07:47 +01:00
2020-10-29 10:08:30 +01:00
2020-10-29 10:08:20 +01:00
2020-08-19 08:26:27 +02:00
2020-10-29 10:08:00 +01:00
2020-11-01 12:45:38 +01:00
2020-09-17 13:55:32 +02:00
2020-10-29 10:08:16 +01:00
2020-11-01 12:45:37 +01:00
2020-10-29 10:08:16 +01:00
2020-10-29 10:07:45 +01:00
2020-08-26 11:49:13 +02:00
2020-10-29 10:08:24 +01:00
2020-06-15 23:08:32 -05:00
2020-08-19 08:27:07 +02:00
2020-06-14 01:57:21 +09:00
2020-10-29 10:08:06 +01:00
2020-06-14 01:57:21 +09:00
2020-10-29 10:07:14 +01:00
2020-10-07 08:02:50 +02:00
2020-10-29 10:07:46 +01:00
2020-10-29 10:08:09 +01:00
2020-06-14 01:57:21 +09:00
2020-08-19 08:26:46 +02:00
2020-06-13 13:29:16 -07:00
2020-06-14 01:57:21 +09:00
2020-06-14 01:57:21 +09:00
2020-10-29 10:08:06 +01:00
2020-10-29 10:08:03 +01:00
2020-10-29 10:07:13 +01:00
2020-10-29 10:07:25 +01:00
2020-10-29 10:08:06 +01:00
2020-08-19 08:26:09 +02:00
2020-10-29 10:08:05 +01:00
2020-10-29 10:08:04 +01:00
2020-10-29 10:08:29 +01:00
2020-06-14 01:57:21 +09:00
2020-10-29 10:08:29 +01:00
2020-06-14 01:57:21 +09:00
2020-10-29 10:07:44 +01:00
2020-10-29 10:08:15 +01:00
2020-09-17 13:55:28 +02:00
2020-10-29 10:08:19 +01:00
2020-10-29 10:08:21 +01:00
2020-10-29 10:07:48 +01:00
2020-06-09 09:39:14 -07:00
2020-09-09 19:14:23 +02:00
2020-09-23 13:00:01 +02:00
2020-10-29 10:08:30 +01:00
2020-07-03 10:52:02 +02:00
2020-10-29 10:08:30 +01:00
2020-09-03 11:29:29 +02:00
2020-10-29 10:08:08 +01:00
2020-10-14 11:55:57 +02:00
2020-10-29 10:08:27 +01:00
2020-10-29 10:07:35 +01:00
2020-08-26 11:49:07 +02:00
2020-06-14 01:57:21 +09:00
2020-06-14 01:57:21 +09:00
2020-06-15 23:08:32 -05:00
2020-10-29 10:08:07 +01:00
2020-10-07 08:02:47 +02:00
2020-06-14 01:57:21 +09:00