android_kernel_samsung_a7y1.../net/tipc
Junwei Hu dc2611c82e tipc: fix modprobe tipc failed after switch order of device registration -v2
commit 526f5b851a96566803ee4bee60d0a34df56c77f8 upstream.

Error message printed:
modprobe: ERROR: could not insert 'tipc': Address family not
supported by protocol.
when modprobe tipc after the following patch: switch order of
device registration, commit 7e27e8d6130c
("tipc: switch order of device registration to fix a crash")

Because sock_create_kern(net, AF_TIPC, ...) called by
tipc_topsrv_create_listener() in the initialization process
of tipc_init_net(), so tipc_socket_init() must be execute before that.
Meanwhile, tipc_net_id need to be initialized when sock_create()
called, and tipc_socket_init() is no need to be called for each namespace.

I add a variable tipc_topsrv_net_ops, and split the
register_pernet_subsys() of tipc into two parts, and split
tipc_socket_init() with initialization of pernet params.

By the way, I fixed resources rollback error when tipc_bcast_init()
failed in tipc_init_net().

Fixes: 7e27e8d6130c ("tipc: switch order of device registration to fix a crash")
Signed-off-by: Junwei Hu <hujunwei4@huawei.com>
Reported-by: Wang Wang <wangwang2@huawei.com>
Reported-by: syzbot+1e8114b61079bfe9cbc5@syzkaller.appspotmail.com
Reviewed-by: Kang Zhou <zhoukang7@huawei.com>
Reviewed-by: Suanming Mou <mousuanming@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-06 18:20:58 +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: fix modprobe tipc failed after switch order of device registration -v2 2020-04-06 18:20:58 +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 A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
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: check link name with right length in tipc_nl_compat_link_set 2020-04-06 16:40:39 +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