1. 11 Dec, 2021 6 commits
  2. 10 Dec, 2021 27 commits
  3. 09 Dec, 2021 7 commits
    • Jakub Kicinski's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 3150a733
      Jakub Kicinski authored
      No conflicts.
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      3150a733
    • Kees Cook's avatar
      skbuff: Extract list pointers to silence compiler warnings · 1a2fb220
      Kees Cook authored
      Under both -Warray-bounds and the object_size sanitizer, the compiler is
      upset about accessing prev/next of sk_buff when the object it thinks it
      is coming from is sk_buff_head. The warning is a false positive due to
      the compiler taking a conservative approach, opting to warn at casting
      time rather than access time.
      
      However, in support of enabling -Warray-bounds globally (which has
      found many real bugs), arrange things for sk_buff so that the compiler
      can unambiguously see that there is no intention to access anything
      except prev/next.  Introduce and cast to a separate struct sk_buff_list,
      which contains _only_ the first two fields, silencing the warnings:
      
      In file included from ./include/net/net_namespace.h:39,
                       from ./include/linux/netdevice.h:37,
                       from net/core/netpoll.c:17:
      net/core/netpoll.c: In function 'refill_skbs':
      ./include/linux/skbuff.h:2086:9: warning: array subscript 'struct sk_buff[0]' is partly outside array bounds of 'struct sk_buff_head[1]' [-Warray-bounds]
       2086 |         __skb_insert(newsk, next->prev, next, list);
            |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      net/core/netpoll.c:49:28: note: while referencing 'skb_pool'
         49 | static struct sk_buff_head skb_pool;
            |                            ^~~~~~~~
      
      This change results in no executable instruction differences.
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Link: https://lore.kernel.org/r/20211207062758.2324338-1-keescook@chromium.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      1a2fb220
    • Russell King (Oracle)'s avatar
      net: phy: prefer 1000baseT over 1000baseKX · f20f94f7
      Russell King (Oracle) authored
      The PHY settings table is supposed to be sorted by descending match
      priority - in other words, earlier entries are preferred over later
      entries.
      
      The order of 1000baseKX/Full and 1000baseT/Full is such that we
      prefer 1000baseKX/Full over 1000baseT/Full, but 1000baseKX/Full is
      a lot rarer than 1000baseT/Full, and thus is much less likely to
      be preferred.
      
      This causes phylink problems - it means a fixed link specifying a
      speed of 1G and full duplex gets an ethtool linkmode of 1000baseKX/Full
      rather than 1000baseT/Full as would be expected - and since we offer
      userspace a software emulation of a conventional copper PHY, we want
      to offer copper modes in preference to anything else. However, we do
      still want to allow the rarer modes as well.
      
      Hence, let's reorder these two modes to prefer copper.
      Tested-by: default avatarTom Lendacky <thomas.lendacky@amd.com>
      Signed-off-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Reported-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Link: https://lore.kernel.org/r/E1muvFO-00F6jY-1K@rmk-PC.armlinux.org.ukSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      f20f94f7
    • Eric Dumazet's avatar
      xfrm: use net device refcount tracker helpers · 4177e496
      Eric Dumazet authored
      xfrm4_fill_dst() and xfrm6_fill_dst() build dst,
      getting a device reference that will likely be released
      by standard dst_release() code.
      
      We have to track these references or risk a warning if
      CONFIG_NET_DEV_REFCNT_TRACKER=y
      
      Note to XFRM maintainers :
      
      Error path in xfrm6_fill_dst() releases the reference,
      but does not clear xdst->u.dst.dev, so I wonder
      if this could lead to double dev_put() in some cases,
      where a dst_release() _is_ called by the callers in their
      error path.
      
      This extra dev_put() was added in commit 84c4a9df ("xfrm6:
      release dev before returning error")
      
      Fixes: 9038c320 ("net: dst: add net device refcount tracking to dst_entry")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Cong Wang <amwang@redhat.com>
      Acked-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
      Link: https://lore.kernel.org/r/20211207193203.2706158-1-eric.dumazet@gmail.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      4177e496
    • Linus Torvalds's avatar
      Merge tag 'net-5.16-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · ded746bf
      Linus Torvalds authored
      Pull networking fixes from Jakub Kicinski:
       "Including fixes from bpf, can and netfilter.
      
        Current release - regressions:
      
         - bpf, sockmap: re-evaluate proto ops when psock is removed from
           sockmap
      
        Current release - new code bugs:
      
         - bpf: fix bpf_check_mod_kfunc_call for built-in modules
      
         - ice: fixes for TC classifier offloads
      
         - vrf: don't run conntrack on vrf with !dflt qdisc
      
        Previous releases - regressions:
      
         - bpf: fix the off-by-two error in range markings
      
         - seg6: fix the iif in the IPv6 socket control block
      
         - devlink: fix netns refcount leak in devlink_nl_cmd_reload()
      
         - dsa: mv88e6xxx: fix "don't use PHY_DETECT on internal PHY's"
      
         - dsa: mv88e6xxx: allow use of PHYs on CPU and DSA ports
      
        Previous releases - always broken:
      
         - ethtool: do not perform operations on net devices being
           unregistered
      
         - udp: use datalen to cap max gso segments
      
         - ice: fix races in stats collection
      
         - fec: only clear interrupt of handling queue in fec_enet_rx_queue()
      
         - m_can: pci: fix incorrect reference clock rate
      
         - m_can: disable and ignore ELO interrupt
      
         - mvpp2: fix XDP rx queues registering
      
        Misc:
      
         - treewide: add missing includes masked by cgroup -> bpf.h
           dependency"
      
      * tag 'net-5.16-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (82 commits)
        net: dsa: mv88e6xxx: allow use of PHYs on CPU and DSA ports
        net: wwan: iosm: fixes unable to send AT command during mbim tx
        net: wwan: iosm: fixes net interface nonfunctional after fw flash
        net: wwan: iosm: fixes unnecessary doorbell send
        net: dsa: felix: Fix memory leak in felix_setup_mmio_filtering
        MAINTAINERS: s390/net: remove myself as maintainer
        net/sched: fq_pie: prevent dismantle issue
        net: mana: Fix memory leak in mana_hwc_create_wq
        seg6: fix the iif in the IPv6 socket control block
        nfp: Fix memory leak in nfp_cpp_area_cache_add()
        nfc: fix potential NULL pointer deref in nfc_genl_dump_ses_done
        nfc: fix segfault in nfc_genl_dump_devices_done
        udp: using datalen to cap max gso segments
        net: dsa: mv88e6xxx: error handling for serdes_power functions
        can: kvaser_usb: get CAN clock frequency from device
        can: kvaser_pciefd: kvaser_pciefd_rx_error_frame(): increase correct stats->{rx,tx}_errors counter
        net: mvpp2: fix XDP rx queues registering
        vmxnet3: fix minimum vectors alloc issue
        net, neigh: clear whole pneigh_entry at alloc time
        net: dsa: mv88e6xxx: fix "don't use PHY_DETECT on internal PHY's"
        ...
      ded746bf
    • Jakub Kicinski's avatar
      Merge branch 'net-phylink-introduce-legacy-mode-flag' · 5092fb44
      Jakub Kicinski authored
      Russell King says:
      
      ====================
      net: phylink: introduce legacy mode flag
      
      In March 2020, phylink gained support to split the PCS support out of
      the MAC callbacks. By doing so, a slight behavioural difference was
      introduced when a PCS is present, specifically:
      
      1) the call to mac_config() when the link comes up or advertisement
         changes were eliminated
      2) mac_an_restart() will never be called
      3) mac_pcs_get_state() will never be called
      
      The intention was to eventually remove this support once all phylink
      users were converted. Unfortunately, this still hasn't happened - and
      in some cases, it looks like it may never happen.
      
      Through discussion with Sean Anderson, we now need to allow the PCS to
      be optional for modern drivers, so we need a different way to identify
      these legacy drivers - in that we wish to allow the "modern" behaviour
      where mac_config() is not called on link-up events, even if there is
      no PCS attached.
      
      In order to do that, this series of patches introduce a
      "legacy_pre_march2020" which is used to permit the old behaviour - in
      other words, we get the old behaviour only when there is no PCS and
      this flag is true. Otherwise, we get the new behaviour.
      
      I decided to use the date of the change in the flag as just using
      "legacy" or "legacy_driver" is too non-descript. An alternative could
      be to use the git sha1 hash of the set of changes.
      
      I believe I have added the legacy flag to all the drivers which use
      legacy mode - that being the mtk_eth_soc ethernet driver, and many DSA
      drivers - the ones which need the old behaviour are identified by
      having non-NULL phylink_mac_link_state or phylink_mac_an_restart
      methods in their dsa_switch_ops structure.
      
      ag71xx and xilinx do not need the legacy flag. ag71xx is explained in
      its own commit, and xilinx only updates the inband advertisement in
      the mac_config() call, which is sufficient qualification to avoid it
      being marked legacy.
      ====================
      
      Link: https://lore.kernel.org/r/Ya+DGaGmGgWrlVkW@shell.armlinux.org.ukSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      5092fb44
    • Russell King (Oracle)'s avatar
      net: ag71xx: remove unnecessary legacy methods · 11053047
      Russell King (Oracle) authored
      ag71xx may have a PCS, but it does not appear to support configuration
      of the PCS in the current code. The functions to get its state merely
      report that the link is down, and the AN restart function is empty.
      
      Since neither of these functions will be called unless phylink's legacy
      flag is set, we can safely remove these functions and indicate this is
      a modern driver.
      
      Should PCS support be added later, it will need to be modelled using
      the phylink_pcs support rather than operating as a legacy driver.
      Signed-off-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      11053047