1. 06 4月, 2021 3 次提交
    • S
      net: hns3: Remove the left over redundant check & assignment · 9a6aaf61
      Salil Mehta 提交于
      This removes the left over check and assignment which is no longer used
      anywhere in the function and should have been removed as part of the
      below mentioned patch.
      
      Fixes: 012fcb52 ("net: hns3: activate reset timer when calling reset_event")
      Signed-off-by: NSalil Mehta <salil.mehta@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9a6aaf61
    • M
      net-ipv6: bugfix - raw & sctp - switch to ipv6_can_nonlocal_bind() · 630e4576
      Maciej Żenczykowski 提交于
      Found by virtue of ipv6 raw sockets not honouring the per-socket
      IP{,V6}_FREEBIND setting.
      
      Based on hits found via:
        git grep '[.]ip_nonlocal_bind'
      We fix both raw ipv6 sockets to honour IP{,V6}_FREEBIND and IP{,V6}_TRANSPARENT,
      and we fix sctp sockets to honour IP{,V6}_TRANSPARENT (they already honoured
      FREEBIND), and not just the ipv6 'ip_nonlocal_bind' sysctl.
      
      The helper is defined as:
        static inline bool ipv6_can_nonlocal_bind(struct net *net, struct inet_sock *inet) {
          return net->ipv6.sysctl.ip_nonlocal_bind || inet->freebind || inet->transparent;
        }
      so this change only widens the accepted opt-outs and is thus a clean bugfix.
      
      I'm not entirely sure what 'fixes' tag to add, since this is AFAICT an ancient bug,
      but IMHO this should be applied to stable kernels as far back as possible.
      As such I'm adding a 'fixes' tag with the commit that originally added the helper,
      which happened in 4.19.  Backporting to older LTS kernels (at least 4.9 and 4.14)
      would presumably require open-coding it or backporting the helper as well.
      
      Other possibly relevant commits:
        v4.18-rc6-1502-g83ba4645 net: add helpers checking if socket can be bound to nonlocal address
        v4.18-rc6-1431-gd0c1f011 net/ipv6: allow any source address for sendmsg pktinfo with ip_nonlocal_bind
        v4.14-rc5-271-gb71d21c2 sctp: full support for ipv6 ip_nonlocal_bind & IP_FREEBIND
        v4.7-rc7-1883-g9b974202 sctp: support ipv6 nonlocal bind
        v4.1-12247-g35a256fe ipv6: Nonlocal bind
      
      Cc: Lorenzo Colitti <lorenzo@google.com>
      Fixes: 83ba4645 ("net: add helpers checking if socket can be bound to nonlocal address")
      Signed-off-by: NMaciej Żenczykowski <maze@google.com>
      Reviewed-By: NLorenzo Colitti <lorenzo@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      630e4576
    • I
      openvswitch: fix send of uninitialized stack memory in ct limit reply · 4d51419d
      Ilya Maximets 提交于
      'struct ovs_zone_limit' has more members than initialized in
      ovs_ct_limit_get_default_limit().  The rest of the memory is a random
      kernel stack content that ends up being sent to userspace.
      
      Fix that by using designated initializer that will clear all
      non-specified fields.
      
      Fixes: 11efd5cb ("openvswitch: Support conntrack zone limit")
      Signed-off-by: NIlya Maximets <i.maximets@ovn.org>
      Acked-by: NTonghao Zhang <xiangxia.m.yue@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4d51419d
  2. 03 4月, 2021 3 次提交
  3. 02 4月, 2021 17 次提交
  4. 01 4月, 2021 15 次提交
  5. 31 3月, 2021 2 次提交
    • E
      net: ensure mac header is set in virtio_net_hdr_to_skb() · 61431a59
      Eric Dumazet 提交于
      Commit 924a9bc3 ("net: check if protocol extracted by virtio_net_hdr_set_proto is correct")
      added a call to dev_parse_header_protocol() but mac_header is not yet set.
      
      This means that eth_hdr() reads complete garbage, and syzbot complained about it [1]
      
      This patch resets mac_header earlier, to get more coverage about this change.
      
      Audit of virtio_net_hdr_to_skb() callers shows that this change should be safe.
      
      [1]
      
      BUG: KASAN: use-after-free in eth_header_parse_protocol+0xdc/0xe0 net/ethernet/eth.c:282
      Read of size 2 at addr ffff888017a6200b by task syz-executor313/8409
      
      CPU: 1 PID: 8409 Comm: syz-executor313 Not tainted 5.12.0-rc2-syzkaller #0
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
      Call Trace:
       __dump_stack lib/dump_stack.c:79 [inline]
       dump_stack+0x141/0x1d7 lib/dump_stack.c:120
       print_address_description.constprop.0.cold+0x5b/0x2f8 mm/kasan/report.c:232
       __kasan_report mm/kasan/report.c:399 [inline]
       kasan_report.cold+0x7c/0xd8 mm/kasan/report.c:416
       eth_header_parse_protocol+0xdc/0xe0 net/ethernet/eth.c:282
       dev_parse_header_protocol include/linux/netdevice.h:3177 [inline]
       virtio_net_hdr_to_skb.constprop.0+0x99d/0xcd0 include/linux/virtio_net.h:83
       packet_snd net/packet/af_packet.c:2994 [inline]
       packet_sendmsg+0x2325/0x52b0 net/packet/af_packet.c:3031
       sock_sendmsg_nosec net/socket.c:654 [inline]
       sock_sendmsg+0xcf/0x120 net/socket.c:674
       sock_no_sendpage+0xf3/0x130 net/core/sock.c:2860
       kernel_sendpage.part.0+0x1ab/0x350 net/socket.c:3631
       kernel_sendpage net/socket.c:3628 [inline]
       sock_sendpage+0xe5/0x140 net/socket.c:947
       pipe_to_sendpage+0x2ad/0x380 fs/splice.c:364
       splice_from_pipe_feed fs/splice.c:418 [inline]
       __splice_from_pipe+0x43e/0x8a0 fs/splice.c:562
       splice_from_pipe fs/splice.c:597 [inline]
       generic_splice_sendpage+0xd4/0x140 fs/splice.c:746
       do_splice_from fs/splice.c:767 [inline]
       do_splice+0xb7e/0x1940 fs/splice.c:1079
       __do_splice+0x134/0x250 fs/splice.c:1144
       __do_sys_splice fs/splice.c:1350 [inline]
       __se_sys_splice fs/splice.c:1332 [inline]
       __x64_sys_splice+0x198/0x250 fs/splice.c:1332
       do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
      
      Fixes: 924a9bc3 ("net: check if protocol extracted by virtio_net_hdr_set_proto is correct")
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Cc: Balazs Nemeth <bnemeth@redhat.com>
      Cc: Willem de Bruijn <willemb@google.com>
      Reported-by: Nsyzbot <syzkaller@googlegroups.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      61431a59
    • F
      net: phy: broadcom: Only advertise EEE for supported modes · c056d480
      Florian Fainelli 提交于
      We should not be advertising EEE for modes that we do not support,
      correct that oversight by looking at the PHY device supported linkmodes.
      
      Fixes: 99cec8a4 ("net: phy: broadcom: Allow enabling or disabling of EEE")
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c056d480