Skip to content
  1. Oct 02, 2023
  2. Oct 01, 2023
    • Eric Dumazet's avatar
      net: fix possible store tearing in neigh_periodic_work() · 25563b58
      Eric Dumazet authored
      
      
      While looking at a related syzbot report involving neigh_periodic_work(),
      I found that I forgot to add an annotation when deleting an
      RCU protected item from a list.
      
      Readers use rcu_deference(*np), we need to use either
      rcu_assign_pointer() or WRITE_ONCE() on writer side
      to prevent store tearing.
      
      I use rcu_assign_pointer() to have lockdep support,
      this was the choice made in neigh_flush_dev().
      
      Fixes: 767e97e1 ("neigh: RCU conversion of struct neighbour")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Reviewed-by: default avatarDavid Ahern <dsahern@kernel.org>
      Reviewed-by: default avatarSimon Horman <horms@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      25563b58
    • David S. Miller's avatar
      Merge tag 'for-net-2023-09-20' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth · c15cd642
      David S. Miller authored
      
      
      bluetooth pull request for net:
      
       - Fix handling of HCI_QUIRK_STRICT_DUPLICATE_FILTER
       - Fix handling of listen for ISO unicast
       - Fix build warnings
       - Fix leaking content of local_codecs
       - Add shutdown function for QCA6174
       - Delete unused hci_req_prepare_suspend() declaration
       - Fix hci_link_tx_to RCU lock usage
       - Avoid redundant authentication
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c15cd642
    • Clark Wang's avatar
      net: stmmac: platform: fix the incorrect parameter · 6b09edc1
      Clark Wang authored
      
      
      The second parameter of stmmac_pltfr_init() needs the pointer of
      "struct plat_stmmacenet_data". So, correct the parameter typo when calling the
      function.
      
      Otherwise, it may cause this alignment exception when doing suspend/resume.
      [   49.067201] CPU1 is up
      [   49.135258] Internal error: SP/PC alignment exception: 000000008a000000 [#1] PREEMPT SMP
      [   49.143346] Modules linked in: soc_imx9 crct10dif_ce polyval_ce nvmem_imx_ocotp_fsb_s400 polyval_generic layerscape_edac_mod snd_soc_fsl_asoc_card snd_soc_imx_audmux snd_soc_imx_card snd_soc_wm8962 el_enclave snd_soc_fsl_micfil rtc_pcf2127 rtc_pcf2131 flexcan can_dev snd_soc_fsl_xcvr snd_soc_fsl_sai imx8_media_dev(C) snd_soc_fsl_utils fuse
      [   49.173393] CPU: 0 PID: 565 Comm: sh Tainted: G         C         6.5.0-rc4-next-20230804-05047-g5781a6249dae #677
      [   49.183721] Hardware name: NXP i.MX93 11X11 EVK board (DT)
      [   49.189190] pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
      [   49.196140] pc : 0x80800052
      [   49.198931] lr : stmmac_pltfr_resume+0x34/0x50
      [   49.203368] sp : ffff800082f8bab0
      [   49.206670] x29: ffff800082f8bab0 x28: ffff0000047d0ec0 x27: ffff80008186c170
      [   49.213794] x26: 0000000b5e4ff1ba x25: ffff800081e5fa74 x24: 0000000000000010
      [   49.220918] x23: ffff800081fe0000 x22: 0000000000000000 x21: 0000000000000000
      [   49.228042] x20: ffff0000001b4010 x19: ffff0000001b4010 x18: 0000000000000006
      [   49.235166] x17: ffff7ffffe007000 x16: ffff800080000000 x15: 0000000000000000
      [   49.242290] x14: 00000000000000fc x13: 0000000000000000 x12: 0000000000000000
      [   49.249414] x11: 0000000000000001 x10: 0000000000000a60 x9 : ffff800082f8b8c0
      [   49.256538] x8 : 0000000000000008 x7 : 0000000000000001 x6 : 000000005f54a200
      [   49.263662] x5 : 0000000001000000 x4 : ffff800081b93680 x3 : ffff800081519be0
      [   49.270786] x2 : 0000000080800052 x1 : 0000000000000000 x0 : ffff0000001b4000
      [   49.277911] Call trace:
      [   49.280346]  0x80800052
      [   49.282781]  platform_pm_resume+0x2c/0x68
      [   49.286785]  dpm_run_callback.constprop.0+0x74/0x134
      [   49.291742]  device_resume+0x88/0x194
      [   49.295391]  dpm_resume+0x10c/0x230
      [   49.298866]  dpm_resume_end+0x18/0x30
      [   49.302515]  suspend_devices_and_enter+0x2b8/0x624
      [   49.307299]  pm_suspend+0x1fc/0x348
      [   49.310774]  state_store+0x80/0x104
      [   49.314258]  kobj_attr_store+0x18/0x2c
      [   49.318002]  sysfs_kf_write+0x44/0x54
      [   49.321659]  kernfs_fop_write_iter+0x120/0x1ec
      [   49.326088]  vfs_write+0x1bc/0x300
      [   49.329485]  ksys_write+0x70/0x104
      [   49.332874]  __arm64_sys_write+0x1c/0x28
      [   49.336783]  invoke_syscall+0x48/0x114
      [   49.340527]  el0_svc_common.constprop.0+0xc4/0xe4
      [   49.345224]  do_el0_svc+0x38/0x98
      [   49.348526]  el0_svc+0x2c/0x84
      [   49.351568]  el0t_64_sync_handler+0x100/0x12c
      [   49.355910]  el0t_64_sync+0x190/0x194
      [   49.359567] Code: ???????? ???????? ???????? ???????? (????????)
      [   49.365644] ---[ end trace 0000000000000000 ]---
      
      Fixes: 97117eb5 ("net: stmmac: platform: provide stmmac_pltfr_init()")
      Signed-off-by: default avatarClark Wang <xiaoning.wang@nxp.com>
      Reviewed-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Reviewed-by: default avatarSerge Semin <fancer.lancer@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6b09edc1
  3. Sep 28, 2023
    • Michal Schmidt's avatar
      ice: always add legacy 32byte RXDID in supported_rxdids · c070e51d
      Michal Schmidt authored
      
      
      When the PF and VF drivers both support flexible rx descriptors and have
      negotiated the VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC capability, the VF driver
      queries the PF for the list of supported descriptor formats
      (VIRTCHNL_OP_GET_SUPPORTED_RXDIDS). The PF driver is supposed to set the
      supported_rxdids bits that correspond to the descriptor formats the
      firmware implements. The legacy 32-byte rx desc format is always
      supported, even though it is not expressed in GLFLXP_RXDID_FLAGS.
      
      The ice driver does not advertise the legacy 32-byte rx desc support,
      which leads to this failure to bring up the VF using the Intel
      out-of-tree iavf driver:
       iavf 0000:41:01.0: PF does not list support for default Rx descriptor format
       ...
       iavf 0000:41:01.0: PF returned error -5 (VIRTCHNL_STATUS_ERR_PARAM) to our request 6
      
      The in-tree iavf driver does not expose this bug, because it does not
      yet implement VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC.
      
      The ice driver must always set the ICE_RXDID_LEGACY_1 bit in
      supported_rxdids. The Intel out-of-tree ice driver and the ice driver in
      DPDK both do this.
      
      I copied this piece of the code and the comment text from the Intel
      out-of-tree driver.
      
      Fixes: e753df8f ("ice: Add support Flex RXD")
      Signed-off-by: default avatarMichal Schmidt <mschmidt@redhat.com>
      Reviewed-by: default avatarPrzemek Kitszel <przemyslaw.kitszel@intel.com>
      Link: https://lore.kernel.org/r/20230920115439.61172-1-mschmidt@redhat.com
      
      
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      c070e51d
  4. Sep 22, 2023
    • Alexandra Diupina's avatar
      drivers/net: process the result of hdlc_open() and add call of hdlc_close() in uhdlc_close() · a59addac
      Alexandra Diupina authored
      
      
      Process the result of hdlc_open() and call uhdlc_close()
      in case of an error. It is necessary to pass the error
      code up the control flow, similar to a possible
      error in request_irq().
      Also add a hdlc_close() call to the uhdlc_close()
      because the comment to hdlc_close() says it must be called
      by the hardware driver when the HDLC device is being closed
      
      Found by Linux Verification Center (linuxtesting.org) with SVACE.
      
      Fixes: c19b6d24 ("drivers/net: support hdlc function for QE-UCC")
      Signed-off-by: default avatarAlexandra Diupina <adiupina@astralinux.ru>
      Reviewed-by: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a59addac
    • Linus Torvalds's avatar
      Merge tag 'net-6.6-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 27bbf45e
      Linus Torvalds authored
      Pull networking fixes from Paolo Abeni:
       "Including fixes from netfilter and bpf.
      
        Current release - regressions:
      
         - bpf: adjust size_index according to the value of KMALLOC_MIN_SIZE
      
         - netfilter: fix entries val in rule reset audit log
      
         - eth: stmmac: fix incorrect rxq|txq_stats reference
      
        Previous releases - regressions:
      
         - ipv4: fix null-deref in ipv4_link_failure
      
         - netfilter:
            - fix several GC related issues
            - fix race between IPSET_CMD_CREATE and IPSET_CMD_SWAP
      
         - eth: team: fix null-ptr-deref when team device type is changed
      
         - eth: i40e: fix VF VLAN offloading when port VLAN is configured
      
         - eth: ionic: fix 16bit math issue when PAGE_SIZE >= 64KB
      
        Previous releases - always broken:
      
         - core: fix ETH_P_1588 flow dissector
      
         - mptcp: fix several connection hang-up conditions
      
         - bpf:
            - avoid deadlock when using queue and stack maps from NMI
            - add override check to kprobe multi link attach
      
         - hsr: properly parse HSRv1 supervisor frames.
      
         - eth: igc: fix infinite initialization loop with early XDP redirect
      
         - eth: octeon_ep: fix tx dma unmap len values in SG
      
         - eth: hns3: fix GRE checksum offload issue"
      
      * tag 'net-6.6-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (87 commits)
        sfc: handle error pointers returned by rhashtable_lookup_get_insert_fast()
        igc: Expose tx-usecs coalesce setting to user
        octeontx2-pf: Do xdp_do_flush() after redirects.
        bnxt_en: Flush XDP for bnxt_poll_nitroa0()'s NAPI
        net: ena: Flush XDP packets on error.
        net/handshake: Fix memory leak in __sock_create() and sock_alloc_file()
        net: hinic: Fix warning-hinic_set_vlan_fliter() warn: variable dereferenced before check 'hwdev'
        netfilter: ipset: Fix race between IPSET_CMD_CREATE and IPSET_CMD_SWAP
        netfilter: nf_tables: fix memleak when more than 255 elements expired
        netfilter: nf_tables: disable toggling dormant table state more than once
        vxlan: Add missing entries to vxlan_get_size()
        net: rds: Fix possible NULL-pointer dereference
        team: fix null-ptr-deref when team device type is changed
        net: bridge: use DEV_STATS_INC()
        net: hns3: add 5ms delay before clear firmware reset irq source
        net: hns3: fix fail to delete tc flower rules during reset issue
        net: hns3: only enable unicast promisc when mac table full
        net: hns3: fix GRE checksum offload issue
        net: hns3: add cmdq check for vf periodic service task
        net: stmmac: fix incorrect rxq|txq_stats reference
        ...
      27bbf45e
    • Linus Torvalds's avatar
      Merge tag 'v6.6-rc3.vfs.ctime.revert' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs · b5cbe7c0
      Linus Torvalds authored
      Pull finegrained timestamp reverts from Christian Brauner:
       "Earlier this week we sent a few minor fixes for the multi-grained
        timestamp work in [1]. While we were polishing those up after Linus
        realized that there might be a nicer way to fix them we received a
        regression report in [2] that fine grained timestamps break gnulib
        tests and thus possibly other tools.
      
        The kernel will elide fine-grain timestamp updates when no one is
        actively querying for them to avoid performance impacts. So a sequence
        like write(f1) stat(f2) write(f2) stat(f2) write(f1) stat(f1) may
        result in timestamp f1 to be older than the final f2 timestamp even
        though f1 was last written too but the second write didn't update the
        timestamp.
      
        Such plotholes can lead to subtle bugs when programs compare
        timestamps. For example, the nap() function in [2] will estimate that
        it needs to wait one ns on a fine-grain timestamp enabled filesytem
        between subsequent calls to observe a timestamp change. But in general
        we don't update timestamps with more than one jiffie if we think that
        no one is actively querying for fine-grain timestamps to avoid
        performance impacts.
      
        While discussing various fixes the decision was to go back to the
        drawing board and ultimately to explore a solution that involves only
        exposing such fine-grained timestamps to nfs internally and never to
        userspace.
      
        As there are multiple solutions discussed the honest thing to do here
        is not to fix this up or disable it but to cleanly revert. The general
        infrastructure will probably come back but there is no reason to keep
        this code in mainline.
      
        The general changes to timestamp handling are valid and a good cleanup
        that will stay. The revert is fully bisectable"
      
      Link: https://lore.kernel.org/all/20230918-hirte-neuzugang-4c2324e7bae3@brauner [1]
      Link: https://lore.kernel.org/all/bf0524debb976627693e12ad23690094e4514303.camel@linuxfromscratch.org [2]
      
      * tag 'v6.6-rc3.vfs.ctime.revert' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs:
        Revert "fs: add infrastructure for multigrain timestamps"
        Revert "btrfs: convert to multigrain timestamps"
        Revert "ext4: switch to multigrain timestamps"
        Revert "xfs: switch to multigrain timestamps"
        Revert "tmpfs: add support for multigrain timestamps"
      b5cbe7c0
  5. Sep 21, 2023