1. 13 2月, 2019 9 次提交
  2. 26 1月, 2019 2 次提交
    • A
      iwlwifi: mvm: Send LQ command as async when necessary · d9bcbcb7
      Avraham Stern 提交于
      commit 3baf7528d6f832b28622d1ddadd2e47f6c2b5e08 upstream.
      
      The parameter that indicated whether the LQ command should be sent
      as sync or async was removed, causing the LQ command to be sent as
      sync from interrupt context (e.g. from the RX path). This resulted
      in a kernel warning: "scheduling while atomic" and failing to send
      the LQ command, which ultimately leads to a queue hang.
      
      Fix it by adding back the required parameter to send the command as
      sync only when it is allowed.
      
      Fixes: d94c5a82 ("iwlwifi: mvm: open BA session only when sta is authorized")
      Signed-off-by: NAvraham Stern <avraham.stern@intel.com>
      Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
      Signed-off-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d9bcbcb7
    • Z
      ath10k: fix peer stats null pointer dereference · dd619b90
      Zhi Chen 提交于
      [ Upstream commit 2d3b55853b123c177037cf534c5aaa2650310094 ]
      
      There was a race condition in SMP that an ath10k_peer was created but its
      member sta was null. Following are procedures of ath10k_peer creation and
      member sta access in peer statistics path.
      
          1. Peer creation:
              ath10k_peer_create()
                  =>ath10k_wmi_peer_create()
                      =>ath10k_wait_for_peer_created()
                      ...
      
              # another kernel path, RX from firmware
              ath10k_htt_t2h_msg_handler()
              =>ath10k_peer_map_event()
                      =>wake_up()
                      # ar->peer_map[id] = peer //add peer to map
      
              #wake up original path from waiting
                      ...
                      # peer->sta = sta //sta assignment
      
          2.  RX path of statistics
              ath10k_htt_t2h_msg_handler()
                  =>ath10k_update_per_peer_tx_stats()
                      =>ath10k_htt_fetch_peer_stats()
                      # peer->sta //sta accessing
      
      Any access of peer->sta after peer was added to peer_map but before sta was
      assigned could cause a null pointer issue. And because these two steps are
      asynchronous, no proper lock can protect them. So both peer and sta need to
      be checked before access.
      
      Tested: QCA9984 with firmware ver 10.4-3.9.0.1-00005
      Signed-off-by: NZhi Chen <zhichen@codeaurora.org>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      dd619b90
  3. 13 1月, 2019 3 次提交
  4. 10 1月, 2019 2 次提交
    • L
      brcmfmac: Fix out of bounds memory access during fw load · 71cda0af
      Lyude Paul 提交于
      commit b72c51a58e6d63ef673ac96b8ab5bc98799c5f7b upstream.
      
      I ended up tracking down some rather nasty issues with f2fs (and other
      filesystem modules) constantly crashing on my kernel down to a
      combination of out of bounds memory accesses, one of which was coming
      from brcmfmac during module load:
      
      [   30.891382] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac4356-sdio for chip BCM4356/2
      [   30.894437] ==================================================================
      [   30.901581] BUG: KASAN: global-out-of-bounds in brcmf_fw_alloc_request+0x42c/0x480 [brcmfmac]
      [   30.909935] Read of size 1 at addr ffff2000024865df by task kworker/6:2/387
      [   30.916805]
      [   30.918261] CPU: 6 PID: 387 Comm: kworker/6:2 Tainted: G           O      4.20.0-rc3Lyude-Test+ #19
      [   30.927251] Hardware name: amlogic khadas-vim2/khadas-vim2, BIOS 2018.07-rc2-armbian 09/11/2018
      [   30.935964] Workqueue: events brcmf_driver_register [brcmfmac]
      [   30.941641] Call trace:
      [   30.944058]  dump_backtrace+0x0/0x3e8
      [   30.947676]  show_stack+0x14/0x20
      [   30.950968]  dump_stack+0x130/0x1c4
      [   30.954406]  print_address_description+0x60/0x25c
      [   30.959066]  kasan_report+0x1b4/0x368
      [   30.962683]  __asan_report_load1_noabort+0x18/0x20
      [   30.967547]  brcmf_fw_alloc_request+0x42c/0x480 [brcmfmac]
      [   30.967639]  brcmf_sdio_probe+0x163c/0x2050 [brcmfmac]
      [   30.978035]  brcmf_ops_sdio_probe+0x598/0xa08 [brcmfmac]
      [   30.983254]  sdio_bus_probe+0x190/0x398
      [   30.983270]  really_probe+0x2a0/0xa70
      [   30.983296]  driver_probe_device+0x1b4/0x2d8
      [   30.994901]  __driver_attach+0x200/0x280
      [   30.994914]  bus_for_each_dev+0x10c/0x1a8
      [   30.994925]  driver_attach+0x38/0x50
      [   30.994935]  bus_add_driver+0x330/0x608
      [   30.994953]  driver_register+0x140/0x388
      [   31.013965]  sdio_register_driver+0x74/0xa0
      [   31.014076]  brcmf_sdio_register+0x14/0x60 [brcmfmac]
      [   31.023177]  brcmf_driver_register+0xc/0x18 [brcmfmac]
      [   31.023209]  process_one_work+0x654/0x1080
      [   31.032266]  worker_thread+0x4f0/0x1308
      [   31.032286]  kthread+0x2a8/0x320
      [   31.039254]  ret_from_fork+0x10/0x1c
      [   31.039269]
      [   31.044226] The buggy address belongs to the variable:
      [   31.044351]  brcmf_firmware_path+0x11f/0xfffffffffffd3b40 [brcmfmac]
      [   31.055601]
      [   31.057031] Memory state around the buggy address:
      [   31.061800]  ffff200002486480: 04 fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
      [   31.068983]  ffff200002486500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      [   31.068993] >ffff200002486580: 00 00 00 00 00 00 00 00 fa fa fa fa 00 00 00 00
      [   31.068999]                                                     ^
      [   31.069017]  ffff200002486600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      [   31.096521]  ffff200002486680: 00 00 00 00 00 00 00 00 00 00 00 00 fa fa fa fa
      [   31.096528] ==================================================================
      [   31.096533] Disabling lock debugging due to kernel taint
      
      It appears that when trying to determine the length of the string in the
      alternate firmware path, we make the mistake of not handling the case
      where the firmware path is empty correctly. Since strlen(mp_path) can
      return 0, we'll end up accessing mp_path[-1] when the firmware_path
      isn't provided through the module arguments.
      
      So, fix this by just setting the end char to '\0' by default, and only
      changing it if we have a non-zero length. Additionally, use strnlen()
      with BRCMF_FW_ALTPATH_LEN instead of strlen() just to be extra safe.
      
      Fixes: 2baa3aae ("brcmfmac: introduce brcmf_fw_alloc_request() function")
      Cc: Hante Meuleman <hante.meuleman@broadcom.com>
      Cc: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
      Cc: Franky Lin <franky.lin@broadcom.com>
      Cc: Arend van Spriel <arend.vanspriel@broadcom.com>
      Cc: Kalle Valo <kvalo@codeaurora.org>
      Cc: Arend Van Spriel <arend.vanspriel@broadcom.com>
      Cc: Himanshu Jha <himanshujha199640@gmail.com>
      Cc: Dan Haab <dhaab@luxul.com>
      Cc: Jia-Shyr Chuang <saint.chuang@cypress.com>
      Cc: Ian Molton <ian@mnementh.co.uk>
      Cc: <stable@vger.kernel.org> # v4.17+
      Signed-off-by: NLyude Paul <lyude@redhat.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      71cda0af
    • S
      brcmfmac: fix roamoff=1 modparam · fad6c183
      Stijn Tintel 提交于
      commit 8c892df41500469729e0d662816300196e4f463d upstream.
      
      When the update_connect_param callback is set, nl80211 expects the flag
      WIPHY_FLAG_SUPPORTS_FW_ROAM to be set as well. However, this flag is
      only set when modparam roamoff=0, while the callback is set
      unconditionally. Since commit 7f9a3e15 this causes a warning in
      wiphy_register, which breaks brcmfmac.
      
      Disable the update_connect_param callback when roamoff=0 to fix this.
      
      Fixes: 7f9a3e15 ("nl80211: Update ERP info using NL80211_CMD_UPDATE_CONNECT_PARAMS")
      Cc: Stable <stable@vger.kernel.org> # 4.19+
      Signed-off-by: NJonas Gorski <jonas.gorski@gmail.com>
      Signed-off-by: NStijn Tintel <stijn@linux-ipv6.be>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      fad6c183
  5. 29 12月, 2018 4 次提交
  6. 21 12月, 2018 1 次提交
  7. 13 12月, 2018 3 次提交
  8. 01 12月, 2018 5 次提交
    • R
      brcmfmac: fix reporting support for 160 MHz channels · 54923bc7
      Rafał Miłecki 提交于
      commit d1fe6ad6f6bd61c84788d3a7b11e459a439c6169 upstream.
      
      Driver can report IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ so it's
      important to provide valid & complete info about supported bands for
      each channel. By default no support for 160 MHz should be assumed unless
      firmware reports it for a given channel later.
      
      This fixes info passed to the userspace. Without that change userspace
      could try to use invalid channel and fail to start an interface.
      Signed-off-by: NRafał Miłecki <rafal@milecki.pl>
      Cc: stable@vger.kernel.org
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      54923bc7
    • L
      iwlwifi: mvm: don't use SAR Geo if basic SAR is not used · c74c926f
      Luca Coelho 提交于
      commit 5d041c46ccb9b48acc110e214beff5e2789311df upstream.
      
      We can't use SAR Geo if basic SAR is not enabled, since the SAR Geo
      tables define offsets in relation to the basic SAR table in use.
      
      To fix this, make iwl_mvm_sar_init() return one in case WRDS is not
      available, so we can skip reading WGDS entirely.
      
      Fixes: a6bff3cb ("iwlwifi: mvm: add GEO_TX_POWER_LIMIT cmd for geographic tx power table")
      Cc: stable@vger.kernel.org # 4.12+
      Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c74c926f
    • E
      iwlwifi: mvm: fix regulatory domain update when the firmware starts · 49697515
      Emmanuel Grumbach 提交于
      commit 82715ac71e6b94a2c2136e31f3a8e6748e33aa8c upstream.
      
      When the firmware starts, it doesn't have any regulatory
      information, hence it uses the world wide limitations. The
      driver can feed the firmware with previous knowledge that
      was kept in the driver, but the firmware may still not
      update its internal tables.
      
      This happens when we start a BSS interface, and then the
      firmware can change the regulatory tables based on our
      location and it'll use more lenient, location specific
      rules. Then, if the firmware is shut down (when the
      interface is brought down), and then an AP interface is
      created, the firmware will forget the country specific
      rules.
      
      The host will think that we are in a certain country that
      may allow channels and will try to teach the firmware about
      our location, but the firmware may still not allow to drop
      the world wide limitations and apply country specific rules
      because it was just re-started.
      
      In this case, the firmware will reply with MCC_RESP_ILLEGAL
      to the MCC_UPDATE_CMD. In that case, iwlwifi needs to let
      the upper layers (cfg80211 / hostapd) know that the channel
      list they know about has been updated.
      
      This fixes https://bugzilla.kernel.org/show_bug.cgi?id=201105
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      49697515
    • E
      iwlwifi: mvm: support sta_statistics() even on older firmware · b643d705
      Emmanuel Grumbach 提交于
      commit ec484d03ef0df8d34086b95710e355a259cbe1f2 upstream.
      
      The oldest firmware supported by iwlmvm do support getting
      the average beacon RSSI. Enable the sta_statistics() call
      from mac80211 even on older firmware versions.
      
      Fixes: 33cef925 ("iwlwifi: mvm: support beacon statistics for BSS client")
      Cc: stable@vger.kernel.org # 4.2+
      Signed-off-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b643d705
    • M
      iwlwifi: fix wrong WGDS_WIFI_DATA_SIZE · 29d920ba
      Matt Chen 提交于
      commit 66e839030fd698586734e017fd55c4f2a89dba0b upstream.
      
      From coreboot/BIOS:
      Name ("WGDS", Package() {
       Revision,
       Package() {
           DomainType,                         // 0x7:WiFi ==> We miss this one.
           WgdsWiFiSarDeltaGroup1PowerMax1,    // Group 1 FCC 2400 Max
           WgdsWiFiSarDeltaGroup1PowerChainA1, // Group 1 FCC 2400 A Offset
           WgdsWiFiSarDeltaGroup1PowerChainB1, // Group 1 FCC 2400 B Offset
           WgdsWiFiSarDeltaGroup1PowerMax2,    // Group 1 FCC 5200 Max
           WgdsWiFiSarDeltaGroup1PowerChainA2, // Group 1 FCC 5200 A Offset
           WgdsWiFiSarDeltaGroup1PowerChainB2, // Group 1 FCC 5200 B Offset
           WgdsWiFiSarDeltaGroup2PowerMax1,    // Group 2 EC Jap 2400 Max
           WgdsWiFiSarDeltaGroup2PowerChainA1, // Group 2 EC Jap 2400 A Offset
           WgdsWiFiSarDeltaGroup2PowerChainB1, // Group 2 EC Jap 2400 B Offset
           WgdsWiFiSarDeltaGroup2PowerMax2,    // Group 2 EC Jap 5200 Max
           WgdsWiFiSarDeltaGroup2PowerChainA2, // Group 2 EC Jap 5200 A Offset
           WgdsWiFiSarDeltaGroup2PowerChainB2, // Group 2 EC Jap 5200 B Offset
           WgdsWiFiSarDeltaGroup3PowerMax1,    // Group 3 ROW 2400 Max
           WgdsWiFiSarDeltaGroup3PowerChainA1, // Group 3 ROW 2400 A Offset
           WgdsWiFiSarDeltaGroup3PowerChainB1, // Group 3 ROW 2400 B Offset
           WgdsWiFiSarDeltaGroup3PowerMax2,    // Group 3 ROW 5200 Max
           WgdsWiFiSarDeltaGroup3PowerChainA2, // Group 3 ROW 5200 A Offset
           WgdsWiFiSarDeltaGroup3PowerChainB2, // Group 3 ROW 5200 B Offset
       }
      })
      
      When read the ACPI data to find out the WGDS, the DATA_SIZE is never
      matched.
      From the above format, it gives 19 numbers, but our driver is hardcode
      as 18.
      Fix it to pass then can parse the data into our wgds table.
      Then we will see:
      iwlwifi 0000:01:00.0: U iwl_mvm_sar_geo_init Sending GEO_TX_POWER_LIMIT
      iwlwifi 0000:01:00.0: U iwl_mvm_sar_geo_init SAR geographic profile[0]
      Band[0]: chain A = 68 chain B = 69 max_tx_power = 54
      iwlwifi 0000:01:00.0: U iwl_mvm_sar_geo_init SAR geographic profile[0]
      Band[1]: chain A = 48 chain B = 49 max_tx_power = 70
      iwlwifi 0000:01:00.0: U iwl_mvm_sar_geo_init SAR geographic profile[1]
      Band[0]: chain A = 51 chain B = 67 max_tx_power = 50
      iwlwifi 0000:01:00.0: U iwl_mvm_sar_geo_init SAR geographic profile[1]
      Band[1]: chain A = 69 chain B = 70 max_tx_power = 68
      iwlwifi 0000:01:00.0: U iwl_mvm_sar_geo_init SAR geographic profile[2]
      Band[0]: chain A = 49 chain B = 50 max_tx_power = 48
      iwlwifi 0000:01:00.0: U iwl_mvm_sar_geo_init SAR geographic profile[2]
      Band[1]: chain A = 52 chain B = 53 max_tx_power = 51
      
      Cc: stable@vger.kernel.org # 4.12+
      Fixes: a6bff3cb ("iwlwifi: mvm: add GEO_TX_POWER_LIMIT cmd for geographic tx power table")
      Signed-off-by: NMatt Chen <matt.chen@intel.com>
      Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      29d920ba
  9. 27 11月, 2018 1 次提交
  10. 14 11月, 2018 10 次提交
    • L
      iwlwifi: mvm: check return value of rs_rate_from_ucode_rate() · 3fa27214
      Luca Coelho 提交于
      commit 3d71c3f1f50cf309bd20659422af549bc784bfff upstream.
      
      The rs_rate_from_ucode_rate() function may return -EINVAL if the rate
      is invalid, but none of the callsites check for the error, potentially
      making us access arrays with index IWL_RATE_INVALID, which is larger
      than the arrays, causing an out-of-bounds access.  This will trigger
      KASAN warnings, such as the one reported in the bugzilla issue
      mentioned below.
      
      This fixes https://bugzilla.kernel.org/show_bug.cgi?id=200659
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3fa27214
    • F
      mt76: mt76x2: fix multi-interface beacon configuration · 77f61e70
      Felix Fietkau 提交于
      commit 5289976ad887deb07c76df7eecf553c264aeebed upstream.
      
      If the first virtual interface is a station (or an AP with beacons
      temporarily disabled), the beacon of the second interface needs to
      occupy hardware beacon slot 0.
      For some reason the beacon index was incorrectly masked with the
      virtual interface beacon mask, which prevents the secondary
      interface from sending beacons unless the first one also does.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NFelix Fietkau <nbd@nbd.name>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      77f61e70
    • L
      libertas: don't set URB_ZERO_PACKET on IN USB transfer · f253f6de
      Lubomir Rintel 提交于
      commit 6528d88047801b80d2a5370ad46fb6eff2f509e0 upstream.
      
      The USB core gets rightfully upset:
      
        usb 1-1: BOGUS urb flags, 240 --> 200
        WARNING: CPU: 0 PID: 60 at drivers/usb/core/urb.c:503 usb_submit_urb+0x2f8/0x3ed
        Modules linked in:
        CPU: 0 PID: 60 Comm: kworker/0:3 Not tainted 4.19.0-rc6-00319-g5206d00a45c7 #39
        Hardware name: OLPC XO/XO, BIOS OLPC Ver 1.00.01 06/11/2014
        Workqueue: events request_firmware_work_func
        EIP: usb_submit_urb+0x2f8/0x3ed
        Code: 75 06 8b 8f 80 00 00 00 8d 47 78 89 4d e4 89 55 e8 e8 35 1c f6 ff 8b 55 e8 56 52 8b 4d e4 51 50 68 e3 ce c7 c0 e8 ed 18 c6 ff <0f> 0b 83 c4 14 80 7d ef 01 74 0a 80 7d ef 03 0f 85 b8 00 00 00 8b
        EAX: 00000025 EBX: ce7d4980 ECX: 00000000 EDX: 00000001
        ESI: 00000200 EDI: ce7d8800 EBP: ce7f5ea8 ESP: ce7f5e70
        DS: 007b ES: 007b FS: 0000 GS: 00e0 SS: 0068 EFLAGS: 00210292
        CR0: 80050033 CR2: 00000000 CR3: 00e80000 CR4: 00000090
        Call Trace:
         ? if_usb_fw_timeo+0x64/0x64
         __if_usb_submit_rx_urb+0x85/0xe6
         ? if_usb_fw_timeo+0x64/0x64
         if_usb_submit_rx_urb_fwload+0xd/0xf
         if_usb_prog_firmware+0xc0/0x3db
         ? _request_firmware+0x54/0x47b
         ? _request_firmware+0x89/0x47b
         ? if_usb_probe+0x412/0x412
         lbs_fw_loaded+0x55/0xa6
         ? debug_smp_processor_id+0x12/0x14
         helper_firmware_cb+0x3c/0x3f
         request_firmware_work_func+0x37/0x6f
         process_one_work+0x164/0x25a
         worker_thread+0x1c4/0x284
         kthread+0xec/0xf1
         ? cancel_delayed_work_sync+0xf/0xf
         ? kthread_create_on_node+0x1a/0x1a
         ret_from_fork+0x2e/0x38
        ---[ end trace 3ef1e3b2dd53852f ]---
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NLubomir Rintel <lkundrak@v3.sk>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f253f6de
    • M
      ath10k: schedule hardware restart if WMI command times out · 27baa32c
      Martin Willi 提交于
      [ Upstream commit a9911937e7d332761e8c4fcbc7ba0426bdc3956f ]
      
      When running in AP mode, ath10k sometimes suffers from TX credit
      starvation. The issue is hard to reproduce and shows up once in a
      few days, but has been repeatedly seen with QCA9882 and a large
      range of firmwares, including 10.2.4.70.67.
      
      Once the module is in this state, TX credits are never replenished,
      which results in "SWBA overrun" errors, as no beacons can be sent.
      Even worse, WMI commands run in a timeout while holding the conf
      mutex for three seconds each, making any further operations slow
      and the whole system unresponsive.
      
      The firmware/driver never recovers from that state automatically,
      and triggering TX flush or warm restarts won't work over WMI. So
      issue a hardware restart if a WMI command times out due to missing
      TX credits. This implies a connectivity outage of about 1.4s in AP
      mode, but brings back the interface and the whole system to a usable
      state. WMI command timeouts have not been seen in absent of this
      specific issue, so taking such drastic actions seems legitimate.
      Signed-off-by: NMartin Willi <martin@strongswan.org>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      27baa32c
    • M
      wil6210: fix RX buffers release and unmap · b8345244
      Maya Erez 提交于
      [ Upstream commit 84f16fbb62384fb209cd35741d94eb00b5ca2746 ]
      
      RX SKBs are released in both wil6210 rmmod and RX handle.
      As there is no lock to protect the buffers DMA unmap,
      the SKB pointer in buff_arr is used to check if the buffer
      memory was already released.
      Setting wil->rx_buff_mgmt.buff_arr[buff_id].skb to NULL before the DMA
      memory unmap will prevent duplicate unmapping of the same memory.
      Move the buffer ID to the free list also in case the SKB is NULL.
      Signed-off-by: NMaya Erez <merez@codeaurora.org>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b8345244
    • S
      iwlwifi: mvm: fix BAR seq ctrl reporting · 8ba36c16
      Sara Sharon 提交于
      [ Upstream commit 941ab4eb66c10bc5c7234e83a7a858b2806ed151 ]
      
      There is a bug in FW where the sequence control may be
      incorrect, and the driver overrides it with the value
      of the ieee80211 header.
      
      However, in BAR there is no sequence control in the header,
      which result with arbitrary sequence.
      
      This access to an unknown location is bad and it makes the
      logs very confusing - so fix it.
      Signed-off-by: NSara Sharon <sara.sharon@intel.com>
      Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8ba36c16
    • D
      libertas_tf: prevent underflow in process_cmdrequest() · 44e0f15b
      Dan Carpenter 提交于
      [ Upstream commit 3348ef6a6a126706d6a73ed40c18d8033df72783 ]
      
      If recvlength is less than MESSAGE_HEADER_LEN (4) we would end up
      corrupting memory.
      
      Fixes: c305a19a ("libertas_tf: usb specific functions")
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      44e0f15b
    • S
      rsi: fix memory alignment issue in ARM32 platforms · 14e0b9bb
      Siva Rebbagondla 提交于
      [ Upstream commit baa8caf4ab7af2d9e84b566b99fe919a4e9e7562 ]
      
      During testing in ARM32 platforms, observed below kernel panic, as driver
      accessing data beyond the allocated memory while submitting URB to USB.
      
      Fix: Resolved this by specifying correct length by considering 64 bit
      alignment. so that, USB bus driver will access only allocated memory.
      
      Unit-test: Tested and confirm that driver bring up and scanning,
      connection and data transfer works fine with this fix.
      
      ...skipping...
      [   25.389450] Unable to handle kernel paging request at virtual
      	       address 5aa11422
      [   25.403078] Internal error: Oops: 5 [#1] SMP ARM
      [   25.407703] Modules linked in: rsi_usb
      [   25.411473] CPU: 1 PID: 317 Comm: RX-Thread Not tainted 4.18.0-rc7 #1
      [   25.419221] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
      [   25.425764] PC is at skb_release_data+0x90/0x168
      [   25.430393] LR is at skb_release_all+0x28/0x2c
      [   25.434842] pc : [<807435b0>] lr : [<80742ba0>] psr: 200e0013 5aa1141e
      [   25.464633] Flags: nzCv  IRQs on  FIQs on  Mode SVC_32 ISA ARM Segment none
      [   25.477524] Process RX-Thread (pid: 317, stack limit = 0x(ptrval))
      [   25.483709] Stack: (0xedf69ed8 to 0xedf6a000)
      [   25.569907] Backtrace:
      [   25.572368] [<80743520>] (skb_release_data) from [<80742ba0>]
      	       (skb_release_all+0x28/0x2c)
      [   25.580555] r9:7f00258c r8:00000001 r7:ee355000 r6:eddab0d0
      	       r5:eddab000 r4:eddbb840
      [   25.588308] [<80742b78>] (skb_release_all) from [<807432cc>]
      	       (consume_skb+0x30/0x50)
      [   25.596055] r5:eddab000 r4:eddbb840
      [   25.599648] [<8074329c>] (consume_skb) from [<7f00117c>]
      	       (rsi_usb_rx_thread+0x64/0x12c [rsi_usb])
      [   25.608524] r5:eddab000 r4:eddbb840
      [   25.612116] [<7f001118>] (rsi_usb_rx_thread [rsi_usb]) from
      	       [<80142750>] (kthread+0x11c/0x15c)
      [   25.620735] r10:ee9ff9e0 r9:edcde3b8 r8:ee355000 r7:edf68000
      	       r6:edd3a780 r5:00000000
      [   25.628567] r4:edcde380
      [   25.631110] [<80142634>] (kthread) from [<801010e8>]
      	       (ret_from_fork+0x14/0x2c)
      [   25.638336] Exception stack(0xedf69fb0 to 0xedf69ff8)
      [   25.682929] ---[ end trace 8236a5496f5b5d3b ]---
      Signed-off-by: NSiva Rebbagondla <siva.rebbagondla@redpinesignals.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      14e0b9bb
    • L
      mt76x2u: run device cleanup routine if resume fails · 3041b096
      Lorenzo Bianconi 提交于
      [ Upstream commit 9b2fd48d36e25b9be9ddb8be8cc1eb263a1d1843 ]
      
      Cleanup {tx,rx} and mcu queues if resume operation fails
      
      Fixes: ee676cd5 ("mt76: add driver code for MT76x2u based devices")
      Signed-off-by: NLorenzo Bianconi <lorenzo.bianconi@redhat.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3041b096
    • A
      brcmfmac: fix for proper support of 160MHz bandwidth · 2234cb98
      Arend van Spriel 提交于
      [ Upstream commit 330994e8e8ec5d0b269a5265e6032b37e29aa336 ]
      
      Decoding of firmware channel information was not complete for 160MHz
      support. This resulted in the following warning:
      
        WARNING: CPU: 2 PID: 2222 at .../broadcom/brcm80211/brcmutil/d11.c:196
      	brcmu_d11ac_decchspec+0x2e/0x100 [brcmutil]
        Modules linked in: brcmfmac(O) brcmutil(O) sha256_generic cfg80211 ...
        CPU: 2 PID: 2222 Comm: kworker/2:0 Tainted: G           O
        4.17.0-wt-testing-x64-00002-gf1bed50 #1
        Hardware name: Dell Inc. Latitude E6410/07XJP9, BIOS A07 02/15/2011
        Workqueue: events request_firmware_work_func
        RIP: 0010:brcmu_d11ac_decchspec+0x2e/0x100 [brcmutil]
        RSP: 0018:ffffc90000047bd0 EFLAGS: 00010206
        RAX: 000000000000e832 RBX: ffff8801146fe910 RCX: ffff8801146fd3c0
        RDX: 0000000000002800 RSI: 0000000000000070 RDI: ffffc90000047c30
        RBP: ffffc90000047bd0 R08: 0000000000000000 R09: ffffffffa0798c80
        R10: ffff88012bca55e0 R11: ffff880110a4ea00 R12: ffff8801146f8000
        R13: ffffc90000047c30 R14: ffff8801146fe930 R15: ffff8801138e02e0
        FS:  0000000000000000(0000) GS:ffff88012bc80000(0000) knlGS:0000000000000000
        CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
        CR2: 00007f18ce8b8070 CR3: 000000000200a003 CR4: 00000000000206e0
        Call Trace:
         brcmf_setup_wiphybands+0x212/0x780 [brcmfmac]
         brcmf_cfg80211_attach+0xae2/0x11a0 [brcmfmac]
         brcmf_attach+0x1fc/0x4b0 [brcmfmac]
         ? __kmalloc+0x13c/0x1c0
         brcmf_pcie_setup+0x99b/0xe00 [brcmfmac]
         brcmf_fw_request_done+0x16a/0x1f0 [brcmfmac]
         request_firmware_work_func+0x36/0x60
         process_one_work+0x146/0x350
         worker_thread+0x4a/0x3b0
         kthread+0x102/0x140
         ? process_one_work+0x350/0x350
         ? kthread_bind+0x20/0x20
         ret_from_fork+0x35/0x40
        Code: 66 90 0f b7 07 55 48 89 e5 89 c2 88 47 02 88 47 03 66 81 e2 00 38
      	66 81 fa 00 18 74 6e 66 81 fa 00 20 74 39 66 81 fa 00 10 74 14 <0f>
      	0b 66 25 00 c0 74 20 66 3d 00 c0 75 20 c6 47 04 01 5d c3 66
        ---[ end trace 550c46682415b26d ]---
        brcmfmac: brcmf_construct_chaninfo: Ignoring unexpected firmware channel 50
      
      This patch adds the missing stuff to properly handle this.
      Reviewed-by: NHante Meuleman <hante.meuleman@broadcom.com>
      Reviewed-by: NPieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
      Reviewed-by: NFranky Lin <franky.lin@broadcom.com>
      Signed-off-by: NArend van Spriel <arend.vanspriel@broadcom.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2234cb98