1. 18 10月, 2019 4 次提交
  2. 17 10月, 2019 2 次提交
  3. 16 10月, 2019 11 次提交
  4. 15 10月, 2019 4 次提交
  5. 14 10月, 2019 4 次提交
    • M
      ath10k: fix latency issue for QCA988x · d79749f7
      Miaoqing Pan 提交于
      (kvalo: cherry picked from commit 1340cc63 in
      wireless-drivers-next to wireless-drivers as this a frequently reported
      regression)
      
      Bad latency is found on QCA988x, the issue was introduced by
      commit 4504f0e5 ("ath10k: sdio: workaround firmware UART
      pin configuration bug"). If uart_pin_workaround is false, this
      change will set uart pin even if uart_print is false.
      
      Tested HW: QCA9880
      Tested FW: 10.2.4-1.0-00037
      
      Fixes: 4504f0e5 ("ath10k: sdio: workaround firmware UART pin configuration bug")
      Signed-off-by: NMiaoqing Pan <miaoqing@codeaurora.org>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      d79749f7
    • Y
      netdevsim: Fix error handling in nsim_fib_init and nsim_fib_exit · 33902b4a
      YueHaibing 提交于
      In nsim_fib_init(), if register_fib_notifier failed, nsim_fib_net_ops
      should be unregistered before return.
      
      In nsim_fib_exit(), unregister_fib_notifier should be called before
      nsim_fib_net_ops be unregistered, otherwise may cause use-after-free:
      
      BUG: KASAN: use-after-free in nsim_fib_event_nb+0x342/0x570 [netdevsim]
      Read of size 8 at addr ffff8881daaf4388 by task kworker/0:3/3499
      
      CPU: 0 PID: 3499 Comm: kworker/0:3 Not tainted 5.3.0-rc7+ #30
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1ubuntu1 04/01/2014
      Workqueue: ipv6_addrconf addrconf_dad_work [ipv6]
      Call Trace:
       __dump_stack lib/dump_stack.c:77 [inline]
       dump_stack+0xa9/0x10e lib/dump_stack.c:113
       print_address_description+0x65/0x380 mm/kasan/report.c:351
       __kasan_report+0x149/0x18d mm/kasan/report.c:482
       kasan_report+0xe/0x20 mm/kasan/common.c:618
       nsim_fib_event_nb+0x342/0x570 [netdevsim]
       notifier_call_chain+0x52/0xf0 kernel/notifier.c:95
       __atomic_notifier_call_chain+0x78/0x140 kernel/notifier.c:185
       call_fib_notifiers+0x30/0x60 net/core/fib_notifier.c:30
       call_fib6_entry_notifiers+0xc1/0x100 [ipv6]
       fib6_add+0x92e/0x1b10 [ipv6]
       __ip6_ins_rt+0x40/0x60 [ipv6]
       ip6_ins_rt+0x84/0xb0 [ipv6]
       __ipv6_ifa_notify+0x4b6/0x550 [ipv6]
       ipv6_ifa_notify+0xa5/0x180 [ipv6]
       addrconf_dad_completed+0xca/0x640 [ipv6]
       addrconf_dad_work+0x296/0x960 [ipv6]
       process_one_work+0x5c0/0xc00 kernel/workqueue.c:2269
       worker_thread+0x5c/0x670 kernel/workqueue.c:2415
       kthread+0x1d7/0x200 kernel/kthread.c:255
       ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:352
      
      Allocated by task 3388:
       save_stack+0x19/0x80 mm/kasan/common.c:69
       set_track mm/kasan/common.c:77 [inline]
       __kasan_kmalloc.constprop.3+0xa0/0xd0 mm/kasan/common.c:493
       kmalloc include/linux/slab.h:557 [inline]
       kzalloc include/linux/slab.h:748 [inline]
       ops_init+0xa9/0x220 net/core/net_namespace.c:127
       __register_pernet_operations net/core/net_namespace.c:1135 [inline]
       register_pernet_operations+0x1d4/0x420 net/core/net_namespace.c:1212
       register_pernet_subsys+0x24/0x40 net/core/net_namespace.c:1253
       nsim_fib_init+0x12/0x70 [netdevsim]
       veth_get_link_ksettings+0x2b/0x50 [veth]
       do_one_initcall+0xd4/0x454 init/main.c:939
       do_init_module+0xe0/0x330 kernel/module.c:3490
       load_module+0x3c2f/0x4620 kernel/module.c:3841
       __do_sys_finit_module+0x163/0x190 kernel/module.c:3931
       do_syscall_64+0x72/0x2e0 arch/x86/entry/common.c:296
       entry_SYSCALL_64_after_hwframe+0x49/0xbe
      
      Freed by task 3534:
       save_stack+0x19/0x80 mm/kasan/common.c:69
       set_track mm/kasan/common.c:77 [inline]
       __kasan_slab_free+0x130/0x180 mm/kasan/common.c:455
       slab_free_hook mm/slub.c:1423 [inline]
       slab_free_freelist_hook mm/slub.c:1474 [inline]
       slab_free mm/slub.c:3016 [inline]
       kfree+0xe9/0x2d0 mm/slub.c:3957
       ops_free net/core/net_namespace.c:151 [inline]
       ops_free_list.part.7+0x156/0x220 net/core/net_namespace.c:184
       ops_free_list net/core/net_namespace.c:182 [inline]
       __unregister_pernet_operations net/core/net_namespace.c:1165 [inline]
       unregister_pernet_operations+0x221/0x2a0 net/core/net_namespace.c:1224
       unregister_pernet_subsys+0x1d/0x30 net/core/net_namespace.c:1271
       nsim_fib_exit+0x11/0x20 [netdevsim]
       nsim_module_exit+0x16/0x21 [netdevsim]
       __do_sys_delete_module kernel/module.c:1015 [inline]
       __se_sys_delete_module kernel/module.c:958 [inline]
       __x64_sys_delete_module+0x244/0x330 kernel/module.c:958
       do_syscall_64+0x72/0x2e0 arch/x86/entry/common.c:296
       entry_SYSCALL_64_after_hwframe+0x49/0xbe
      Reported-by: NHulk Robot <hulkci@huawei.com>
      Fixes: 59c84b9f ("netdevsim: Restore per-network namespace accounting for fib entries")
      Signed-off-by: NYueHaibing <yuehaibing@huawei.com>
      Acked-by: NJakub Kicinski <jakub.kicinski@netronome.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      33902b4a
    • C
      net/ibmvnic: Fix EOI when running in XIVE mode. · 11d49ce9
      Cédric Le Goater 提交于
      pSeries machines on POWER9 processors can run with the XICS (legacy)
      interrupt mode or with the XIVE exploitation interrupt mode. These
      interrupt contollers have different interfaces for interrupt
      management : XICS uses hcalls and XIVE loads and stores on a page.
      H_EOI being a XICS interface the enable_scrq_irq() routine can fail
      when the machine runs in XIVE mode.
      
      Fix that by calling the EOI handler of the interrupt chip.
      
      Fixes: f23e0643 ("ibmvnic: Clear pending interrupt after device reset")
      Signed-off-by: NCédric Le Goater <clg@kaod.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      11d49ce9
    • A
      net: lpc_eth: avoid resetting twice · c23936fa
      Alexandre Belloni 提交于
      __lpc_eth_shutdown is called after __lpc_eth_reset but it is already
      calling __lpc_eth_reset. Avoid resetting the IP twice.
      Signed-off-by: NAlexandre Belloni <alexandre.belloni@bootlin.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c23936fa
  6. 11 10月, 2019 1 次提交
  7. 10 10月, 2019 6 次提交
    • E
      tun: remove possible false sharing in tun_flow_update() · 4ffdd22e
      Eric Dumazet 提交于
      As mentioned in https://github.com/google/ktsan/wiki/READ_ONCE-and-WRITE_ONCE#it-may-improve-performance
      a C compiler can legally transform
      
      if (e->queue_index != queue_index)
      	e->queue_index = queue_index;
      
      to :
      
      	e->queue_index = queue_index;
      
      Note that the code using jiffies has no issue, since jiffies
      has volatile attribute.
      
      if (e->updated != jiffies)
          e->updated = jiffies;
      
      Fixes: 83b1bc12 ("tun: align write-heavy flow entry members to a cache line")
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Cc: Zhang Yu <zhangyu31@baidu.com>
      Cc: Wang Li <wangli39@baidu.com>
      Cc: Li RongQing <lirongqing@baidu.com>
      Acked-by: NJason Wang <jasowang@redhat.com>
      Signed-off-by: NJakub Kicinski <jakub.kicinski@netronome.com>
      4ffdd22e
    • D
      net: usb: qmi_wwan: add Telit 0x1050 composition · e0ae2c57
      Daniele Palmas 提交于
      This patch adds support for Telit FN980 0x1050 composition
      
      0x1050: tty, adb, rmnet, tty, tty, tty, tty
      Signed-off-by: NDaniele Palmas <dnlplm@gmail.com>
      Acked-by: NBjørn Mork <bjorn@mork.no>
      Signed-off-by: NJakub Kicinski <jakub.kicinski@netronome.com>
      e0ae2c57
    • R
      phylink: fix kernel-doc warnings · 9db74e51
      Randy Dunlap 提交于
      Fix kernel-doc warnings in phylink.c:
      
      ../drivers/net/phy/phylink.c:595: warning: Function parameter or member 'config' not described in 'phylink_create'
      ../drivers/net/phy/phylink.c:595: warning: Excess function parameter 'ndev' description in 'phylink_create'
      
      Fixes: 8796c892 ("phylink: add documentation for kernel APIs")
      Signed-off-by: NRandy Dunlap <rdunlap@infradead.org>
      Cc: Russell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: NJakub Kicinski <jakub.kicinski@netronome.com>
      9db74e51
    • E
      bonding: fix potential NULL deref in bond_update_slave_arr · a7137534
      Eric Dumazet 提交于
      syzbot got a NULL dereference in bond_update_slave_arr() [1],
      happening after a failure to allocate bond->slave_arr
      
      A workqueue (bond_slave_arr_handler) is supposed to retry
      the allocation later, but if the slave is removed before
      the workqueue had a chance to complete, bond->slave_arr
      can still be NULL.
      
      [1]
      
      Failed to build slave-array.
      kasan: CONFIG_KASAN_INLINE enabled
      kasan: GPF could be caused by NULL-ptr deref or user memory access
      general protection fault: 0000 [#1] SMP KASAN PTI
      Modules linked in:
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
      RIP: 0010:bond_update_slave_arr.cold+0xc6/0x198 drivers/net/bonding/bond_main.c:4039
      RSP: 0018:ffff88018fe33678 EFLAGS: 00010246
      RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffffc9000290b000
      RDX: 0000000000000000 RSI: ffffffff82b63037 RDI: ffff88019745ea20
      RBP: ffff88018fe33760 R08: ffff880170754280 R09: 0000000000000000
      R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
      R13: ffff88019745ea00 R14: 0000000000000000 R15: ffff88018fe338b0
      FS:  00007febd837d700(0000) GS:ffff8801dad00000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 00000000004540a0 CR3: 00000001c242e005 CR4: 00000000001626f0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      Call Trace:
       [<ffffffff82b5b45e>] __bond_release_one+0x43e/0x500 drivers/net/bonding/bond_main.c:1923
       [<ffffffff82b5b966>] bond_release drivers/net/bonding/bond_main.c:2039 [inline]
       [<ffffffff82b5b966>] bond_do_ioctl+0x416/0x870 drivers/net/bonding/bond_main.c:3562
       [<ffffffff83ae25f4>] dev_ifsioc+0x6f4/0x940 net/core/dev_ioctl.c:328
       [<ffffffff83ae2e58>] dev_ioctl+0x1b8/0xc70 net/core/dev_ioctl.c:495
       [<ffffffff83995ffd>] sock_do_ioctl+0x1bd/0x300 net/socket.c:1088
       [<ffffffff83996a80>] sock_ioctl+0x300/0x5d0 net/socket.c:1196
       [<ffffffff81b124db>] vfs_ioctl fs/ioctl.c:47 [inline]
       [<ffffffff81b124db>] file_ioctl fs/ioctl.c:501 [inline]
       [<ffffffff81b124db>] do_vfs_ioctl+0xacb/0x1300 fs/ioctl.c:688
       [<ffffffff81b12dc6>] SYSC_ioctl fs/ioctl.c:705 [inline]
       [<ffffffff81b12dc6>] SyS_ioctl+0xb6/0xe0 fs/ioctl.c:696
       [<ffffffff8101ccc8>] do_syscall_64+0x528/0x770 arch/x86/entry/common.c:305
       [<ffffffff84400091>] entry_SYSCALL_64_after_hwframe+0x42/0xb7
      
      Fixes: ee637714 ("bonding: Simplify the xmit function for modes that use xmit_hash")
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Reported-by: Nsyzbot <syzkaller@googlegroups.com>
      Cc: Mahesh Bandewar <maheshb@google.com>
      Signed-off-by: NJakub Kicinski <jakub.kicinski@netronome.com>
      a7137534
    • A
      net: stmmac: fix disabling flexible PPS output · 520cf600
      Antonio Borneo 提交于
      Accordingly to Synopsys documentation [1] and [2], when bit PPSEN0
      in register MAC_PPS_CONTROL is set it selects the functionality
      command in the same register, otherwise selects the functionality
      control.
      Command functionality is required to either enable (command 0x2)
      and disable (command 0x5) the flexible PPS output, but the bit
      PPSEN0 is currently set only for enabling.
      
      Set the bit PPSEN0 to properly disable flexible PPS output.
      
      Tested on STM32MP15x, based on dwmac 4.10a.
      
      [1] DWC Ethernet QoS Databook 4.10a October 2014
      [2] DWC Ethernet QoS Databook 5.00a September 2017
      Signed-off-by: NAntonio Borneo <antonio.borneo@st.com>
      Fixes: 9a8a02c9 ("net: stmmac: Add Flexible PPS support")
      Signed-off-by: NJakub Kicinski <jakub.kicinski@netronome.com>
      520cf600
    • A
      net: stmmac: fix length of PTP clock's name string · 5da202c8
      Antonio Borneo 提交于
      The field "name" in struct ptp_clock_info has a fixed size of 16
      chars and is used as zero terminated string by clock_name_show()
      in drivers/ptp/ptp_sysfs.c
      The current initialization value requires 17 chars to fit also the
      null termination, and this causes overflow to the next bytes in
      the struct when the string is read as null terminated:
      	hexdump -C /sys/class/ptp/ptp0/clock_name
      	00000000  73 74 6d 6d 61 63 5f 70  74 70 5f 63 6c 6f 63 6b  |stmmac_ptp_clock|
      	00000010  a0 ac b9 03 0a                                    |.....|
      where the extra 4 bytes (excluding the newline) after the string
      represent the integer 0x03b9aca0 = 62500000 assigned to the field
      "max_adj" that follows "name" in the same struct.
      
      There is no strict requirement for the "name" content and in the
      comment in ptp_clock_kernel.h it's reported it should just be 'A
      short "friendly name" to identify the clock'.
      Replace it with "stmmac ptp".
      Signed-off-by: NAntonio Borneo <antonio.borneo@st.com>
      Fixes: 92ba6888 ("stmmac: add the support for PTP hw clock driver")
      Signed-off-by: NJakub Kicinski <jakub.kicinski@netronome.com>
      5da202c8
  8. 09 10月, 2019 8 次提交
    • L
      iwlwifi: pcie: change qu with jf devices to use qu configuration · aa0cc7dd
      Luca Coelho 提交于
      There were a bunch of devices with qu and jf that were loading the
      configuration with pu and jf, which is wrong.  Fix them all
      accordingly.  Additionally, remove 0x1010 and 0x1210 subsytem IDs from
      the list, since they are obviously wrong, and 0x0044 and 0x0244, which
      were duplicate.
      
      Cc: stable@vger.kernel.org # 5.1+
      Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
      aa0cc7dd
    • L
      iwlwifi: exclude GEO SAR support for 3168 · 12e36d98
      Luca Coelho 提交于
      We currently support two NICs in FW version 29, namely 7265D and 3168.
      Out of these, only 7265D supports GEO SAR, so adjust the function that
      checks for it accordingly.
      Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
      Fixes: f5a47fae ("iwlwifi: mvm: fix version check for GEO_TX_POWER_LIMIT support")
      Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
      12e36d98
    • N
      iwlwifi: pcie: fix memory leaks in iwl_pcie_ctxt_info_gen3_init · 0f4f1994
      Navid Emamdoost 提交于
      In iwl_pcie_ctxt_info_gen3_init there are cases that the allocated dma
      memory is leaked in case of error.
      
      DMA memories prph_scratch, prph_info, and ctxt_info_gen3 are allocated
      and initialized to be later assigned to trans_pcie. But in any error case
      before such assignment the allocated memories should be released.
      
      First of such error cases happens when iwl_pcie_init_fw_sec fails.
      Current implementation correctly releases prph_scratch. But in two
      sunsequent error cases where dma_alloc_coherent may fail, such
      releases are missing.
      
      This commit adds release for prph_scratch when allocation for
      prph_info fails, and adds releases for prph_scratch and prph_info when
      allocation for ctxt_info_gen3 fails.
      
      Fixes: 2ee82402 ("iwlwifi: pcie: support context information for 22560 devices")
      Signed-off-by: NNavid Emamdoost <navid.emamdoost@gmail.com>
      Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
      0f4f1994
    • N
      iwlwifi: dbg_ini: fix memory leak in alloc_sgtable · b4b814fe
      Navid Emamdoost 提交于
      In alloc_sgtable if alloc_page fails, the alocated table should be
      released.
      Signed-off-by: NNavid Emamdoost <navid.emamdoost@gmail.com>
      Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
      b4b814fe
    • J
      iwlwifi: pcie: fix rb_allocator workqueue allocation · 8188a18e
      Johannes Berg 提交于
      We don't handle failures in the rb_allocator workqueue allocation
      correctly. To fix that, move the code earlier so the cleanup is
      easier and we don't have to undo all the interrupt allocations in
      this case.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
      8188a18e
    • J
      iwlwifi: pcie: fix indexing in command dump for new HW · 08326a97
      Johannes Berg 提交于
      We got a crash in iwl_trans_pcie_get_cmdlen(), while the TFD was
      being accessed to sum up the lengths.
      
      We want to access the TFD here, which is the information for the
      hardware. We always only allocate 32 buffers for the cmd queue,
      but on newer hardware (using TFH) we can also allocate only a
      shorter hardware array, also only 32 TFDs. Prior to the TFH, we
      had to allocate a bigger TFD array but would make those point to
      a smaller set of buffers.
      
      Additionally, now max_tfd_queue_size is up to 65536, so we can
      access *way* out of bounds of a really only 32-entry array, so
      it crashes.
      
      Fix this by making the TFD index depend on which hardware we are
      using right now.
      
      While changing the calculation, also fix it to not use void ptr
      arithmetic, but cast to u8 * before.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
      08326a97
    • N
      iwlwifi: mvm: fix race in sync rx queue notification · a2113cc4
      Naftali Goldstein 提交于
      Consider the following flow:
       1. Driver starts to sync the rx queues due to a delba.
          mvm->queue_sync_cookie=1.
          This rx-queues-sync is synchronous, so it doesn't increment the
          cookie until all rx queues handle the notification from FW.
       2. During this time, driver starts to sync rx queues due to nssn sync
          required.
          The cookie's value is still 1, but it doesn't matter since this
          rx-queue-sync is non-synchronous so in the notification handler the
          cookie is ignored.
          What _does_ matter is that this flow increments the cookie to 2
          immediately.
          Remember though that the FW won't start servicing this command until
          it's done with the previous one.
       3. FW is still handling the first command, so it sends a notification
          with internal_notif->sync=1, and internal_notif->cookie=0, which
          triggers a WARN_ONCE.
      
      The solution for this race is to only use the mvm->queue_sync_cookie in
      case of a synchronous sync-rx-queues. This way in step 2 the cookie's
      value won't change so we avoid the WARN.
      
      The commit in the "fixes" field is the first commit to introduce
      non-synchronous sending of this command to FW.
      
      Fixes: 3c514bf8 ("iwlwifi: mvm: add a loose synchronization of the NSSN across Rx queues")
      Signed-off-by: NNaftali Goldstein <naftali.goldstein@intel.com>
      Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
      a2113cc4
    • H
      iwlwifi: mvm: force single phy init · a4584729
      Haim Dreyfuss 提交于
      The PHY is initialized during device initialization, but devices with
      the tx_siso_diversity flag set need to send PHY_CONFIGURATION_CMD first,
      otherwise the PHY would be reinitialized, causing a SYSASSERT.
      
      To fix this, use a bit that tells the FW not to complete the PHY
      initialization before a PHY_CONFIGURATION_CMD is received.
      Signed-off-by: NHaim Dreyfuss <haim.dreyfuss@intel.com>
      Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
      a4584729