• Mao Wenan's avatar
    net: sit: fix memory leak in sit_init_net() · 07f12b26
    Mao Wenan authored
    If register_netdev() is failed to register sitn->fb_tunnel_dev,
    it will go to err_reg_dev and forget to free netdev(sitn->fb_tunnel_dev).
    
    BUG: memory leak
    unreferenced object 0xffff888378daad00 (size 512):
      comm "syz-executor.1", pid 4006, jiffies 4295121142 (age 16.115s)
      hex dump (first 32 bytes):
        00 e6 ed c0 83 88 ff ff 00 00 00 00 00 00 00 00  ................
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    backtrace:
        [<00000000d6dcb63e>] kvmalloc include/linux/mm.h:577 [inline]
        [<00000000d6dcb63e>] kvzalloc include/linux/mm.h:585 [inline]
        [<00000000d6dcb63e>] netif_alloc_netdev_queues net/core/dev.c:8380 [inline]
        [<00000000d6dcb63e>] alloc_netdev_mqs+0x600/0xcc0 net/core/dev.c:8970
        [<00000000867e172f>] sit_init_net+0x295/0xa40 net/ipv6/sit.c:1848
        [<00000000871019fa>] ops_init+0xad/0x3e0 net/core/net_namespace.c:129
        [<00000000319507f6>] setup_net+0x2ba/0x690 net/core/net_namespace.c:314
        [<0000000087db4f96>] copy_net_ns+0x1dc/0x330 net/core/net_namespace.c:437
        [<0000000057efc651>] create_new_namespaces+0x382/0x730 kernel/nsproxy.c:107
        [<00000000676f83de>] copy_namespaces+0x2ed/0x3d0 kernel/nsproxy.c:165
        [<0000000030b74bac>] copy_process.part.27+0x231e/0x6db0 kernel/fork.c:1919
        [<00000000fff78746>] copy_process kernel/fork.c:1713 [inline]
        [<00000000fff78746>] _do_fork+0x1bc/0xe90 kernel/fork.c:2224
        [<000000001c2e0d1c>] do_syscall_64+0xc8/0x580 arch/x86/entry/common.c:290
        [<00000000ec48bd44>] entry_SYSCALL_64_after_hwframe+0x49/0xbe
        [<0000000039acff8a>] 0xffffffffffffffff
    Signed-off-by: default avatarMao Wenan <maowenan@huawei.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    07f12b26
Name
Last commit
Last update
..
ila Loading commit data...
netfilter Loading commit data...
Kconfig Loading commit data...
Makefile Loading commit data...
addrconf.c Loading commit data...
addrconf_core.c Loading commit data...
addrlabel.c Loading commit data...
af_inet6.c Loading commit data...
ah6.c Loading commit data...
anycast.c Loading commit data...
calipso.c Loading commit data...
datagram.c Loading commit data...
esp6.c Loading commit data...
esp6_offload.c Loading commit data...
exthdrs.c Loading commit data...
exthdrs_core.c Loading commit data...
exthdrs_offload.c Loading commit data...
fib6_notifier.c Loading commit data...
fib6_rules.c Loading commit data...
fou6.c Loading commit data...
icmp.c Loading commit data...
inet6_connection_sock.c Loading commit data...
inet6_hashtables.c Loading commit data...
ip6_checksum.c Loading commit data...
ip6_fib.c Loading commit data...
ip6_flowlabel.c Loading commit data...
ip6_gre.c Loading commit data...
ip6_icmp.c Loading commit data...
ip6_input.c Loading commit data...
ip6_offload.c Loading commit data...
ip6_offload.h Loading commit data...
ip6_output.c Loading commit data...
ip6_tunnel.c Loading commit data...
ip6_udp_tunnel.c Loading commit data...
ip6_vti.c Loading commit data...
ip6mr.c Loading commit data...
ipcomp6.c Loading commit data...
ipv6_sockglue.c Loading commit data...
mcast.c Loading commit data...
mcast_snoop.c Loading commit data...
mip6.c Loading commit data...
ndisc.c Loading commit data...
netfilter.c Loading commit data...
output_core.c Loading commit data...
ping.c Loading commit data...
proc.c Loading commit data...
protocol.c Loading commit data...
raw.c Loading commit data...
reassembly.c Loading commit data...
route.c Loading commit data...
seg6.c Loading commit data...
seg6_hmac.c Loading commit data...
seg6_iptunnel.c Loading commit data...
seg6_local.c Loading commit data...
sit.c Loading commit data...
syncookies.c Loading commit data...
sysctl_net_ipv6.c Loading commit data...
tcp_ipv6.c Loading commit data...
tcpv6_offload.c Loading commit data...
tunnel6.c Loading commit data...
udp.c Loading commit data...
udp_impl.h Loading commit data...
udp_offload.c Loading commit data...
udplite.c Loading commit data...
xfrm6_input.c Loading commit data...
xfrm6_mode_beet.c Loading commit data...
xfrm6_mode_ro.c Loading commit data...
xfrm6_mode_transport.c Loading commit data...
xfrm6_mode_tunnel.c Loading commit data...
xfrm6_output.c Loading commit data...
xfrm6_policy.c Loading commit data...
xfrm6_protocol.c Loading commit data...
xfrm6_state.c Loading commit data...
xfrm6_tunnel.c Loading commit data...