1. 11 5月, 2018 2 次提交
  2. 05 5月, 2018 1 次提交
  3. 02 5月, 2018 1 次提交
    • E
      ipv6: fix uninit-value in ip6_multipath_l3_keys() · cea67a2d
      Eric Dumazet 提交于
      syzbot/KMSAN reported an uninit-value in ip6_multipath_l3_keys(),
      root caused to a bad assumption of ICMP header being already
      pulled in skb->head
      
      ip_multipath_l3_keys() does the correct thing, so it is an IPv6 only bug.
      
      BUG: KMSAN: uninit-value in ip6_multipath_l3_keys net/ipv6/route.c:1830 [inline]
      BUG: KMSAN: uninit-value in rt6_multipath_hash+0x5c4/0x640 net/ipv6/route.c:1858
      CPU: 0 PID: 4507 Comm: syz-executor661 Not tainted 4.16.0+ #87
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
      Call Trace:
       __dump_stack lib/dump_stack.c:17 [inline]
       dump_stack+0x185/0x1d0 lib/dump_stack.c:53
       kmsan_report+0x142/0x240 mm/kmsan/kmsan.c:1067
       __msan_warning_32+0x6c/0xb0 mm/kmsan/kmsan_instr.c:683
       ip6_multipath_l3_keys net/ipv6/route.c:1830 [inline]
       rt6_multipath_hash+0x5c4/0x640 net/ipv6/route.c:1858
       ip6_route_input+0x65a/0x920 net/ipv6/route.c:1884
       ip6_rcv_finish+0x413/0x6e0 net/ipv6/ip6_input.c:69
       NF_HOOK include/linux/netfilter.h:288 [inline]
       ipv6_rcv+0x1e16/0x2340 net/ipv6/ip6_input.c:208
       __netif_receive_skb_core+0x47df/0x4a90 net/core/dev.c:4562
       __netif_receive_skb net/core/dev.c:4627 [inline]
       netif_receive_skb_internal+0x49d/0x630 net/core/dev.c:4701
       netif_receive_skb+0x230/0x240 net/core/dev.c:4725
       tun_rx_batched drivers/net/tun.c:1555 [inline]
       tun_get_user+0x740f/0x7c60 drivers/net/tun.c:1962
       tun_chr_write_iter+0x1d4/0x330 drivers/net/tun.c:1990
       call_write_iter include/linux/fs.h:1782 [inline]
       new_sync_write fs/read_write.c:469 [inline]
       __vfs_write+0x7fb/0x9f0 fs/read_write.c:482
       vfs_write+0x463/0x8d0 fs/read_write.c:544
       SYSC_write+0x172/0x360 fs/read_write.c:589
       SyS_write+0x55/0x80 fs/read_write.c:581
       do_syscall_64+0x309/0x430 arch/x86/entry/common.c:287
       entry_SYSCALL_64_after_hwframe+0x3d/0xa2
      
      Fixes: 23aebdac ("ipv6: Compute multipath hash for ICMP errors from offending packet")
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Reported-by: Nsyzbot <syzkaller@googlegroups.com>
      Cc: Jakub Sitnicki <jkbs@redhat.com>
      Acked-by: NJakub Sitnicki <jkbs@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      cea67a2d
  4. 25 4月, 2018 1 次提交
  5. 24 4月, 2018 3 次提交
  6. 22 4月, 2018 6 次提交
  7. 20 4月, 2018 5 次提交
    • E
      net/ipv6: Fix ip6_convert_metrics() bug · 263243d6
      Eric Dumazet 提交于
      If ip6_convert_metrics() fails to allocate memory, it should not
      overwrite rt->fib6_metrics or we risk a crash later as syzbot found.
      
      BUG: KASAN: null-ptr-deref in atomic_read include/asm-generic/atomic-instrumented.h:21 [inline]
      BUG: KASAN: null-ptr-deref in refcount_sub_and_test+0x92/0x330 lib/refcount.c:179
      Read of size 4 at addr 0000000000000044 by task syzkaller832429/4487
      
      CPU: 1 PID: 4487 Comm: syzkaller832429 Not tainted 4.16.0+ #6
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
      Call Trace:
       __dump_stack lib/dump_stack.c:77 [inline]
       dump_stack+0x1b9/0x294 lib/dump_stack.c:113
       kasan_report_error mm/kasan/report.c:352 [inline]
       kasan_report.cold.7+0x6d/0x2fe mm/kasan/report.c:412
       check_memory_region_inline mm/kasan/kasan.c:260 [inline]
       check_memory_region+0x13e/0x1b0 mm/kasan/kasan.c:267
       kasan_check_read+0x11/0x20 mm/kasan/kasan.c:272
       atomic_read include/asm-generic/atomic-instrumented.h:21 [inline]
       refcount_sub_and_test+0x92/0x330 lib/refcount.c:179
       refcount_dec_and_test+0x1a/0x20 lib/refcount.c:212
       fib6_info_destroy+0x2d0/0x3c0 net/ipv6/ip6_fib.c:206
       fib6_info_release include/net/ip6_fib.h:304 [inline]
       ip6_route_info_create+0x677/0x3240 net/ipv6/route.c:3020
       ip6_route_add+0x23/0xb0 net/ipv6/route.c:3030
       inet6_rtm_newroute+0x142/0x160 net/ipv6/route.c:4406
       rtnetlink_rcv_msg+0x466/0xc10 net/core/rtnetlink.c:4648
       netlink_rcv_skb+0x172/0x440 net/netlink/af_netlink.c:2448
       rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:4666
       netlink_unicast_kernel net/netlink/af_netlink.c:1310 [inline]
       netlink_unicast+0x58b/0x740 net/netlink/af_netlink.c:1336
       netlink_sendmsg+0x9f0/0xfa0 net/netlink/af_netlink.c:1901
       sock_sendmsg_nosec net/socket.c:629 [inline]
       sock_sendmsg+0xd5/0x120 net/socket.c:639
       ___sys_sendmsg+0x805/0x940 net/socket.c:2117
       __sys_sendmsg+0x115/0x270 net/socket.c:2155
       SYSC_sendmsg net/socket.c:2164 [inline]
       SyS_sendmsg+0x29/0x30 net/socket.c:2162
       do_syscall_64+0x29e/0x9d0 arch/x86/entry/common.c:287
       entry_SYSCALL_64_after_hwframe+0x42/0xb7
      
      Fixes: d4ead6b3 ("net/ipv6: move metrics from dst to rt6_info")
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Cc: David Ahern <dsa@cumulusnetworks.com>
      Reported-by: Nsyzbot <syzkaller@googlegroups.com>
      Acked-by: NDavid Ahern <dsa@cumulusnetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      263243d6
    • D
      net/ipv6: Remove fib6_idev · dcd1f572
      David Ahern 提交于
      fib6_idev can be obtained from __in6_dev_get on the nexthop device
      rather than caching it in the fib6_info. Remove it.
      Signed-off-by: NDavid Ahern <dsahern@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      dcd1f572
    • D
      net/ipv6: Remove unnecessary checks on fib6_idev · eea68cd3
      David Ahern 提交于
      Prior to 4832c30d ("net: ipv6: put host and anycast routes on device
      with address") host routes and anycast routes were installed with the
      device set to loopback (or VRF device once that feature was added). In the
      older code dst.dev was set to loopback (needed for packet tx) and rt6i_idev
      was used to denote the actual interface.
      
      Commit 4832c30d changed the code to have dst.dev pointing to the real
      device with the switch to lo or vrf device done on dst clones. As a
      consequence of this change a couple of device checks during route lookups
      are no longer needed. Remove them.
      Signed-off-by: NDavid Ahern <dsahern@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      eea68cd3
    • D
      net/ipv6: Rename addrconf_dst_alloc · 360a9887
      David Ahern 提交于
      addrconf_dst_alloc now returns a fib6_info. Update the name
      and its users to reflect the change.
      
      Rename only; no functional change intended.
      Signed-off-by: NDavid Ahern <dsahern@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      360a9887
    • D
      net/ipv6: Rename fib6_info struct elements · 93c2fb25
      David Ahern 提交于
      Change the prefix for fib6_info struct elements from rt6i_ to fib6_.
      rt6i_pcpu and rt6i_exception_bucket are left as is given that they
      point to rt6_info entries.
      
      Rename only; not functional change intended.
      Signed-off-by: NDavid Ahern <dsahern@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      93c2fb25
  8. 18 4月, 2018 18 次提交
  9. 04 4月, 2018 1 次提交
  10. 31 3月, 2018 2 次提交
    • D
      net/ipv6: Fix route leaking between VRFs · b6cdbc85
      David Ahern 提交于
      Donald reported that IPv6 route leaking between VRFs is not working.
      The root cause is the strict argument in the call to rt6_lookup when
      validating the nexthop spec.
      
      ip6_route_check_nh validates the gateway and device (if given) of a
      route spec. It in turn could call rt6_lookup (e.g., lookup in a given
      table did not succeed so it falls back to a full lookup) and if so
      sets the strict argument to 1. That means if the egress device is given,
      the route lookup needs to return a result with the same device. This
      strict requirement does not work with VRFs (IPv4 or IPv6) because the
      oif in the flow struct is overridden with the index of the VRF device
      to trigger a match on the l3mdev rule and force the lookup to its table.
      
      The right long term solution is to add an l3mdev index to the flow
      struct such that the oif is not overridden. That solution will not
      backport well, so this patch aims for a simpler solution to relax the
      strict argument if the route spec device is an l3mdev slave. As done
      in other places, use the FLOWI_FLAG_SKIP_NH_OIF to know that the
      RT6_LOOKUP_F_IFACE flag needs to be removed.
      
      Fixes: ca254490 ("net: Add VRF support to IPv6 stack")
      Reported-by: NDonald Sharp <sharpd@cumulusnetworks.com>
      Signed-off-by: NDavid Ahern <dsahern@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b6cdbc85
    • L
      ipv6: do not set routes if disable_ipv6 has been enabled · 428604fb
      Lorenzo Bianconi 提交于
      Do not allow setting ipv6 routes from userspace if disable_ipv6 has been
      enabled. The issue can be triggered using the following reproducer:
      
      - sysctl net.ipv6.conf.all.disable_ipv6=1
      - ip -6 route add a:b:c:d::/64 dev em1
      - ip -6 route show
        a:b:c:d::/64 dev em1 metric 1024 pref medium
      
      Fix it checking disable_ipv6 value in ip6_route_info_create routine
      Signed-off-by: NLorenzo Bianconi <lorenzo.bianconi@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      428604fb