1. 23 Jun, 2020 13 commits
    • Alexander Lobakin's avatar
      net: qed: fix async event callbacks unregistering · 31333c1a
      Alexander Lobakin authored
      qed_spq_unregister_async_cb() should be called before
      qed_rdma_info_free() to avoid crash-spawning uses-after-free.
      Instead of calling it from each subsystem exit code, do it in one place
      on PF down.
      
      Fixes: 291d57f6 ("qed: Fix rdma_info structure allocation")
      Signed-off-by: default avatarAlexander Lobakin <alobakin@marvell.com>
      Signed-off-by: default avatarIgor Russkikh <irusskikh@marvell.com>
      Signed-off-by: default avatarMichal Kalderon <michal.kalderon@marvell.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      31333c1a
    • Alexander Lobakin's avatar
      net: qed: fix left elements count calculation · 97dd1abd
      Alexander Lobakin authored
      qed_chain_get_element_left{,_u32} returned 0 when the difference
      between producer and consumer page count was equal to the total
      page count.
      Fix this by conditional expanding of producer value (vs
      unconditional). This allowed to eliminate normalizaton against
      total page count, which was the cause of this bug.
      
      Misc: replace open-coded constants with common defines.
      
      Fixes: a91eb52a ("qed: Revisit chain implementation")
      Signed-off-by: default avatarAlexander Lobakin <alobakin@marvell.com>
      Signed-off-by: default avatarIgor Russkikh <irusskikh@marvell.com>
      Signed-off-by: default avatarMichal Kalderon <michal.kalderon@marvell.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      97dd1abd
    • Alexander Lobakin's avatar
      net: ethtool: add missing string for NETIF_F_GSO_TUNNEL_REMCSUM · b4730ae6
      Alexander Lobakin authored
      Commit e585f236 ("udp: Changes to udp_offload to support remote
      checksum offload") added new GSO type and a corresponding netdev
      feature, but missed Ethtool's 'netdev_features_strings' table.
      Give it a name so it will be exposed to userspace and become available
      for manual configuration.
      
      v3:
       - decouple from "netdev_features_strings[] cleanup" series;
       - no functional changes.
      
      v2:
       - don't split the "Fixes:" tag across lines;
       - no functional changes.
      
      Fixes: e585f236 ("udp: Changes to udp_offload to support remote checksum offload")
      Signed-off-by: default avatarAlexander Lobakin <alobakin@pm.me>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b4730ae6
    • David S. Miller's avatar
      Merge branch 'wg-fixes' · 2bcd3502
      David S. Miller authored
      Jason A. Donenfeld says:
      
      ====================
      wireguard fixes for 5.8-rc3
      
      This series contains two fixes, one cosmetic and one quite important:
      
      1) Avoid the `if ((x = f()) == y)` pattern, from Frank
         Werner-Krippendorf.
      
      2) Mitigate a potential memory leak by creating circular netns
         references, while also making the netns semantics a bit more
         robust.
      
      Patch (2) has a "Fixes:" line and should be backported to stable.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2bcd3502
    • Jason A. Donenfeld's avatar
      wireguard: device: avoid circular netns references · 900575aa
      Jason A. Donenfeld authored
      Before, we took a reference to the creating netns if the new netns was
      different. This caused issues with circular references, with two
      wireguard interfaces swapping namespaces. The solution is to rather not
      take any extra references at all, but instead simply invalidate the
      creating netns pointer when that netns is deleted.
      
      In order to prevent this from happening again, this commit improves the
      rough object leak tracking by allowing it to account for created and
      destroyed interfaces, aside from just peers and keys. That then makes it
      possible to check for the object leak when having two interfaces take a
      reference to each others' namespaces.
      
      Fixes: e7096c13 ("net: WireGuard secure network tunnel")
      Signed-off-by: default avatarJason A. Donenfeld <Jason@zx2c4.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      900575aa
    • Frank Werner-Krippendorf's avatar
      wireguard: noise: do not assign initiation time in if condition · 558b353c
      Frank Werner-Krippendorf authored
      Fixes an error condition reported by checkpatch.pl which caused by
      assigning a variable in an if condition in wg_noise_handshake_consume_
      initiation().
      Signed-off-by: default avatarFrank Werner-Krippendorf <mail@hb9fxq.ch>
      Signed-off-by: default avatarJason A. Donenfeld <Jason@zx2c4.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      558b353c
    • David S. Miller's avatar
      Merge branch 'bridge-mrp-Update-MRP_PORT_ROLE' · f7fb92ac
      David S. Miller authored
      Horatiu Vultur says:
      
      ====================
      bridge: mrp: Update MRP_PORT_ROLE
      
      This patch series does the following:
      - fixes the enum br_mrp_port_role_type. It removes the port role none(0x2)
        because this is in conflict with the standard. The standard defines the
        interconnect port role as value 0x2.
      - adds checks regarding current defined port roles: primary(0x0) and
        secondary(0x1).
      
      v2:
       - add the validation code when setting the port role.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f7fb92ac
    • Horatiu Vultur's avatar
      bridge: mrp: Validate when setting the port role · 7882c895
      Horatiu Vultur authored
      This patch adds specific checks for primary(0x0) and secondary(0x1) when
      setting the port role. For any other value the function
      'br_mrp_set_port_role' will return -EINVAL.
      
      Fixes: 20f6a05e ("bridge: mrp: Rework the MRP netlink interface")
      Signed-off-by: default avatarHoratiu Vultur <horatiu.vultur@microchip.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7882c895
    • Horatiu Vultur's avatar
      bridge: uapi: mrp: Fix MRP_PORT_ROLE · 2464bc7c
      Horatiu Vultur authored
      Currently the MRP_PORT_ROLE_NONE has the value 0x2 but this is in conflict
      with the IEC 62439-2 standard. The standard defines the following port
      roles: primary (0x0), secondary(0x1), interconnect(0x2).
      Therefore remove the port role none.
      
      Fixes: 4714d137 ("bridge: uapi: mrp: Add mrp attributes.")
      Signed-off-by: default avatarHoratiu Vultur <horatiu.vultur@microchip.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2464bc7c
    • Aiden Leong's avatar
      GUE: Fix a typo · 26ac10be
      Aiden Leong authored
      Fix a typo in gue.h
      Signed-off-by: default avatarAiden Leong <aiden.leong@aibsd.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      26ac10be
    • Geliang Tang's avatar
      mptcp: drop sndr_key in mptcp_syn_options · b562f58b
      Geliang Tang authored
      In RFC 8684, we don't need to send sndr_key in SYN package anymore, so drop
      it.
      
      Fixes: cc7972ea ("mptcp: parse and emit MP_CAPABLE option according to v1 spec")
      Signed-off-by: default avatarGeliang Tang <geliangtang@gmail.com>
      Reviewed-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b562f58b
    • Gaurav Singh's avatar
      ethtool: Fix check in ethtool_rx_flow_rule_create · 21a739c6
      Gaurav Singh authored
      Fix check in ethtool_rx_flow_rule_create
      
      Fixes: eca4205f ("ethtool: add ethtool_rx_flow_spec to flow_rule structure translator")
      Signed-off-by: default avatarGaurav Singh <gaurav1086@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      21a739c6
    • Taehee Yoo's avatar
      hsr: avoid to create proc file after unregister · de0083c7
      Taehee Yoo authored
      When an interface is being deleted, "/proc/net/dev_snmp6/<interface name>"
      is deleted.
      The function for this is addrconf_ifdown() in the addrconf_notify() and
      it is called by notification, which is NETDEV_UNREGISTER.
      But, if NETDEV_CHANGEMTU is triggered after NETDEV_UNREGISTER,
      this proc file will be created again.
      This recreated proc file will be deleted by netdev_wati_allrefs().
      Before netdev_wait_allrefs() is called, creating a new HSR interface
      routine can be executed and It tries to create a proc file but it will
      find an un-deleted proc file.
      At this point, it warns about it.
      
      To avoid this situation, it can use ->dellink() instead of
      ->ndo_uninit() to release resources because ->dellink() is called
      before NETDEV_UNREGISTER.
      So, a proc file will not be recreated.
      
      Test commands
          ip link add dummy0 type dummy
          ip link add dummy1 type dummy
          ip link set dummy0 mtu 1300
      
          #SHELL1
          while :
          do
              ip link add hsr0 type hsr slave1 dummy0 slave2 dummy1
          done
      
          #SHELL2
          while :
          do
              ip link del hsr0
          done
      
      Splat looks like:
      [ 9888.980852][ T2752] proc_dir_entry 'dev_snmp6/hsr0' already registered
      [ 9888.981797][    C2] WARNING: CPU: 2 PID: 2752 at fs/proc/generic.c:372 proc_register+0x2d5/0x430
      [ 9888.981798][    C2] Modules linked in: hsr dummy veth openvswitch nsh nf_conncount nf_nat nf_conntrack nf_defrag_ipv6x
      [ 9888.981814][    C2] CPU: 2 PID: 2752 Comm: ip Tainted: G        W         5.8.0-rc1+ #616
      [ 9888.981815][    C2] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006
      [ 9888.981816][    C2] RIP: 0010:proc_register+0x2d5/0x430
      [ 9888.981818][    C2] Code: fc ff df 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 65 01 00 00 49 8b b5 e0 00 00 00 48 89 ea 40
      [ 9888.981819][    C2] RSP: 0018:ffff8880628dedf0 EFLAGS: 00010286
      [ 9888.981821][    C2] RAX: dffffc0000000008 RBX: ffff888028c69170 RCX: ffffffffaae09a62
      [ 9888.981822][    C2] RDX: 0000000000000001 RSI: 0000000000000008 RDI: ffff88806c9f75ac
      [ 9888.981823][    C2] RBP: ffff888028c693f4 R08: ffffed100d9401bd R09: ffffed100d9401bd
      [ 9888.981824][    C2] R10: ffffffffaddf406f R11: 0000000000000001 R12: ffff888028c69308
      [ 9888.981825][    C2] R13: ffff8880663584c8 R14: dffffc0000000000 R15: ffffed100518d27e
      [ 9888.981827][    C2] FS:  00007f3876b3b0c0(0000) GS:ffff88806c800000(0000) knlGS:0000000000000000
      [ 9888.981828][    C2] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [ 9888.981829][    C2] CR2: 00007f387601a8c0 CR3: 000000004101a002 CR4: 00000000000606e0
      [ 9888.981830][    C2] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [ 9888.981831][    C2] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      [ 9888.981832][    C2] Call Trace:
      [ 9888.981833][    C2]  ? snmp6_seq_show+0x180/0x180
      [ 9888.981834][    C2]  proc_create_single_data+0x7c/0xa0
      [ 9888.981835][    C2]  snmp6_register_dev+0xb0/0x130
      [ 9888.981836][    C2]  ipv6_add_dev+0x4b7/0xf60
      [ 9888.981837][    C2]  addrconf_notify+0x684/0x1ca0
      [ 9888.981838][    C2]  ? __mutex_unlock_slowpath+0xd0/0x670
      [ 9888.981839][    C2]  ? kasan_unpoison_shadow+0x30/0x40
      [ 9888.981840][    C2]  ? wait_for_completion+0x250/0x250
      [ 9888.981841][    C2]  ? inet6_ifinfo_notify+0x100/0x100
      [ 9888.981842][    C2]  ? dropmon_net_event+0x227/0x410
      [ 9888.981843][    C2]  ? notifier_call_chain+0x90/0x160
      [ 9888.981844][    C2]  ? inet6_ifinfo_notify+0x100/0x100
      [ 9888.981845][    C2]  notifier_call_chain+0x90/0x160
      [ 9888.981846][    C2]  register_netdevice+0xbe5/0x1070
      [ ... ]
      
      Reported-by: syzbot+1d51c8b74efa4c44adeb@syzkaller.appspotmail.com
      Fixes: e0a4b997 ("hsr: use upper/lower device infrastructure")
      Signed-off-by: default avatarTaehee Yoo <ap420073@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      de0083c7
  2. 22 Jun, 2020 4 commits
    • Tuomas Tynkkynen's avatar
      usbnet: smsc95xx: Fix use-after-free after removal · b835a71e
      Tuomas Tynkkynen authored
      Syzbot reports an use-after-free in workqueue context:
      
      BUG: KASAN: use-after-free in mutex_unlock+0x19/0x40 kernel/locking/mutex.c:737
       mutex_unlock+0x19/0x40 kernel/locking/mutex.c:737
       __smsc95xx_mdio_read drivers/net/usb/smsc95xx.c:217 [inline]
       smsc95xx_mdio_read+0x583/0x870 drivers/net/usb/smsc95xx.c:278
       check_carrier+0xd1/0x2e0 drivers/net/usb/smsc95xx.c:644
       process_one_work+0x777/0xf90 kernel/workqueue.c:2274
       worker_thread+0xa8f/0x1430 kernel/workqueue.c:2420
       kthread+0x2df/0x300 kernel/kthread.c:255
      
      It looks like that smsc95xx_unbind() is freeing the structures that are
      still in use by the concurrently running workqueue callback. Thus switch
      to using cancel_delayed_work_sync() to ensure the work callback really
      is no longer active.
      
      Reported-by: syzbot+29dc7d4ae19b703ff947@syzkaller.appspotmail.com
      Signed-off-by: default avatarTuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b835a71e
    • Ido Schimmel's avatar
      mlxsw: spectrum: Do not rely on machine endianness · f3fe412b
      Ido Schimmel authored
      The second commit cited below performed a cast of 'u32 buffsize' to
      '(u16 *)' when calling mlxsw_sp_port_headroom_8x_adjust():
      
      mlxsw_sp_port_headroom_8x_adjust(mlxsw_sp_port, (u16 *) &buffsize);
      
      Colin noted that this will behave differently on big endian
      architectures compared to little endian architectures.
      
      Fix this by following Colin's suggestion and have the function accept
      and return 'u32' instead of passing the current size by reference.
      
      Fixes: da382875 ("mlxsw: spectrum: Extend to support Spectrum-3 ASIC")
      Fixes: 60833d54 ("mlxsw: spectrum: Adjust headroom buffers for 8x ports")
      Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Reported-by: default avatarColin Ian King <colin.king@canonical.com>
      Suggested-by: default avatarColin Ian King <colin.king@canonical.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f3fe412b
    • Dejin Zheng's avatar
      net: phy: smsc: fix printing too many logs · 6d61f483
      Dejin Zheng authored
      Commit 7ae7ad2f ("net: phy: smsc: use phy_read_poll_timeout()
      to simplify the code") will print a lot of logs as follows when Ethernet
      cable is not connected:
      
      [    4.473105] SMSC LAN8710/LAN8720 2188000.ethernet-1:00: lan87xx_read_status failed: -110
      
      When wait 640 ms for check ENERGYON bit, the timeout should not be
      regarded as an actual error and an error message also should not be
      printed. due to a hardware bug in LAN87XX device, it leads to unstable
      detection of plugging in Ethernet cable when LAN87xx is in Energy Detect
      Power-Down mode. the workaround for it involves, when the link is down,
      and at each read_status() call:
      
      - disable EDPD mode, forcing the PHY out of low-power mode
      - waiting 640ms to see if we have any energy detected from the media
      - re-enable entry to EDPD mode
      
      This is presumably enough to allow the PHY to notice that a cable is
      connected, and resume normal operations to negotiate with the partner.
      The problem is that when no media is detected, the 640ms wait times
      out and this commit was modified to prints an error message. it is an
      inappropriate conversion by used phy_read_poll_timeout() to introduce
      this bug. so fix this issue by use read_poll_timeout() to replace
      phy_read_poll_timeout().
      
      Fixes: 7ae7ad2f ("net: phy: smsc: use phy_read_poll_timeout() to simplify the code")
      Reported-by: default avatarKevin Groeneveld <kgroeneveld@gmail.com>
      Signed-off-by: default avatarDejin Zheng <zhengdejin5@gmail.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6d61f483
    • Felix Fietkau's avatar
      MAINTAINERS: update email address for Felix Fietkau · b0c34bde
      Felix Fietkau authored
      The old address has been bouncing for a while now
      Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b0c34bde
  3. 21 Jun, 2020 7 commits
    • Rob Gill's avatar
      net: Add MODULE_DESCRIPTION entries to network modules · 67c20de3
      Rob Gill authored
      The user tool modinfo is used to get information on kernel modules, including a
      description where it is available.
      
      This patch adds a brief MODULE_DESCRIPTION to the following modules:
      
      9p
      drop_monitor
      esp4_offload
      esp6_offload
      fou
      fou6
      ila
      sch_fq
      sch_fq_codel
      sch_hhf
      Signed-off-by: default avatarRob Gill <rrobgill@protonmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      67c20de3
    • David Howells's avatar
      rxrpc: Fix notification call on completion of discarded calls · 0041cd5a
      David Howells authored
      When preallocated service calls are being discarded, they're passed to
      ->discard_new_call() to have the caller clean up any attached higher-layer
      preallocated pieces before being marked completed.  However, the act of
      marking them completed now invokes the call's notification function - which
      causes a problem because that function might assume that the previously
      freed pieces of memory are still there.
      
      Fix this by setting a dummy notification function on the socket after
      calling ->discard_new_call().
      
      This results in the following kasan message when the kafs module is
      removed.
      
      ==================================================================
      BUG: KASAN: use-after-free in afs_wake_up_async_call+0x6aa/0x770 fs/afs/rxrpc.c:707
      Write of size 1 at addr ffff8880946c39e4 by task kworker/u4:1/21
      
      CPU: 0 PID: 21 Comm: kworker/u4:1 Not tainted 5.8.0-rc1-syzkaller #0
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
      Workqueue: netns cleanup_net
      Call Trace:
       __dump_stack lib/dump_stack.c:77 [inline]
       dump_stack+0x18f/0x20d lib/dump_stack.c:118
       print_address_description.constprop.0.cold+0xd3/0x413 mm/kasan/report.c:383
       __kasan_report mm/kasan/report.c:513 [inline]
       kasan_report.cold+0x1f/0x37 mm/kasan/report.c:530
       afs_wake_up_async_call+0x6aa/0x770 fs/afs/rxrpc.c:707
       rxrpc_notify_socket+0x1db/0x5d0 net/rxrpc/recvmsg.c:40
       __rxrpc_set_call_completion.part.0+0x172/0x410 net/rxrpc/recvmsg.c:76
       __rxrpc_call_completed net/rxrpc/recvmsg.c:112 [inline]
       rxrpc_call_completed+0xca/0xf0 net/rxrpc/recvmsg.c:111
       rxrpc_discard_prealloc+0x781/0xab0 net/rxrpc/call_accept.c:233
       rxrpc_listen+0x147/0x360 net/rxrpc/af_rxrpc.c:245
       afs_close_socket+0x95/0x320 fs/afs/rxrpc.c:110
       afs_net_exit+0x1bc/0x310 fs/afs/main.c:155
       ops_exit_list.isra.0+0xa8/0x150 net/core/net_namespace.c:186
       cleanup_net+0x511/0xa50 net/core/net_namespace.c:603
       process_one_work+0x965/0x1690 kernel/workqueue.c:2269
       worker_thread+0x96/0xe10 kernel/workqueue.c:2415
       kthread+0x3b5/0x4a0 kernel/kthread.c:291
       ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:293
      
      Allocated by task 6820:
       save_stack+0x1b/0x40 mm/kasan/common.c:48
       set_track mm/kasan/common.c:56 [inline]
       __kasan_kmalloc mm/kasan/common.c:494 [inline]
       __kasan_kmalloc.constprop.0+0xbf/0xd0 mm/kasan/common.c:467
       kmem_cache_alloc_trace+0x153/0x7d0 mm/slab.c:3551
       kmalloc include/linux/slab.h:555 [inline]
       kzalloc include/linux/slab.h:669 [inline]
       afs_alloc_call+0x55/0x630 fs/afs/rxrpc.c:141
       afs_charge_preallocation+0xe9/0x2d0 fs/afs/rxrpc.c:757
       afs_open_socket+0x292/0x360 fs/afs/rxrpc.c:92
       afs_net_init+0xa6c/0xe30 fs/afs/main.c:125
       ops_init+0xaf/0x420 net/core/net_namespace.c:151
       setup_net+0x2de/0x860 net/core/net_namespace.c:341
       copy_net_ns+0x293/0x590 net/core/net_namespace.c:482
       create_new_namespaces+0x3fb/0xb30 kernel/nsproxy.c:110
       unshare_nsproxy_namespaces+0xbd/0x1f0 kernel/nsproxy.c:231
       ksys_unshare+0x43d/0x8e0 kernel/fork.c:2983
       __do_sys_unshare kernel/fork.c:3051 [inline]
       __se_sys_unshare kernel/fork.c:3049 [inline]
       __x64_sys_unshare+0x2d/0x40 kernel/fork.c:3049
       do_syscall_64+0x60/0xe0 arch/x86/entry/common.c:359
       entry_SYSCALL_64_after_hwframe+0x44/0xa9
      
      Freed by task 21:
       save_stack+0x1b/0x40 mm/kasan/common.c:48
       set_track mm/kasan/common.c:56 [inline]
       kasan_set_free_info mm/kasan/common.c:316 [inline]
       __kasan_slab_free+0xf7/0x140 mm/kasan/common.c:455
       __cache_free mm/slab.c:3426 [inline]
       kfree+0x109/0x2b0 mm/slab.c:3757
       afs_put_call+0x585/0xa40 fs/afs/rxrpc.c:190
       rxrpc_discard_prealloc+0x764/0xab0 net/rxrpc/call_accept.c:230
       rxrpc_listen+0x147/0x360 net/rxrpc/af_rxrpc.c:245
       afs_close_socket+0x95/0x320 fs/afs/rxrpc.c:110
       afs_net_exit+0x1bc/0x310 fs/afs/main.c:155
       ops_exit_list.isra.0+0xa8/0x150 net/core/net_namespace.c:186
       cleanup_net+0x511/0xa50 net/core/net_namespace.c:603
       process_one_work+0x965/0x1690 kernel/workqueue.c:2269
       worker_thread+0x96/0xe10 kernel/workqueue.c:2415
       kthread+0x3b5/0x4a0 kernel/kthread.c:291
       ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:293
      
      The buggy address belongs to the object at ffff8880946c3800
       which belongs to the cache kmalloc-1k of size 1024
      The buggy address is located 484 bytes inside of
       1024-byte region [ffff8880946c3800, ffff8880946c3c00)
      The buggy address belongs to the page:
      page:ffffea000251b0c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0
      flags: 0xfffe0000000200(slab)
      raw: 00fffe0000000200 ffffea0002546508 ffffea00024fa248 ffff8880aa000c40
      raw: 0000000000000000 ffff8880946c3000 0000000100000002 0000000000000000
      page dumped because: kasan: bad access detected
      
      Memory state around the buggy address:
       ffff8880946c3880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
       ffff8880946c3900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
      >ffff8880946c3980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                             ^
       ffff8880946c3a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
       ffff8880946c3a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
      ==================================================================
      
      Reported-by: syzbot+d3eccef36ddbd02713e9@syzkaller.appspotmail.com
      Fixes: 5ac0d622 ("rxrpc: Fix missing notification")
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0041cd5a
    • David S. Miller's avatar
      Merge tag 'ieee802154-for-davem-2020-06-19' of... · 7fcaf731
      David S. Miller authored
      Merge tag 'ieee802154-for-davem-2020-06-19' of git://git.kernel.org/pub/scm/linux/kernel/git/sschmidt/wpan
      
      Stefan Schmidt says:
      
      ====================
      pull-request: ieee802154 for net 2020-06-19
      
      An update from ieee802154 for your *net* tree.
      
      Just two small maintenance fixes to update references to the new project
      homepage.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7fcaf731
    • Hangbin Liu's avatar
      tc-testing: update geneve options match in tunnel_key unit tests · 54eeea0d
      Hangbin Liu authored
      Since iproute2 commit f72c3ad00f3b ("tc: m_tunnel_key: add options
      support for vxlan"), the geneve opt output use key word "geneve_opts"
      instead of "geneve_opt". To make compatibility for both old and new
      iproute2, let's accept both "geneve_opt" and "geneve_opts".
      Suggested-by: default avatarDavide Caratti <dcaratti@redhat.com>
      Signed-off-by: default avatarHangbin Liu <liuhangbin@gmail.com>
      Reviewed-by: default avatarSimon Horman <simon.horman@netronome.com>
      Tested-by: default avatarDavide Caratti <dcaratti@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      54eeea0d
    • Heiner Kallweit's avatar
      r8169: fix firmware not resetting tp->ocp_base · 89fbd26c
      Heiner Kallweit authored
      Typically the firmware takes care that tp->ocp_base is reset to its
      default value. That's not the case (at least) for RTL8117.
      As a result subsequent PHY access reads/writes the wrong page and
      the link is broken. Fix this be resetting tp->ocp_base explicitly.
      
      Fixes: 229c1e0d ("r8169: load firmware for RTL8168fp/RTL8117")
      Reported-by: default avatarAaron Ma <mapengyu@gmail.com>
      Tested-by: default avatarAaron Ma <mapengyu@gmail.com>
      Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      89fbd26c
    • Dany Madden's avatar
      ibmvnic: continue to init in CRQ reset returns H_CLOSED · 8b40eb73
      Dany Madden authored
      Continue the reset path when partner adapter is not ready or H_CLOSED is
      returned from reset crq. This patch allows the CRQ init to proceed to
      establish a valid CRQ for traffic to flow after reset.
      Signed-off-by: default avatarDany Madden <drt@linux.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8b40eb73
    • Shannon Nelson's avatar
      ionic: tame the watchdog timer on reconfig · b59eabd2
      Shannon Nelson authored
      Even with moving netif_tx_disable() to an earlier point when
      taking down the queues for a reconfiguration, we still end
      up with the occasional netdev watchdog Tx Timeout complaint.
      The old method of using netif_trans_update() works fine for
      queue 0, but has no effect on the remaining queues.  Using
      netif_device_detach() allows us to signal to the watchdog to
      ignore us for the moment.
      
      Fixes: beead698 ("ionic: Add the basic NDO callbacks for netdev support")
      Signed-off-by: default avatarShannon Nelson <snelson@pensando.io>
      Acked-by: default avatarJonathan Toppins <jtoppins@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b59eabd2
  4. 20 Jun, 2020 11 commits
    • Willem de Bruijn's avatar
      selftests/net: report etf errors correctly · ca882609
      Willem de Bruijn authored
      The ETF qdisc can queue skbs that it could not pace on the errqueue.
      
      Address a few issues in the selftest
      
      - recv buffer size was too small, and incorrectly calculated
      - compared errno to ee_code instead of ee_errno
      - missed invalid request error type
      
      v2:
        - fix a few checkpatch --strict indentation warnings
      
      Fixes: ea6a5476 ("selftests/net: make so_txtime more robust to timer variance")
      Signed-off-by: default avatarWillem de Bruijn <willemb@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ca882609
    • Thomas Falcon's avatar
      ibmveth: Fix max MTU limit · 5948378b
      Thomas Falcon authored
      The max MTU limit defined for ibmveth is not accounting for
      virtual ethernet buffer overhead, which is twenty-two additional
      bytes set aside for the ethernet header and eight additional bytes
      of an opaque handle reserved for use by the hypervisor. Update the
      max MTU to reflect this overhead.
      
      Fixes: d894be57 ("ethernet: use net core MTU range checking in more drivers")
      Fixes: 110447f8 ("ethernet: fix min/max MTU typos")
      Signed-off-by: default avatarThomas Falcon <tlfalcon@linux.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5948378b
    • David S. Miller's avatar
      Merge branch 'several-fixes-for-indirect-flow_blocks-offload' · 95dcd892
      David S. Miller authored
      wenxu says:
      
      ====================
      several fixes for indirect flow_blocks offload
      
      v2:
      patch2: store the cb_priv of representor to the flow_block_cb->indr.cb_priv
      in the driver. And make the correct check with the statments
      this->indr.cb_priv == cb_priv
      
      patch4: del the driver list only in the indriect cleanup callbacks
      
      v3:
      add the cover letter and changlogs.
      
      v4:
      collapsed 1/4, 2/4, 4/4 in v3 to one fix
      Add the prepare patch 1 and 2
      
      v5:
      patch1: place flow_indr_block_cb_alloc() right before
      flow_indr_dev_setup_offload() to avoid moving flow_block_indr_init()
      
      This series fixes commit 1fac52da ("net: flow_offload: consolidate
      indirect flow_block infrastructure") that revists the flow_block
      infrastructure.
      
      patch #1 #2: prepare for fix patch #3
      add and use flow_indr_block_cb_alloc/remove function
      
      patch #3: fix flow_indr_dev_unregister path
      If the representor is removed, then identify the indirect flow_blocks
      that need to be removed by the release callback and the port representor
      structure. To identify the port representor structure, a new
      indr.cb_priv field needs to be introduced. The flow_block also needs to
      be removed from the driver list from the cleanup path
      
      patch#4 fix block->nooffloaddevcnt warning dmesg log.
      When a indr device add in offload success. The block->nooffloaddevcnt
      should be 0. After the representor go away. When the dir device go away
      the flow_block UNBIND operation with -EOPNOTSUPP which lead the warning
      demesg log.
      The block->nooffloaddevcnt should always count for indr block.
      even the indr block offload successful. The representor maybe
      gone away and the ingress qdisc can work in software mode.
      ====================
      Reviewed-by: default avatarSimon Horman <simon.horman@netronome.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      95dcd892
    • wenxu's avatar
      net/sched: cls_api: fix nooffloaddevcnt warning dmesg log · 3c005110
      wenxu authored
      The block->nooffloaddevcnt should always count for indr block.
      even the indr block offload successful. The representor maybe
      gone away and the ingress qdisc can work in software mode.
      
      block->nooffloaddevcnt warning with following dmesg log:
      
      [  760.667058] #####################################################
      [  760.668186] ## TEST test-ecmp-add-vxlan-encap-disable-sriov.sh ##
      [  760.669179] #####################################################
      [  761.780655] :test: Fedora 30 (Thirty)
      [  761.783794] :test: Linux reg-r-vrt-018-180 5.7.0+
      [  761.822890] :test: NIC ens1f0 FW 16.26.6000 PCI 0000:81:00.0 DEVICE 0x1019 ConnectX-5 Ex
      [  761.860244] mlx5_core 0000:81:00.0 ens1f0: Link up
      [  761.880693] IPv6: ADDRCONF(NETDEV_CHANGE): ens1f0: link becomes ready
      [  762.059732] mlx5_core 0000:81:00.1 ens1f1: Link up
      [  762.234341] :test: unbind vfs of ens1f0
      [  762.257825] :test: Change ens1f0 eswitch (0000:81:00.0) mode to switchdev
      [  762.291363] :test: unbind vfs of ens1f1
      [  762.306914] :test: Change ens1f1 eswitch (0000:81:00.1) mode to switchdev
      [  762.309237] mlx5_core 0000:81:00.1: E-Switch: Disable: mode(LEGACY), nvfs(2), active vports(3)
      [  763.282598] mlx5_core 0000:81:00.1: E-Switch: Supported tc offload range - chains: 4294967294, prios: 4294967295
      [  763.362825] mlx5_core 0000:81:00.1: MLX5E: StrdRq(1) RqSz(8) StrdSz(2048) RxCqeCmprss(0)
      [  763.444465] mlx5_core 0000:81:00.1 ens1f1: renamed from eth0
      [  763.460088] mlx5_core 0000:81:00.1: MLX5E: StrdRq(1) RqSz(8) StrdSz(2048) RxCqeCmprss(0)
      [  763.502586] mlx5_core 0000:81:00.1: MLX5E: StrdRq(1) RqSz(8) StrdSz(2048) RxCqeCmprss(0)
      [  763.552429] ens1f1_0: renamed from eth0
      [  763.569569] mlx5_core 0000:81:00.1: E-Switch: Enable: mode(OFFLOADS), nvfs(2), active vports(3)
      [  763.629694] ens1f1_1: renamed from eth1
      [  764.631552] IPv6: ADDRCONF(NETDEV_CHANGE): ens1f1_0: link becomes ready
      [  764.670841] :test: unbind vfs of ens1f0
      [  764.681966] :test: unbind vfs of ens1f1
      [  764.726762] mlx5_core 0000:81:00.0 ens1f0: Link up
      [  764.766511] mlx5_core 0000:81:00.1 ens1f1: Link up
      [  764.797325] :test: Add multipath vxlan encap rule and disable sriov
      [  764.798544] :test: config multipath route
      [  764.812732] mlx5_core 0000:81:00.0: lag map port 1:2 port 2:2
      [  764.874556] mlx5_core 0000:81:00.0: modify lag map port 1:1 port 2:2
      [  765.603681] :test: OK
      [  765.659048] IPv6: ADDRCONF(NETDEV_CHANGE): ens1f1_1: link becomes ready
      [  765.675085] :test: verify rule in hw
      [  765.694237] IPv6: ADDRCONF(NETDEV_CHANGE): ens1f0: link becomes ready
      [  765.711892] IPv6: ADDRCONF(NETDEV_CHANGE): ens1f1: link becomes ready
      [  766.979230] :test: OK
      [  768.125419] :test: OK
      [  768.127519] :test: - disable sriov ens1f1
      [  768.131160] pci 0000:81:02.2: Removing from iommu group 75
      [  768.132646] pci 0000:81:02.3: Removing from iommu group 76
      [  769.179749] mlx5_core 0000:81:00.1: E-Switch: Disable: mode(OFFLOADS), nvfs(2), active vports(3)
      [  769.455627] mlx5_core 0000:81:00.0: modify lag map port 1:1 port 2:1
      [  769.703990] mlx5_core 0000:81:00.1: MLX5E: StrdRq(1) RqSz(8) StrdSz(2048) RxCqeCmprss(0)
      [  769.988637] mlx5_core 0000:81:00.1 ens1f1: renamed from eth0
      [  769.990022] :test: - disable sriov ens1f0
      [  769.994922] pci 0000:81:00.2: Removing from iommu group 73
      [  769.997048] pci 0000:81:00.3: Removing from iommu group 74
      [  771.035813] mlx5_core 0000:81:00.0: E-Switch: Disable: mode(OFFLOADS), nvfs(2), active vports(3)
      [  771.339091] ------------[ cut here ]------------
      [  771.340812] WARNING: CPU: 6 PID: 3448 at net/sched/cls_api.c:749 tcf_block_offload_unbind.isra.0+0x5c/0x60
      [  771.341728] Modules linked in: act_mirred act_tunnel_key cls_flower dummy vxlan ip6_udp_tunnel udp_tunnel sch_ingress nfsv3 nfs_acl nfs lockd grace fscache tun bridge stp llc sunrpc rdma_ucm rdma_cm iw_cm ib_cm mlx5_ib ib_uverbs ib_core mlx5_core intel_rapl_msr intel_rapl_common sb_edac x86_pkg_temp_thermal intel_powerclamp coretemp mlxfw act_ct nf_flow_table kvm_intel nf_nat kvm nf_conntrack irqbypass crct10dif_pclmul igb crc32_pclmul nf_defrag_ipv6 libcrc32c nf_defrag_ipv4 crc32c_intel ghash_clmulni_intel ptp ipmi_ssif intel_cstate pps_c
      ore ses intel_uncore mei_me iTCO_wdt joydev ipmi_si iTCO_vendor_support i2c_i801 enclosure mei ioatdma dca lpc_ich wmi ipmi_devintf pcspkr acpi_power_meter ipmi_msghandler acpi_pad ast i2c_algo_bit drm_vram_helper drm_kms_helper drm_ttm_helper ttm drm mpt3sas raid_class scsi_transport_sas
      [  771.347818] CPU: 6 PID: 3448 Comm: test-ecmp-add-v Not tainted 5.7.0+ #1146
      [  771.348727] Hardware name: Supermicro SYS-2028TP-DECR/X10DRT-P, BIOS 2.0b 03/30/2017
      [  771.349646] RIP: 0010:tcf_block_offload_unbind.isra.0+0x5c/0x60
      [  771.350553] Code: 4a fd ff ff 83 f8 a1 74 0e 5b 4c 89 e7 5d 41 5c 41 5d e9 07 93 89 ff 8b 83 a0 00 00 00 8d 50 ff 89 93 a0 00 00 00 85 c0 75 df <0f> 0b eb db 0f 1f 44 00 00 41 57 41 56 41 55 41 89 cd 41 54 49 89
      [  771.352420] RSP: 0018:ffffb33144cd3b00 EFLAGS: 00010246
      [  771.353353] RAX: 0000000000000000 RBX: ffff8b37cf4b2800 RCX: 0000000000000000
      [  771.354294] RDX: 00000000ffffffff RSI: ffff8b3b9aad0000 RDI: ffffffff8d5c6e20
      [  771.355245] RBP: ffff8b37eb546948 R08: ffffffffc0b7a348 R09: ffff8b3b9aad0000
      [  771.356189] R10: 0000000000000001 R11: ffff8b3ba7a0a1c0 R12: ffff8b37cf4b2850
      [  771.357123] R13: ffff8b3b9aad0000 R14: ffff8b37cf4b2820 R15: ffff8b37cf4b2820
      [  771.358039] FS:  00007f8a19b6e740(0000) GS:ffff8b3befa00000(0000) knlGS:0000000000000000
      [  771.358965] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [  771.359885] CR2: 00007f3afb91c1a0 CR3: 000000045133c004 CR4: 00000000001606e0
      [  771.360825] Call Trace:
      [  771.361764]  __tcf_block_put+0x84/0x150
      [  771.362712]  ingress_destroy+0x1b/0x20 [sch_ingress]
      [  771.363658]  qdisc_destroy+0x3e/0xc0
      [  771.364594]  dev_shutdown+0x7a/0xa5
      [  771.365522]  rollback_registered_many+0x20d/0x530
      [  771.366458]  ? netdev_upper_dev_unlink+0x15d/0x1c0
      [  771.367387]  unregister_netdevice_many.part.0+0xf/0x70
      [  771.368310]  vxlan_netdevice_event+0xa4/0x110 [vxlan]
      [  771.369454]  notifier_call_chain+0x4c/0x70
      [  771.370579]  rollback_registered_many+0x2f5/0x530
      [  771.371719]  rollback_registered+0x56/0x90
      [  771.372843]  unregister_netdevice_queue+0x73/0xb0
      [  771.373982]  unregister_netdev+0x18/0x20
      [  771.375168]  mlx5e_vport_rep_unload+0x56/0xc0 [mlx5_core]
      [  771.376327]  esw_offloads_disable+0x81/0x90 [mlx5_core]
      [  771.377512]  mlx5_eswitch_disable_locked.cold+0xcb/0x1af [mlx5_core]
      [  771.378679]  mlx5_eswitch_disable+0x44/0x60 [mlx5_core]
      [  771.379822]  mlx5_device_disable_sriov+0xad/0xb0 [mlx5_core]
      [  771.380968]  mlx5_core_sriov_configure+0xc1/0xe0 [mlx5_core]
      [  771.382087]  sriov_numvfs_store+0xfc/0x130
      [  771.383195]  kernfs_fop_write+0xce/0x1b0
      [  771.384302]  vfs_write+0xb6/0x1a0
      [  771.385410]  ksys_write+0x5f/0xe0
      [  771.386500]  do_syscall_64+0x5b/0x1d0
      [  771.387569]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
      
      Fixes: 0fdcf78d ("net: use flow_indr_dev_setup_offload()")
      Signed-off-by: default avatarwenxu <wenxu@ucloud.cn>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3c005110
    • wenxu's avatar
      net: flow_offload: fix flow_indr_dev_unregister path · a1db2178
      wenxu authored
      If the representor is removed, then identify the indirect flow_blocks
      that need to be removed by the release callback and the port representor
      structure. To identify the port representor structure, a new
      indr.cb_priv field needs to be introduced. The flow_block also needs to
      be removed from the driver list from the cleanup path.
      
      Fixes: 1fac52da ("net: flow_offload: consolidate indirect flow_block infrastructure")
      Signed-off-by: default avatarwenxu <wenxu@ucloud.cn>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a1db2178
    • wenxu's avatar
      flow_offload: use flow_indr_block_cb_alloc/remove function · 66f1939a
      wenxu authored
      Prepare fix the bug in the next patch. use flow_indr_block_cb_alloc/remove
      function and remove the __flow_block_indr_binding.
      Signed-off-by: default avatarwenxu <wenxu@ucloud.cn>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      66f1939a
    • wenxu's avatar
      flow_offload: add flow_indr_block_cb_alloc/remove function · 26f2eb27
      wenxu authored
      Add flow_indr_block_cb_alloc/remove function for next fix patch.
      Signed-off-by: default avatarwenxu <wenxu@ucloud.cn>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      26f2eb27
    • Sabrina Dubroca's avatar
      geneve: allow changing DF behavior after creation · 56c09de3
      Sabrina Dubroca authored
      Currently, trying to change the DF parameter of a geneve device does
      nothing:
      
          # ip -d link show geneve1
          14: geneve1: <snip>
              link/ether <snip>
              geneve id 1 remote 10.0.0.1 ttl auto df set dstport 6081 <snip>
          # ip link set geneve1 type geneve id 1 df unset
          # ip -d link show geneve1
          14: geneve1: <snip>
              link/ether <snip>
              geneve id 1 remote 10.0.0.1 ttl auto df set dstport 6081 <snip>
      
      We just need to update the value in geneve_changelink.
      
      Fixes: a025fb5f ("geneve: Allow configuration of DF behaviour")
      Signed-off-by: default avatarSabrina Dubroca <sd@queasysnail.net>
      Reviewed-by: default avatarStefano Brivio <sbrivio@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      56c09de3
    • Claudiu Manoil's avatar
      enetc: Fix HW_VLAN_CTAG_TX|RX toggling · 9deba33f
      Claudiu Manoil authored
      VLAN tag insertion/extraction offload is correctly
      activated at probe time but deactivation of this feature
      (i.e. via ethtool) is broken.  Toggling works only for
      Tx/Rx ring 0 of a PF, and is ignored for the other rings,
      including the VF rings.
      To fix this, the existing VLAN offload toggling code
      was extended to all the rings assigned to a netdevice,
      instead of the default ring 0 (likely a leftover from the
      early validation days of this feature).  And the code was
      moved to the common set_features() function to fix toggling
      for the VF driver too.
      
      Fixes: d4fd0404 ("enetc: Introduce basic PF and VF ENETC ethernet drivers")
      Signed-off-by: default avatarClaudiu Manoil <claudiu.manoil@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9deba33f
    • Claudiu Beznea's avatar
      net: macb: undo operations in case of failure · faa62087
      Claudiu Beznea authored
      Undo previously done operation in case macb_phylink_connect()
      fails. Since macb_reset_hw() is the 1st undo operation the
      napi_exit label was renamed to reset_hw.
      
      Fixes: 7897b071 ("net: macb: convert to phylink")
      Signed-off-by: default avatarClaudiu Beznea <claudiu.beznea@microchip.com>
      Acked-by: default avatarNicolas Ferre <nicolas.ferre@microchip.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      faa62087
    • David S. Miller's avatar
      Merge tag 'rxrpc-fixes-20200618' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs · 2996cbd5
      David S. Miller authored
      David Howells says:
      
      ====================
      rxrpc: Performance drop fix and other fixes
      
      Here are three fixes for rxrpc:
      
       (1) Fix a trace symbol mapping.  It doesn't seem to let you map to "".
      
       (2) Fix the handling of the remote receive window size when it increases
           beyond the size we can support for our transmit window.
      
       (3) Fix a performance drop caused by retransmitted packets being
           accidentally marked as already ACK'd.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2996cbd5
  5. 19 Jun, 2020 5 commits