Xin Long
42dec1dbe3
tipc: add NULL pointer check before calling kfree_rcu
Unlike kfree(p), kfree_rcu(p, rcu) won't do NULL pointer check. When
tipc_nametbl_remove_publ returns NULL, the panic below happens:
BUG: unable to handle kernel NULL pointer dereference at 0000000000000068
RIP: 0010:__call_rcu+0x1d/0x290
Call Trace:
<IRQ>
tipc_publ_notify+0xa9/0x170 [tipc]
tipc_node_write_unlock+0x8d/0x100 [tipc]
tipc_node_link_down+0xae/0x1d0 [tipc]
tipc_node_check_dest+0x3ea/0x8f0 [tipc]
? tipc_disc_rcv+0x2c7/0x430 [tipc]
tipc_disc_rcv+0x2c7/0x430 [tipc]
? tipc_rcv+0x6bb/0xf20 [tipc]
tipc_rcv+0x6bb/0xf20 [tipc]
? ip_route_input_slow+0x9cf/0xb10
tipc_udp_recv+0x195/0x1e0 [tipc]
? tipc_udp_is_known_peer+0x80/0x80 [tipc]
udp_queue_rcv_skb+0x180/0x460
udp_unicast_rcv_skb.isra.56+0x75/0x90
__udp4_lib_rcv+0x4ce/0xb90
ip_local_deliver_finish+0x11c/0x210
ip_local_deliver+0x6b/0xe0
? ip_rcv_finish+0xa9/0x410
ip_rcv+0x273/0x362
Fixes: 97ede29e80 ("tipc: convert name table read-write lock to RCU")
Reported-by: Li Shuang <shuali@redhat.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-09-05 09:58:49 +02:00
..
2019-08-11 21:40:04 -07:00
2018-03-23 13:12:18 -04:00
2019-06-25 13:42:54 -07:00
2019-03-21 09:56:55 -07:00
2019-07-07 13:18:53 -07:00
2018-12-19 11:49:24 -08:00
2019-06-22 16:51:47 -07:00
2019-03-19 13:56:17 -07:00
2018-08-29 18:04:54 -07:00
2018-11-17 22:01:31 -08:00
2018-03-23 13:12:17 -04:00
2015-02-27 18:18:48 -05:00
2019-06-16 20:42:05 -07:00
2018-06-30 21:05:42 +09:00
2015-02-27 18:18:48 -05:00
2019-06-14 14:21:21 -06:00
2019-08-16 16:27:13 -07:00
2019-05-04 00:59:51 -04:00
2018-12-19 11:49:24 -08:00
2019-04-27 17:03:44 -04:00
2016-07-26 14:26:42 -07:00
2018-09-29 11:24:22 -07:00
2019-08-16 16:27:13 -07:00
2019-09-05 09:58:49 +02:00
2018-03-31 22:19:52 -04:00
2019-04-27 17:03:44 -04:00
2018-10-22 19:29:12 -07:00
2019-04-27 17:07:21 -04:00
2018-11-17 22:01:31 -08:00
2019-08-01 18:14:00 -04:00
2019-06-24 07:29:45 -07:00
2016-07-26 14:26:42 -07:00
2019-07-17 15:24:38 -07:00
2019-04-04 18:29:25 -07:00
2019-07-30 14:39:36 -07:00
2018-12-19 11:49:24 -08:00
2018-04-12 21:46:10 -04:00
2019-05-20 10:45:43 -07:00
2019-07-18 17:08:07 -07:00
2019-07-21 11:41:01 -07:00
2018-02-16 15:26:34 -05:00
2019-01-17 22:04:43 -08:00
2018-12-19 11:49:25 -08:00
2019-07-07 13:18:53 -07:00
2018-04-20 11:04:05 -04:00