android_kernel_samsung_a7y1.../net/tipc
Xin Long 5da59882a8 tipc: add NULL pointer check before calling kfree_rcu
[ Upstream commit 42dec1dbe38239cf91cc1f4df7830c66276ced37 ]

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: 97ede29e80ee ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-06 21:35:27 +02:00
..
addr.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
addr.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
bcast.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
bcast.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
bearer.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
bearer.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
core.c tipc: change to use register_pernet_device 2020-04-06 19:17:25 +02:00
core.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
discover.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
discover.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
eth_media.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ib_media.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Kconfig A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
link.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
link.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Makefile A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
msg.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
msg.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
name_distr.c tipc: add NULL pointer check before calling kfree_rcu 2020-04-06 21:35:27 +02:00
name_distr.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
name_table.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
name_table.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
net.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
net.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
netlink_compat.c tipc: compat: allow tipc commands without arguments 2020-04-06 20:28:17 +02:00
netlink.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
netlink.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
node.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
node.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
server.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
server.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
socket.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
socket.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
subscr.c tipc: fix modprobe tipc failed after switch order of device registration -v2 2020-04-06 18:20:58 +02:00
subscr.h tipc: fix modprobe tipc failed after switch order of device registration -v2 2020-04-06 18:20:58 +02:00
sysctl.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
udp_media.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30