1. 07 Oct, 2021 7 commits
    • Florian Westphal's avatar
      netfilter: nf_tables: skip netdev events generated on netns removal · 68a3765c
      Florian Westphal authored
      syzbot reported following (harmless) WARN:
      
       WARNING: CPU: 1 PID: 2648 at net/netfilter/core.c:468
        nft_netdev_unregister_hooks net/netfilter/nf_tables_api.c:230 [inline]
        nf_tables_unregister_hook include/net/netfilter/nf_tables.h:1090 [inline]
        __nft_release_basechain+0x138/0x640 net/netfilter/nf_tables_api.c:9524
        nft_netdev_event net/netfilter/nft_chain_filter.c:351 [inline]
        nf_tables_netdev_event+0x521/0x8a0 net/netfilter/nft_chain_filter.c:382
      
      reproducer:
      unshare -n bash -c 'ip link add br0 type bridge; nft add table netdev t ; \
       nft add chain netdev t ingress \{ type filter hook ingress device "br0" \
       priority 0\; policy drop\; \}'
      
      Problem is that when netns device exit hooks create the UNREGISTER
      event, the .pre_exit hook for nf_tables core has already removed the
      base hook.  Notifier attempts to do this again.
      
      The need to do base hook unregister unconditionally was needed in the past,
      because notifier was last stage where reg->dev dereference was safe.
      
      Now that nf_tables does the hook removal in .pre_exit, this isn't
      needed anymore.
      
      Reported-and-tested-by: syzbot+154bd5be532a63aa778b@syzkaller.appspotmail.com
      Fixes: 767d1216 ("netfilter: nftables: fix possible UAF over chains from packet path in netns")
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      68a3765c
    • Vegard Nossum's avatar
      netfilter: Kconfig: use 'default y' instead of 'm' for bool config option · 77076934
      Vegard Nossum authored
      This option, NF_CONNTRACK_SECMARK, is a bool, so it can never be 'm'.
      
      Fixes: 33b8e776 ("[NETFILTER]: Add CONFIG_NETFILTER_ADVANCED option")
      Signed-off-by: default avatarVegard Nossum <vegard.nossum@oracle.com>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      77076934
    • Juhee Kang's avatar
      netfilter: xt_IDLETIMER: fix panic that occurs when timer_type has garbage value · 902c0b18
      Juhee Kang authored
      Currently, when the rule related to IDLETIMER is added, idletimer_tg timer
      structure is initialized by kmalloc on executing idletimer_tg_create
      function. However, in this process timer->timer_type is not defined to
      a specific value. Thus, timer->timer_type has garbage value and it occurs
      kernel panic. So, this commit fixes the panic by initializing
      timer->timer_type using kzalloc instead of kmalloc.
      
      Test commands:
          # iptables -A OUTPUT -j IDLETIMER --timeout 1 --label test
          $ cat /sys/class/xt_idletimer/timers/test
            Killed
      
      Splat looks like:
          BUG: KASAN: user-memory-access in alarm_expires_remaining+0x49/0x70
          Read of size 8 at addr 0000002e8c7bc4c8 by task cat/917
          CPU: 12 PID: 917 Comm: cat Not tainted 5.14.0+ #3 79940a339f71eb14fc81aee1757a20d5bf13eb0e
          Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.13.0-1ubuntu1.1 04/01/2014
          Call Trace:
           dump_stack_lvl+0x6e/0x9c
           kasan_report.cold+0x112/0x117
           ? alarm_expires_remaining+0x49/0x70
           __asan_load8+0x86/0xb0
           alarm_expires_remaining+0x49/0x70
           idletimer_tg_show+0xe5/0x19b [xt_IDLETIMER 11219304af9316a21bee5ba9d58f76a6b9bccc6d]
           dev_attr_show+0x3c/0x60
           sysfs_kf_seq_show+0x11d/0x1f0
           ? device_remove_bin_file+0x20/0x20
           kernfs_seq_show+0xa4/0xb0
           seq_read_iter+0x29c/0x750
           kernfs_fop_read_iter+0x25a/0x2c0
           ? __fsnotify_parent+0x3d1/0x570
           ? iov_iter_init+0x70/0x90
           new_sync_read+0x2a7/0x3d0
           ? __x64_sys_llseek+0x230/0x230
           ? rw_verify_area+0x81/0x150
           vfs_read+0x17b/0x240
           ksys_read+0xd9/0x180
           ? vfs_write+0x460/0x460
           ? do_syscall_64+0x16/0xc0
           ? lockdep_hardirqs_on+0x79/0x120
           __x64_sys_read+0x43/0x50
           do_syscall_64+0x3b/0xc0
           entry_SYSCALL_64_after_hwframe+0x44/0xae
          RIP: 0033:0x7f0cdc819142
          Code: c0 e9 c2 fe ff ff 50 48 8d 3d 3a ca 0a 00 e8 f5 19 02 00 0f 1f 44 00 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 0f 05 <48> 3d 00 f0 ff ff 77 56 c3 0f 1f 44 00 00 48 83 ec 28 48 89 54 24
          RSP: 002b:00007fff28eee5b8 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
          RAX: ffffffffffffffda RBX: 0000000000020000 RCX: 00007f0cdc819142
          RDX: 0000000000020000 RSI: 00007f0cdc032000 RDI: 0000000000000003
          RBP: 00007f0cdc032000 R08: 00007f0cdc031010 R09: 0000000000000000
          R10: 0000000000000022 R11: 0000000000000246 R12: 00005607e9ee31f0
          R13: 0000000000000003 R14: 0000000000020000 R15: 0000000000020000
      
      Fixes: 68983a35 ("netfilter: xtables: Add snapshot of hardidletimer target")
      Signed-off-by: default avatarJuhee Kang <claudiajkang@gmail.com>
      Reviewed-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      902c0b18
    • Mike Manning's avatar
      net: prefer socket bound to interface when not in VRF · 8d6c414c
      Mike Manning authored
      The commit 6da5b0f0 ("net: ensure unbound datagram socket to be
      chosen when not in a VRF") modified compute_score() so that a device
      match is always made, not just in the case of an l3mdev skb, then
      increments the score also for unbound sockets. This ensures that
      sockets bound to an l3mdev are never selected when not in a VRF.
      But as unbound and bound sockets are now scored equally, this results
      in the last opened socket being selected if there are matches in the
      default VRF for an unbound socket and a socket bound to a dev that is
      not an l3mdev. However, handling prior to this commit was to always
      select the bound socket in this case. Reinstate this handling by
      incrementing the score only for bound sockets. The required isolation
      due to choosing between an unbound socket and a socket bound to an
      l3mdev remains in place due to the device match always being made.
      The same approach is taken for compute_score() for stream sockets.
      
      Fixes: 6da5b0f0 ("net: ensure unbound datagram socket to be chosen when not in a VRF")
      Fixes: e7819058 ("net: ensure unbound stream socket to be chosen when not in a VRF")
      Signed-off-by: default avatarMike Manning <mmanning@vyatta.att-mail.com>
      Reviewed-by: default avatarDavid Ahern <dsahern@kernel.org>
      Link: https://lore.kernel.org/r/cf0a8523-b362-1edf-ee78-eef63cbbb428@gmail.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      8d6c414c
    • Jakub Kicinski's avatar
      Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf · 7671b026
      Jakub Kicinski authored
      Daniel Borkmann says:
      
      ====================
      pull-request: bpf 2021-10-07
      
      We've added 7 non-merge commits during the last 8 day(s) which contain
      a total of 8 files changed, 38 insertions(+), 21 deletions(-).
      
      The main changes are:
      
      1) Fix ARM BPF JIT to preserve caller-saved regs for DIV/MOD JIT-internal
         helper call, from Johan Almbladh.
      
      2) Fix integer overflow in BPF stack map element size calculation when
         used with preallocation, from Tatsuhiko Yasumatsu.
      
      3) Fix an AF_UNIX regression due to added BPF sockmap support related
         to shutdown handling, from Jiang Wang.
      
      4) Fix a segfault in libbpf when generating light skeletons from objects
         without BTF, from Kumar Kartikeya Dwivedi.
      
      5) Fix a libbpf memory leak in strset to free the actual struct strset
         itself, from Andrii Nakryiko.
      
      6) Dual-license bpf_insn.h similarly as we did for libbpf and bpftool,
         with ACKs from all contributors, from Luca Boccassi.
      ====================
      
      Link: https://lore.kernel.org/r/20211007135010.21143-1-daniel@iogearbox.netSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      7671b026
    • David S. Miller's avatar
      Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ · 578f3932
      David S. Miller authored
      ipsec
      
      Steffen Klassert says:
      
      ====================
      pull request (net): ipsec 2021-10-07
      
      1) Fix a sysbot reported shift-out-of-bounds in xfrm_get_default.
         From Pavel Skripkin.
      
      2) Fix XFRM_MSG_MAPPING ABI breakage. The new XFRM_MSG_MAPPING
         messages were accidentally not paced at the end.
         Fix by Eugene Syromiatnikov.
      
      3) Fix the uapi for the default policy, use explicit field and macros
         and make it accessible to userland.
         From Nicolas Dichtel.
      
      4) Fix a missing rcu lock in xfrm_notify_userpolicy().
         From Nicolas Dichtel.
      
      Please pull or let me know if there are problems.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      578f3932
    • David S. Miller's avatar
      Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net- · 65f280bb
      David S. Miller authored
      queue
      
      Tony Nguyen says:
      
      ====================
      Intel Wired LAN Driver Updates 2021-10-06
      
      This series contains updates to i40e and iavf drivers.
      
      Jiri Benc expands an error check to prevent infinite loop for i40e.
      
      Sylwester prevents freeing of uninitialized IRQ vector to resolve a
      kernel oops for i40e.
      
      Stefan Assmann fixes a double mutex unlock for iavf.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      65f280bb
  2. 06 Oct, 2021 15 commits
  3. 05 Oct, 2021 9 commits
    • Eric Dumazet's avatar
      netlink: annotate data races around nlk->bound · 7707a4d0
      Eric Dumazet authored
      While existing code is correct, KCSAN is reporting
      a data-race in netlink_insert / netlink_sendmsg [1]
      
      It is correct to read nlk->bound without a lock, as netlink_autobind()
      will acquire all needed locks.
      
      [1]
      BUG: KCSAN: data-race in netlink_insert / netlink_sendmsg
      
      write to 0xffff8881031c8b30 of 1 bytes by task 18752 on cpu 0:
       netlink_insert+0x5cc/0x7f0 net/netlink/af_netlink.c:597
       netlink_autobind+0xa9/0x150 net/netlink/af_netlink.c:842
       netlink_sendmsg+0x479/0x7c0 net/netlink/af_netlink.c:1892
       sock_sendmsg_nosec net/socket.c:703 [inline]
       sock_sendmsg net/socket.c:723 [inline]
       ____sys_sendmsg+0x360/0x4d0 net/socket.c:2392
       ___sys_sendmsg net/socket.c:2446 [inline]
       __sys_sendmsg+0x1ed/0x270 net/socket.c:2475
       __do_sys_sendmsg net/socket.c:2484 [inline]
       __se_sys_sendmsg net/socket.c:2482 [inline]
       __x64_sys_sendmsg+0x42/0x50 net/socket.c:2482
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x3d/0x90 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x44/0xae
      
      read to 0xffff8881031c8b30 of 1 bytes by task 18751 on cpu 1:
       netlink_sendmsg+0x270/0x7c0 net/netlink/af_netlink.c:1891
       sock_sendmsg_nosec net/socket.c:703 [inline]
       sock_sendmsg net/socket.c:723 [inline]
       __sys_sendto+0x2a8/0x370 net/socket.c:2019
       __do_sys_sendto net/socket.c:2031 [inline]
       __se_sys_sendto net/socket.c:2027 [inline]
       __x64_sys_sendto+0x74/0x90 net/socket.c:2027
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x3d/0x90 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x44/0xae
      
      value changed: 0x00 -> 0x01
      
      Reported by Kernel Concurrency Sanitizer on:
      CPU: 1 PID: 18751 Comm: syz-executor.0 Not tainted 5.14.0-rc1-syzkaller #0
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
      
      Fixes: da314c99 ("netlink: Replace rhash_portid with bound")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Reported-by: default avatarsyzbot <syzkaller@googlegroups.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7707a4d0
    • Wong Vee Khee's avatar
      net: pcs: xpcs: fix incorrect CL37 AN sequence · e3cf002d
      Wong Vee Khee authored
      According to Synopsys DesignWare Cores Ethernet PCS databook, it is
      required to disable Clause 37 auto-negotiation by programming bit-12
      (AN_ENABLE) to 0 if it is already enabled, before programming various
      fields of VR_MII_AN_CTRL registers.
      
      After all these programming are done, it is then required to enable
      Clause 37 auto-negotiation by programming bit-12 (AN_ENABLE) to 1.
      
      Fixes: b97b5331 ("net: pcs: add C37 SGMII AN support for intel mGbE controller")
      Cc: Vladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: default avatarWong Vee Khee <vee.khee.wong@linux.intel.com>
      Reviewed-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Tested-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e3cf002d
    • Sean Anderson's avatar
      net: sfp: Fix typo in state machine debug string · 25a9da66
      Sean Anderson authored
      The string should be "tx_disable" to match the state enum.
      
      Fixes: 4005a7cb ("net: phy: sftp: print debug message with text, not numbers")
      Signed-off-by: default avatarSean Anderson <sean.anderson@seco.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      25a9da66
    • Eric Dumazet's avatar
      net/sched: sch_taprio: properly cancel timer from taprio_destroy() · a56d447f
      Eric Dumazet authored
      There is a comment in qdisc_create() about us not calling ops->reset()
      in some cases.
      
      err_out4:
      	/*
      	 * Any broken qdiscs that would require a ops->reset() here?
      	 * The qdisc was never in action so it shouldn't be necessary.
      	 */
      
      As taprio sets a timer before actually receiving a packet, we need
      to cancel it from ops->destroy, just in case ops->reset has not
      been called.
      
      syzbot reported:
      
      ODEBUG: free active (active state 0) object type: hrtimer hint: advance_sched+0x0/0x9a0 arch/x86/include/asm/atomic64_64.h:22
      WARNING: CPU: 0 PID: 8441 at lib/debugobjects.c:505 debug_print_object+0x16e/0x250 lib/debugobjects.c:505
      Modules linked in:
      CPU: 0 PID: 8441 Comm: syz-executor813 Not tainted 5.14.0-rc6-syzkaller #0
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
      RIP: 0010:debug_print_object+0x16e/0x250 lib/debugobjects.c:505
      Code: ff df 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 af 00 00 00 48 8b 14 dd e0 d3 e3 89 4c 89 ee 48 c7 c7 e0 c7 e3 89 e8 5b 86 11 05 <0f> 0b 83 05 85 03 92 09 01 48 83 c4 18 5b 5d 41 5c 41 5d 41 5e c3
      RSP: 0018:ffffc9000130f330 EFLAGS: 00010282
      RAX: 0000000000000000 RBX: 0000000000000003 RCX: 0000000000000000
      RDX: ffff88802baeb880 RSI: ffffffff815d87b5 RDI: fffff52000261e58
      RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000
      R10: ffffffff815d25ee R11: 0000000000000000 R12: ffffffff898dd020
      R13: ffffffff89e3ce20 R14: ffffffff81653630 R15: dffffc0000000000
      FS:  0000000000f0d300(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 00007ffb64b3e000 CR3: 0000000036557000 CR4: 00000000001506e0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      Call Trace:
       __debug_check_no_obj_freed lib/debugobjects.c:987 [inline]
       debug_check_no_obj_freed+0x301/0x420 lib/debugobjects.c:1018
       slab_free_hook mm/slub.c:1603 [inline]
       slab_free_freelist_hook+0x171/0x240 mm/slub.c:1653
       slab_free mm/slub.c:3213 [inline]
       kfree+0xe4/0x540 mm/slub.c:4267
       qdisc_create+0xbcf/0x1320 net/sched/sch_api.c:1299
       tc_modify_qdisc+0x4c8/0x1a60 net/sched/sch_api.c:1663
       rtnetlink_rcv_msg+0x413/0xb80 net/core/rtnetlink.c:5571
       netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2504
       netlink_unicast_kernel net/netlink/af_netlink.c:1314 [inline]
       netlink_unicast+0x533/0x7d0 net/netlink/af_netlink.c:1340
       netlink_sendmsg+0x86d/0xdb0 net/netlink/af_netlink.c:1929
       sock_sendmsg_nosec net/socket.c:704 [inline]
       sock_sendmsg+0xcf/0x120 net/socket.c:724
       ____sys_sendmsg+0x6e8/0x810 net/socket.c:2403
       ___sys_sendmsg+0xf3/0x170 net/socket.c:2457
       __sys_sendmsg+0xe5/0x1b0 net/socket.c:2486
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
      
      Fixes: 44d4775c ("net/sched: sch_taprio: reset child qdiscs before freeing them")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Davide Caratti <dcaratti@redhat.com>
      Reported-by: default avatarsyzbot <syzkaller@googlegroups.com>
      Acked-by: default avatarVinicius Costa Gomes <vinicius.gomes@intel.com>
      Acked-by: default avatarDavide Caratti <dcaratti@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a56d447f
    • David S. Miller's avatar
      Merge branch 'bridge-fixes' · 64506cb9
      David S. Miller authored
      Eric Dumazet says:
      
      ====================
      net: bridge: br_get_linkxstats_size() fixes
      
      This patch series attempts to fix the following syzbot report.
      
      WARNING: CPU: 1 PID: 21425 at net/core/rtnetlink.c:5388 rtnl_stats_get+0x80f/0x8c0 net/core/rtnetlink.c:5388
      Modules linked in:
      CPU: 1 PID: 21425 Comm: syz-executor394 Not tainted 5.13.0-rc4-syzkaller #0
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
      RIP: 0010:rtnl_stats_get+0x80f/0x8c0 net/core/rtnetlink.c:5388
      Code: e9 9c fc ff ff 4c 89 e7 89 0c 24 e8 ab 8b a8 fa 8b 0c 24 e9 bc fc ff ff 4c 89 e7 e8 9b 8b a8 fa e9 df fe ff ff e8 61 85 63 fa <0f> 0b e9 f7 fc ff ff 41 be ea ff ff ff e9 f9 fc ff ff 41 be 97 ff
      RSP: 0018:ffffc9000cf77688 EFLAGS: 00010293
      RAX: 0000000000000000 RBX: 000000000000012c RCX: 0000000000000000
      RDX: ffff8880211754c0 RSI: ffffffff8711571f RDI: 0000000000000003
      RBP: ffff8880175aa780 R08: 00000000ffffffa6 R09: ffff88823bd5c04f
      R10: ffffffff87115413 R11: 0000000000000001 R12: ffff8880175aab74
      R13: ffff8880175aab40 R14: 00000000ffffffa6 R15: 0000000000000006
      FS:  0000000001ff9300(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 00000000005cfd58 CR3: 000000002cd43000 CR4: 00000000001506f0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      Call Trace:
       rtnetlink_rcv_msg+0x44e/0xad0 net/core/rtnetlink.c:5562
       netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2504
       netlink_unicast_kernel net/netlink/af_netlink.c:1314 [inline]
       netlink_unicast+0x533/0x7d0 net/netlink/af_netlink.c:1340
       netlink_sendmsg+0x856/0xd90 net/netlink/af_netlink.c:1929
       sock_sendmsg_nosec net/socket.c:654 [inline]
       sock_sendmsg+0xcf/0x120 net/socket.c:674
       ____sys_sendmsg+0x6e8/0x810 net/socket.c:2350
       ___sys_sendmsg+0xf3/0x170 net/socket.c:2404
       __sys_sendmsg+0xe5/0x1b0 net/socket.c:2433
       do_syscall_64+0x3a/0xb0 arch/x86/entry/common.c:47
       entry_SYSCALL_64_after_hwframe+0x44/0xae
      RIP: 0033:0x4440d9
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      64506cb9
    • Eric Dumazet's avatar
      net: bridge: fix under estimation in br_get_linkxstats_size() · 0854a051
      Eric Dumazet authored
      Commit de179966 ("net: bridge: add STP xstats")
      added an additional nla_reserve_64bit() in br_fill_linkxstats(),
      but forgot to update br_get_linkxstats_size() accordingly.
      
      This can trigger the following in rtnl_stats_get()
      
      	WARN_ON(err == -EMSGSIZE);
      
      Fixes: de179966 ("net: bridge: add STP xstats")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Vivien Didelot <vivien.didelot@gmail.com>
      Cc: Nikolay Aleksandrov <nikolay@nvidia.com>
      Acked-by: default avatarNikolay Aleksandrov <nikolay@nvidia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0854a051
    • Eric Dumazet's avatar
      net: bridge: use nla_total_size_64bit() in br_get_linkxstats_size() · dbe0b880
      Eric Dumazet authored
      bridge_fill_linkxstats() is using nla_reserve_64bit().
      
      We must use nla_total_size_64bit() instead of nla_total_size()
      for corresponding data structure.
      
      Fixes: 1080ab95 ("net: bridge: add support for IGMP/MLD stats and export them via netlink")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Nikolay Aleksandrov <nikolay@nvidia.com>
      Cc: Vivien Didelot <vivien.didelot@gmail.com>
      Acked-by: default avatarNikolay Aleksandrov <nikolay@nvidia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      dbe0b880
    • Hayes Wang's avatar
      r8152: avoid to resubmit rx immediately · baf33d7a
      Hayes Wang authored
      For the situation that the disconnect event comes very late when the
      device is unplugged, the driver would resubmit the RX bulk transfer
      after getting the callback with -EPROTO immediately and continually.
      Finally, soft lockup occurs.
      
      This patch avoids to resubmit RX immediately. It uses a workqueue to
      schedule the RX NAPI. And the NAPI would resubmit the RX. It let the
      disconnect event have opportunity to stop the submission before soft
      lockup.
      Reported-by: default avatarJason-ch Chen <jason-ch.chen@mediatek.com>
      Tested-by: default avatarJason-ch Chen <jason-ch.chen@mediatek.com>
      Signed-off-by: default avatarHayes Wang <hayeswang@realtek.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      baf33d7a
    • Jakub Kicinski's avatar
      etherdevice: use __dev_addr_set() · 3f6cffb8
      Jakub Kicinski authored
      Andrew points out that eth_hw_addr_set() replaces memcpy()
      calls so we can't use ether_addr_copy() which assumes
      both arguments are 2-bytes aligned.
      Reported-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3f6cffb8
  4. 04 Oct, 2021 1 commit
  5. 02 Oct, 2021 4 commits
  6. 01 Oct, 2021 4 commits
    • Leon Romanovsky's avatar
      MAINTAINERS: Remove Bin Luo as his email bounces · 5cfe5109
      Leon Romanovsky authored
      The emails sent to luobin9@huawei.com bounce with error:
       "Recipient address rejected: Failed recipient validation check."
      
      So let's remove his entry and change the status of hinic driver till
      someone in Huawei will step-in to maintain it again.
      Signed-off-by: default avatarLeon Romanovsky <leonro@nvidia.com>
      Link: https://lore.kernel.org/r/045a32ccf394de66b7899c8b732f44dc5f4a1154.1632978665.git.leonro@nvidia.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      5cfe5109
    • Punit Agrawal's avatar
      net: stmmac: dwmac-rk: Fix ethernet on rk3399 based devices · aec3f415
      Punit Agrawal authored
      Commit 2d26f6e3 ("net: stmmac: dwmac-rk: fix unbalanced pm_runtime_enable warnings")
      while getting rid of a runtime PM warning ended up breaking ethernet
      on rk3399 based devices. By dropping an extra reference to the device,
      the commit ends up enabling suspend / resume of the ethernet device -
      which appears to be broken.
      
      While the issue with runtime pm is being investigated, partially
      revert commit 2d26f6e3 to restore the network on rk3399.
      
      Fixes: 2d26f6e3 ("net: stmmac: dwmac-rk: fix unbalanced pm_runtime_enable warnings")
      Suggested-by: default avatarHeiko Stuebner <heiko@sntech.de>
      Signed-off-by: default avatarPunit Agrawal <punitagrawal@gmail.com>
      Cc: Michael Riesch <michael.riesch@wolfvision.net>
      Tested-by: default avatarHeiko Stuebner <heiko@sntech.de>
      Link: https://lore.kernel.org/r/20210929135049.3426058-1-punitagrawal@gmail.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      aec3f415
    • Vladimir Oltean's avatar
      net: mscc: ocelot: fix VCAP filters remaining active after being deleted · 019d9329
      Vladimir Oltean authored
      When ocelot_flower.c calls ocelot_vcap_filter_add(), the filter has a
      given filter->id.cookie. This filter is added to the block->rules list.
      
      However, when ocelot_flower.c calls ocelot_vcap_block_find_filter_by_id()
      which passes the cookie as argument, the filter is never found by
      filter->id.cookie when searching through the block->rules list.
      
      This is unsurprising, since the filter->id.cookie is an unsigned long,
      but the cookie argument provided to ocelot_vcap_block_find_filter_by_id()
      is a signed int, and the comparison fails.
      
      Fixes: 50c6cc5b ("net: mscc: ocelot: store a namespaced VCAP filter ID")
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Link: https://lore.kernel.org/r/20210930125330.2078625-1-vladimir.oltean@nxp.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      019d9329
    • Eric Dumazet's avatar
      net_sched: fix NULL deref in fifo_set_limit() · 560ee196
      Eric Dumazet authored
      syzbot reported another NULL deref in fifo_set_limit() [1]
      
      I could repro the issue with :
      
      unshare -n
      tc qd add dev lo root handle 1:0 tbf limit 200000 burst 70000 rate 100Mbit
      tc qd replace dev lo parent 1:0 pfifo_fast
      tc qd change dev lo root handle 1:0 tbf limit 300000 burst 70000 rate 100Mbit
      
      pfifo_fast does not have a change() operation.
      Make fifo_set_limit() more robust about this.
      
      [1]
      BUG: kernel NULL pointer dereference, address: 0000000000000000
      PGD 1cf99067 P4D 1cf99067 PUD 7ca49067 PMD 0
      Oops: 0010 [#1] PREEMPT SMP KASAN
      CPU: 1 PID: 14443 Comm: syz-executor959 Not tainted 5.15.0-rc3-syzkaller #0
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
      RIP: 0010:0x0
      Code: Unable to access opcode bytes at RIP 0xffffffffffffffd6.
      RSP: 0018:ffffc9000e2f7310 EFLAGS: 00010246
      RAX: dffffc0000000000 RBX: ffffffff8d6ecc00 RCX: 0000000000000000
      RDX: 0000000000000000 RSI: ffff888024c27910 RDI: ffff888071e34000
      RBP: ffff888071e34000 R08: 0000000000000001 R09: ffffffff8fcfb947
      R10: 0000000000000001 R11: 0000000000000000 R12: ffff888024c27910
      R13: ffff888071e34018 R14: 0000000000000000 R15: ffff88801ef74800
      FS:  00007f321d897700(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: ffffffffffffffd6 CR3: 00000000722c3000 CR4: 00000000003506e0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      Call Trace:
       fifo_set_limit net/sched/sch_fifo.c:242 [inline]
       fifo_set_limit+0x198/0x210 net/sched/sch_fifo.c:227
       tbf_change+0x6ec/0x16d0 net/sched/sch_tbf.c:418
       qdisc_change net/sched/sch_api.c:1332 [inline]
       tc_modify_qdisc+0xd9a/0x1a60 net/sched/sch_api.c:1634
       rtnetlink_rcv_msg+0x413/0xb80 net/core/rtnetlink.c:5572
       netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2504
       netlink_unicast_kernel net/netlink/af_netlink.c:1314 [inline]
       netlink_unicast+0x533/0x7d0 net/netlink/af_netlink.c:1340
       netlink_sendmsg+0x86d/0xdb0 net/netlink/af_netlink.c:1929
       sock_sendmsg_nosec net/socket.c:704 [inline]
       sock_sendmsg+0xcf/0x120 net/socket.c:724
       ____sys_sendmsg+0x6e8/0x810 net/socket.c:2409
       ___sys_sendmsg+0xf3/0x170 net/socket.c:2463
       __sys_sendmsg+0xe5/0x1b0 net/socket.c:2492
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x44/0xae
      
      Fixes: fb0305ce ("net-sched: consolidate default fifo qdisc setup")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Reported-by: default avatarsyzbot <syzkaller@googlegroups.com>
      Link: https://lore.kernel.org/r/20210930212239.3430364-1-eric.dumazet@gmail.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      560ee196