1. 04 8月, 2020 2 次提交
  2. 01 8月, 2020 1 次提交
  3. 31 7月, 2020 1 次提交
    • C
      ipv6: fix memory leaks on IPV6_ADDRFORM path · 8c0de6e9
      Cong Wang 提交于
      IPV6_ADDRFORM causes resource leaks when converting an IPv6 socket
      to IPv4, particularly struct ipv6_ac_socklist. Similar to
      struct ipv6_mc_socklist, we should just close it on this path.
      
      This bug can be easily reproduced with the following C program:
      
        #include <stdio.h>
        #include <string.h>
        #include <sys/types.h>
        #include <sys/socket.h>
        #include <arpa/inet.h>
      
        int main()
        {
          int s, value;
          struct sockaddr_in6 addr;
          struct ipv6_mreq m6;
      
          s = socket(AF_INET6, SOCK_DGRAM, 0);
          addr.sin6_family = AF_INET6;
          addr.sin6_port = htons(5000);
          inet_pton(AF_INET6, "::ffff:192.168.122.194", &addr.sin6_addr);
          connect(s, (struct sockaddr *)&addr, sizeof(addr));
      
          inet_pton(AF_INET6, "fe80::AAAA", &m6.ipv6mr_multiaddr);
          m6.ipv6mr_interface = 5;
          setsockopt(s, SOL_IPV6, IPV6_JOIN_ANYCAST, &m6, sizeof(m6));
      
          value = AF_INET;
          setsockopt(s, SOL_IPV6, IPV6_ADDRFORM, &value, sizeof(value));
      
          close(s);
          return 0;
        }
      
      Reported-by: ch3332xr@gmail.com
      Fixes: 1da177e4 ("Linux-2.6.12-rc2")
      Signed-off-by: NCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8c0de6e9
  4. 29 7月, 2020 3 次提交
  5. 28 7月, 2020 1 次提交
  6. 25 7月, 2020 12 次提交
  7. 22 7月, 2020 3 次提交
  8. 21 7月, 2020 1 次提交
  9. 20 7月, 2020 8 次提交
  10. 18 7月, 2020 4 次提交
  11. 17 7月, 2020 1 次提交
    • X
      ip6_vti: use IS_REACHABLE to avoid some compile errors · 96a20829
      Xin Long 提交于
      Naresh reported some compile errors:
      
        arm build failed due this error on linux-next 20200713 and  20200713
        net/ipv6/ip6_vti.o: In function `vti6_rcv_tunnel':
        ip6_vti.c:(.text+0x1d20): undefined reference to `xfrm6_tunnel_spi_lookup'
      
      This happened when set CONFIG_IPV6_VTI=y and CONFIG_INET6_TUNNEL=m.
      We don't really want ip6_vti to depend inet6_tunnel completely, but
      only to disable the tunnel code when inet6_tunnel is not seen.
      
      So instead of adding "select INET6_TUNNEL" for IPV6_VTI, this patch
      is only to change to IS_REACHABLE to avoid these compile error.
      Reported-by: NNaresh Kamboju <naresh.kamboju@linaro.org>
      Fixes: 08622869 ("ip6_vti: support IP6IP6 tunnel processing with .cb_handler")
      Signed-off-by: NXin Long <lucien.xin@gmail.com>
      Signed-off-by: NSteffen Klassert <steffen.klassert@secunet.com>
      96a20829
  12. 14 7月, 2020 3 次提交
    • X
      ip6_vti: not register vti_ipv6_handler twice · a8757147
      Xin Long 提交于
      An xfrm6_tunnel object is linked into the list when registering,
      so vti_ipv6_handler can not be registered twice, otherwise its
      next pointer will be overwritten on the second time.
      
      So this patch is to define a new xfrm6_tunnel object to register
      for AF_INET.
      
      Fixes: 2ab110cb ("ip6_vti: support IP6IP tunnel processing")
      Signed-off-by: NXin Long <lucien.xin@gmail.com>
      Signed-off-by: NSteffen Klassert <steffen.klassert@secunet.com>
      a8757147
    • W
      ip6_gre: fix null-ptr-deref in ip6gre_init_net() · 46ef5b89
      Wei Yongjun 提交于
      KASAN report null-ptr-deref error when register_netdev() failed:
      
      KASAN: null-ptr-deref in range [0x00000000000003c0-0x00000000000003c7]
      CPU: 2 PID: 422 Comm: ip Not tainted 5.8.0-rc4+ #12
      Call Trace:
       ip6gre_init_net+0x4ab/0x580
       ? ip6gre_tunnel_uninit+0x3f0/0x3f0
       ops_init+0xa8/0x3c0
       setup_net+0x2de/0x7e0
       ? rcu_read_lock_bh_held+0xb0/0xb0
       ? ops_init+0x3c0/0x3c0
       ? kasan_unpoison_shadow+0x33/0x40
       ? __kasan_kmalloc.constprop.0+0xc2/0xd0
       copy_net_ns+0x27d/0x530
       create_new_namespaces+0x382/0xa30
       unshare_nsproxy_namespaces+0xa1/0x1d0
       ksys_unshare+0x39c/0x780
       ? walk_process_tree+0x2a0/0x2a0
       ? trace_hardirqs_on+0x4a/0x1b0
       ? _raw_spin_unlock_irq+0x1f/0x30
       ? syscall_trace_enter+0x1a7/0x330
       ? do_syscall_64+0x1c/0xa0
       __x64_sys_unshare+0x2d/0x40
       do_syscall_64+0x56/0xa0
       entry_SYSCALL_64_after_hwframe+0x44/0xa9
      
      ip6gre_tunnel_uninit() has set 'ign->fb_tunnel_dev' to NULL, later
      access to ign->fb_tunnel_dev cause null-ptr-deref. Fix it by saving
      'ign->fb_tunnel_dev' to local variable ndev.
      
      Fixes: dafabb65 ("ip6_gre: fix use-after-free in ip6gre_tunnel_lookup()")
      Reported-by: NHulk Robot <hulkci@huawei.com>
      Signed-off-by: NWei Yongjun <weiyongjun1@huawei.com>
      Reviewed-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      46ef5b89
    • A
      net: ipv6: kerneldoc fixes · b51cd7c8
      Andrew Lunn 提交于
      Simple fixes which require no deep knowledge of the code.
      
      Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
      Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b51cd7c8