1. 10 Dec, 2021 27 commits
  2. 09 Dec, 2021 13 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
    • Russell King (Oracle)'s avatar
      net: phylink: use legacy_pre_march2020 · 001f4261
      Russell King (Oracle) authored
      Use the legacy flag to indicate whether we should operate in legacy
      mode. This allows us to stop using the presence of a PCS as an
      indicator to the age of the phylink user, and make PCS presence
      optional.
      
      Legacy mode involves:
      1) calling mac_config() whenever the link comes up
      2) calling mac_config() whenever the inband advertisement changes,
         possibly followed by a call to mac_an_restart()
      3) making use of mac_an_restart()
      4) making use of mac_pcs_get_state()
      
      All the above functionality was moved to a seperate "PCS" block of
      operations in March 2020.
      
      Update the documents to indicate that the differences that this flag
      makes.
      Signed-off-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      001f4261
    • Russell King (Oracle)'s avatar
      net: mtk_eth_soc: mark as a legacy_pre_march2020 driver · b0651536
      Russell King (Oracle) authored
      mtk_eth_soc has not been updated for commit 7cceb599 ("net: phylink:
      avoid mac_config calls"), and makes use of state->speed and
      state->duplex in contravention of the phylink documentation. This makes
      reliant on the legacy behaviours, so mark it 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>
      b0651536
    • Russell King (Oracle)'s avatar
      net: dsa: mark DSA phylink as legacy_pre_march2020 · 0a9f0794
      Russell King (Oracle) authored
      The majority of DSA drivers do not make use of the PCS support, and
      thus operate in legacy mode. In order to preserve this behaviour in
      future, we need to set the legacy_pre_march2020 flag so phylink knows
      this may require the legacy calls.
      
      There are some DSA drivers that do make use of PCS support, and these
      will continue operating as before - legacy_pre_march2020 will not
      prevent split-PCS support enabling the newer phylink behaviour.
      Signed-off-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      0a9f0794
    • Russell King (Oracle)'s avatar
      net: phylink: add legacy_pre_march2020 indicator · 3e5b1fec
      Russell King (Oracle) authored
      Add a boolean to phylink_config to indicate whether a driver has not
      been updated for the changes in commit 7cceb599 ("net: phylink:
      avoid mac_config calls"), and thus are reliant on the old behaviour.
      
      We were currently keying the phylink behaviour on the presence of a
      PCS, but this is sub-optimal for modern drivers that may not have a
      PCS.
      
      This commit merely introduces the new flag, but does not add any use,
      since we need all legacy drivers to set this flag before it can be
      used. Once these legacy drivers have been updated, we can remove this
      flag.
      Signed-off-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      3e5b1fec
    • Linus Torvalds's avatar
      Merge tag 'mtd/fixes-for-5.16-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux · 27698cd2
      Linus Torvalds authored
      Pull mtd fixes from Miquel Raynal:
       "MTD fixes:
      
         - dataflash: Add device-tree SPI IDs to avoid new warnings
      
        Raw NAND fixes:
      
         - Fix nand_choose_best_timings() on unsupported interface
      
         - Fix nand_erase_op delay (wrong unit)
      
         - fsmc:
            - Fix timing computation
            - Take instruction delay into account
      
         - denali:
            - Add the dependency on HAS_IOMEM to silence robots"
      
      * tag 'mtd/fixes-for-5.16-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux:
        mtd: dataflash: Add device-tree SPI IDs
        mtd: rawnand: fsmc: Fix timing computation
        mtd: rawnand: fsmc: Take instruction delay into account
        mtd: rawnand: Fix nand_choose_best_timings() on unsupported interface
        mtd: rawnand: Fix nand_erase_op delay
        mtd: rawnand: denali: Add the dependency on HAS_IOMEM
      27698cd2
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid · 03090cc7
      Linus Torvalds authored
      Pull HID fixes from Jiri Kosina:
      
       - fixes for various drivers which assume that a HID device is on USB
         transport, but that might not necessarily be the case, as the device
         can be faked by uhid. (Greg, Benjamin Tissoires)
      
       - fix for spurious wakeups on certain Lenovo notebooks (Thomas
         Weißschuh)
      
       - a few other device-specific quirks
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid:
        HID: Ignore battery for Elan touchscreen on Asus UX550VE
        HID: intel-ish-hid: ipc: only enable IRQ wakeup when requested
        HID: google: add eel USB id
        HID: add USB_HID dependancy to hid-prodikeys
        HID: add USB_HID dependancy to hid-chicony
        HID: bigbenff: prevent null pointer dereference
        HID: sony: fix error path in probe
        HID: add USB_HID dependancy on some USB HID drivers
        HID: check for valid USB device for many HID drivers
        HID: wacom: fix problems when device is not a valid USB device
        HID: add hid_is_usb() function to make it simpler for USB detection
        HID: quirks: Add quirk for the Microsoft Surface 3 type-cover
      03090cc7