1. 28 7月, 2020 1 次提交
  2. 25 7月, 2020 2 次提交
    • X
      drivers/net/wan: lapb: Corrected the usage of skb_cow · 8754e137
      Xie He 提交于
      This patch fixed 2 issues with the usage of skb_cow in LAPB drivers
      "lapbether" and "hdlc_x25":
      
      1) After skb_cow fails, kfree_skb should be called to drop a reference
      to the skb. But in both drivers, kfree_skb is not called.
      
      2) skb_cow should be called before skb_push so that is can ensure the
      safety of skb_push. But in "lapbether", it is incorrectly called after
      skb_push.
      
      More details about these 2 issues:
      
      1) The behavior of calling kfree_skb on failure is also the behavior of
      netif_rx, which is called by this function with "return netif_rx(skb);".
      So this function should follow this behavior, too.
      
      2) In "lapbether", skb_cow is called after skb_push. This results in 2
      logical issues:
         a) skb_push is not protected by skb_cow;
         b) An extra headroom of 1 byte is ensured after skb_push. This extra
            headroom has no use in this function. It also has no use in the
            upper-layer function that this function passes the skb to
            (x25_lapb_receive_frame in net/x25/x25_dev.c).
      So logically skb_cow should instead be called before skb_push.
      
      Cc: Eric Dumazet <edumazet@google.com>
      Cc: Martin Schiller <ms@dev.tdt.de>
      Signed-off-by: NXie He <xie.he.0141@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8754e137
    • A
      xen-netfront: fix potential deadlock in xennet_remove() · c2c63310
      Andrea Righi 提交于
      There's a potential race in xennet_remove(); this is what the driver is
      doing upon unregistering a network device:
      
        1. state = read bus state
        2. if state is not "Closed":
        3.    request to set state to "Closing"
        4.    wait for state to be set to "Closing"
        5.    request to set state to "Closed"
        6.    wait for state to be set to "Closed"
      
      If the state changes to "Closed" immediately after step 1 we are stuck
      forever in step 4, because the state will never go back from "Closed" to
      "Closing".
      
      Make sure to check also for state == "Closed" in step 4 to prevent the
      deadlock.
      
      Also add a 5 sec timeout any time we wait for the bus state to change,
      to avoid getting stuck forever in wait_event().
      Signed-off-by: NAndrea Righi <andrea.righi@canonical.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c2c63310
  3. 24 7月, 2020 5 次提交
    • C
      geneve: fix an uninitialized value in geneve_changelink() · 32818c07
      Cong Wang 提交于
      geneve_nl2info() sets 'df' conditionally, so we have to
      initialize it by copying the value from existing geneve
      device in geneve_changelink().
      
      Fixes: 56c09de3 ("geneve: allow changing DF behavior after creation")
      Reported-by: syzbot+7ebc2e088af5e4c0c9fa@syzkaller.appspotmail.com
      Cc: Sabrina Dubroca <sd@queasysnail.net>
      Signed-off-by: NCong Wang <xiyou.wangcong@gmail.com>
      Reviewed-by: NSabrina Dubroca <sd@queasysnail.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      32818c07
    • C
      bonding: check return value of register_netdevice() in bond_newlink() · c75d1d52
      Cong Wang 提交于
      Very similar to commit 544f287b
      ("bonding: check error value of register_netdevice() immediately"),
      we should immediately check the return value of register_netdevice()
      before doing anything else.
      
      Fixes: 005db31d ("bonding: set carrier off for devices created through netlink")
      Reported-and-tested-by: syzbot+bbc3a11c4da63c1b74d6@syzkaller.appspotmail.com
      Cc: Beniamino Galvani <bgalvani@redhat.com>
      Cc: Taehee Yoo <ap420073@gmail.com>
      Cc: Jay Vosburgh <j.vosburgh@gmail.com>
      Signed-off-by: NCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c75d1d52
    • D
      i2c: i2c-qcom-geni: Fix DMA transfer race · 02b9aec5
      Douglas Anderson 提交于
      When I have KASAN enabled on my kernel and I start stressing the
      touchscreen my system tends to hang.  The touchscreen is one of the
      only things that does a lot of big i2c transfers and ends up hitting
      the DMA paths in the geni i2c driver.  It appears that KASAN adds
      enough delay in my system to tickle a race condition in the DMA setup
      code.
      
      When the system hangs, I found that it was running the geni_i2c_irq()
      over and over again.  It had these:
      
      m_stat   = 0x04000080
      rx_st    = 0x30000011
      dm_tx_st = 0x00000000
      dm_rx_st = 0x00000000
      dma      = 0x00000001
      
      Notably we're in DMA mode but are getting M_RX_IRQ_EN and
      M_RX_FIFO_WATERMARK_EN over and over again.
      
      Putting some traces in geni_i2c_rx_one_msg() showed that when we
      failed we were getting to the start of geni_i2c_rx_one_msg() but were
      never executing geni_se_rx_dma_prep().
      
      I believe that the problem here is that we are starting the geni
      command before we run geni_se_rx_dma_prep().  If a transfer makes it
      far enough before we do that then we get into the state I have
      observed.  Let's change the order, which seems to work fine.
      
      Although problems were seen on the RX path, code inspection suggests
      that the TX should be changed too.  Change it as well.
      
      Fixes: 37692de5 ("i2c: i2c-qcom-geni: Add bus driver for the Qualcomm GENI I2C controller")
      Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Tested-by: NSai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>
      Reviewed-by: NAkash Asthana <akashast@codeaurora.org>
      Reviewed-by: NStephen Boyd <swboyd@chromium.org>
      Reviewed-by: NMukesh Kumar Savaliya <msavaliy@codeaurora.org>
      Signed-off-by: NWolfram Sang <wsa@kernel.org>
      02b9aec5
    • W
      i2c: rcar: always clear ICSAR to avoid side effects · eb015971
      Wolfram Sang 提交于
      On R-Car Gen2, we get a timeout when reading from the address set in
      ICSAR, even though the slave interface is disabled. Clearing it fixes
      this situation. Note that Gen3 is not affected.
      
      To reproduce: bind and undbind an I2C slave on some bus, run
      'i2cdetect' on that bus.
      
      Fixes: de20d185 ("i2c: rcar: add slave support")
      Signed-off-by: NWolfram Sang <wsa+renesas@sang-engineering.com>
      Signed-off-by: NWolfram Sang <wsa@kernel.org>
      eb015971
    • M
      dm integrity: fix integrity recalculation that is improperly skipped · 5df96f2b
      Mikulas Patocka 提交于
      Commit adc0daad ("dm: report suspended
      device during destroy") broke integrity recalculation.
      
      The problem is dm_suspended() returns true not only during suspend,
      but also during resume. So this race condition could occur:
      1. dm_integrity_resume calls queue_work(ic->recalc_wq, &ic->recalc_work)
      2. integrity_recalc (&ic->recalc_work) preempts the current thread
      3. integrity_recalc calls if (unlikely(dm_suspended(ic->ti))) goto unlock_ret;
      4. integrity_recalc exits and no recalculating is done.
      
      To fix this race condition, add a function dm_post_suspending that is
      only true during the postsuspend phase and use it instead of
      dm_suspended().
      
      Signed-off-by: Mikulas Patocka <mpatocka redhat com>
      Fixes: adc0daad ("dm: report suspended device during destroy")
      Cc: stable vger kernel org # v4.18+
      Signed-off-by: NMike Snitzer <snitzer@redhat.com>
      5df96f2b
  4. 23 7月, 2020 3 次提交
    • N
      cxgb4: add missing release on skb in uld_send() · e6827d1a
      Navid Emamdoost 提交于
      In the implementation of uld_send(), the skb is consumed on all
      execution paths except one. Release skb when returning NET_XMIT_DROP.
      Signed-off-by: NNavid Emamdoost <navid.emamdoost@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e6827d1a
    • E
      net: atlantic: fix PTP on AQC10X · 901f3cc1
      Egor Pomozov 提交于
      This patch fixes PTP on AQC10X.
      PTP support on AQC10X requires FW involvement and FW configures the
      TPS data arb mode itself.
      So we must make sure driver doesn't touch TPS data arb mode on AQC10x
      if PTP is enabled. Otherwise, there are no timestamps even though
      packets are flowing.
      
      Fixes: 2deac71a ("net: atlantic: QoS implementation: min_rate")
      Signed-off-by: NEgor Pomozov <epomozov@marvell.com>
      Signed-off-by: NMark Starovoytov <mstarovoitov@marvell.com>
      Signed-off-by: NIgor Russkikh <irusskikh@marvell.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      901f3cc1
    • C
      enetc: Remove the mdio bus on PF probe bailout · 26cb7085
      Claudiu Manoil 提交于
      For ENETC ports that register an external MDIO bus,
      the bus doesn't get removed on the error bailout path
      of enetc_pf_probe().
      
      This issue became much more visible after recent:
      commit 07095c02 ("net: enetc: Use DT protocol information to set up the ports")
      Before this commit, one could make probing fail on the error
      path only by having register_netdev() fail, which is unlikely.
      But after this commit, because it moved the enetc_of_phy_get()
      call up in the probing sequence, now we can trigger an mdiobus_free()
      bug just by forcing enetc_alloc_msix() to return error, i.e. with the
      'pci=nomsi' kernel bootarg (since ENETC relies on MSI support to work),
      as the calltrace below shows:
      
      kernel BUG at /home/eiz/work/enetc/net/drivers/net/phy/mdio_bus.c:648!
      Internal error: Oops - BUG: 0 [#1] PREEMPT SMP
      [...]
      Hardware name: LS1028A RDB Board (DT)
      pstate: 80000005 (Nzcv daif -PAN -UAO BTYPE=--)
      pc : mdiobus_free+0x50/0x58
      lr : devm_mdiobus_free+0x14/0x20
      [...]
      Call trace:
       mdiobus_free+0x50/0x58
       devm_mdiobus_free+0x14/0x20
       release_nodes+0x138/0x228
       devres_release_all+0x38/0x60
       really_probe+0x1c8/0x368
       driver_probe_device+0x5c/0xc0
       device_driver_attach+0x74/0x80
       __driver_attach+0x8c/0xd8
       bus_for_each_dev+0x7c/0xd8
       driver_attach+0x24/0x30
       bus_add_driver+0x154/0x200
       driver_register+0x64/0x120
       __pci_register_driver+0x44/0x50
       enetc_pf_driver_init+0x24/0x30
       do_one_initcall+0x60/0x1c0
       kernel_init_freeable+0x1fc/0x274
       kernel_init+0x14/0x110
       ret_from_fork+0x10/0x34
      
      Fixes: ebfcb23d ("enetc: Add ENETC PF level external MDIO support")
      Signed-off-by: NClaudiu Manoil <claudiu.manoil@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      26cb7085
  5. 22 7月, 2020 20 次提交
  6. 21 7月, 2020 9 次提交