78488a64 | 17-May-2022 |
Johannes Berg <johannes.berg@intel.com> |
iwlwifi: mei: fix potential NULL-ptr deref
If SKB allocation fails, continue rather than using the NULL pointer.
Coverity CID: 1497650
Cc: stable@vger.kernel.org Fixes: 2da4366f9e2c ("iwlwifi: mei
iwlwifi: mei: fix potential NULL-ptr deref
If SKB allocation fails, continue rather than using the NULL pointer.
Coverity CID: 1497650
Cc: stable@vger.kernel.org Fixes: 2da4366f9e2c ("iwlwifi: mei: add the driver to allow cooperation with CSME") Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20220517120045.90c1b1fd534e.Ibb42463e74d0ec7d36ec81df22e171ae1f6268b0@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
show more ...
|
30de48b4 | 28-Jan-2022 |
Emmanuel Grumbach <emmanuel.grumbach@intel.com> |
iwlwifi: mei: report RFKILL upon register when needed
When we register and we are in link protection passive, meaning that the host can't touch the device, report RFKILL immediately upon register()
iwlwifi: mei: report RFKILL upon register when needed
When we register and we are in link protection passive, meaning that the host can't touch the device, report RFKILL immediately upon register() and don't wait for the CSME firmware to let us know again about the link protection state.
What happens if we wait is that the host will not see RFKILL soon enough and we'll have a window of time during which it can bring up the device which will request ownership.
Fixes: 2da4366f9e2c ("iwlwifi: mei: add the driver to allow cooperation with CSME") Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/iwlwifi.20220128142706.a136f9f46336.Ief7506dc3b1813a1943a5a639aa45d8e5f284f31@changeid
show more ...
|
44bf7c46 | 28-Jan-2022 |
Emmanuel Grumbach <emmanuel.grumbach@intel.com> |
iwlwifi: mei: retry mapping the shared area
The shared area is a DMA memory allocated in the host and mapped so that the host and the CSME firmware can exchange data. It is mapped through a dedicate
iwlwifi: mei: retry mapping the shared area
The shared area is a DMA memory allocated in the host and mapped so that the host and the CSME firmware can exchange data. It is mapped through a dedicated PCI device that is driven by the mei bus driver.
The bus driver is in charge of allocating and mapping this memory. It also needs to configure the CSME firmware with a specific set of commands, so that the CSME firmware will know that this memory is meant to be used by its internal WLAN module.
For this, the CSME firmware first needs to completely initialize its WLAN module and only then get the mapping request.
The problem is that the mei bus enumeration completes before the WLAN is completely ready. This means that the WLAN module's initialization is racing with iwlmei's allocation and mapping flow.
Testing showed a problem in resume flows where iwlmei was too fast and the DMA mapping failed.
Add a retry mechanism to make sure that we will succeed to map the memory.
Fixes: 2da4366f9e2c ("iwlwifi: mei: add the driver to allow cooperation with CSME") Fixes: bcbddc4f9d02 ("iwlwifi: mei: wait before mapping the shared area") Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/iwlwifi.20220128142706.cc51e6a6d635.I4b74a082eb8d89f9e4f556a27c4339c15444dc6c@changeid
show more ...
|
bcbddc4f | 20-Dec-2021 |
Emmanuel Grumbach <emmanuel.grumbach@intel.com> |
iwlwifi: mei: wait before mapping the shared area
The shared area is a DMA memory allocated in the host and mapped so that the host and the CSME firmware can exchange data. It is mapped through a de
iwlwifi: mei: wait before mapping the shared area
The shared area is a DMA memory allocated in the host and mapped so that the host and the CSME firmware can exchange data. It is mapped through a dedicated PCI device that is driven by the mei bus driver.
The bus driver is in charge of allocating and mapping this memory. It also needs to configure the CSME firmware with a specific set of commands, so that the CSME firmware will know that this memory is meant to be used by its internal WLAN module.
For this, the CSME firmware first needs to completely initialize its WLAN module and only then get the mapping request.
The problem is that the mei bus enumeration completes before the WLAN is completely ready. This means that the WLAN module's initialization is racing with iwlmei's allocation and mapping flow.
Testing showed a problem in resume flows where iwlmei was too fast and the DMA mapping failed.
Add a delay to avoid this. This is still racy, but our measurements showed that we have a good margin and we should now be safe.
Fixes: 2da4366f9e2c ("iwlwifi: mei: add the driver to allow cooperation with CSME") Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20211220142940.8b6279e3d0be.I6fe128b0b86149a85535104822c8355b367887c8@changeid Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
show more ...
|
46c7b05a | 30-Nov-2021 |
Emmanuel Grumbach <emmanuel.grumbach@intel.com> |
iwlwifi: mvm: fix a possible NULL pointer deference
Smatch spot a possible NULL pointer dereference. Fix it.
__iwl_mvm_mac_set_key can be called with sta = NULL Also add a NULL pointer check after
iwlwifi: mvm: fix a possible NULL pointer deference
Smatch spot a possible NULL pointer dereference. Fix it.
__iwl_mvm_mac_set_key can be called with sta = NULL Also add a NULL pointer check after memory allocation.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Link: https://lore.kernel.org/r/20211130105951.85539-1-emmanuel.grumbach@intel.com Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
show more ...
|
1a4d5758 | 29-Nov-2021 |
Colin Ian King <colin.i.king@googlemail.com> |
iwlwifi: mei: Fix spelling mistake "req_ownserhip" -> "req_ownership"
There is a spelling mistake in a debugfs filename. Fix it.
Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Link: https:/
iwlwifi: mei: Fix spelling mistake "req_ownserhip" -> "req_ownership"
There is a spelling mistake in a debugfs filename. Fix it.
Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Link: https://lore.kernel.org/r/20211129124921.11817-1-colin.i.king@gmail.com Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
show more ...
|
65229160 | 28-Nov-2021 |
Emmanuel Grumbach <emmanuel.grumbach@intel.com> |
iwlwifi: mei: don't rely on the size from the shared area
If CSME is compromised, it could report a bigger queue size in the share area and make the host perform an out of bound access. Instead of r
iwlwifi: mei: don't rely on the size from the shared area
If CSME is compromised, it could report a bigger queue size in the share area and make the host perform an out of bound access. Instead of reading the size of the queue from the shared area, store it in the regular context which is not accessible by CSME.
While at it, fix a small typo in an error print.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Link: https://lore.kernel.org/r/20211128121509.3952-1-emmanuel.grumbach@intel.com Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
show more ...
|
4ea7da5f | 12-Nov-2021 |
Emmanuel Grumbach <emmanuel.grumbach@intel.com> |
iwlwifi: mei: add debugfs hooks
Add three debugfs hooks: * status: Check if we have a connection with the CSME firwmare. This hook is a read only.
* req_ownership: Send a SAP command to request o
iwlwifi: mei: add debugfs hooks
Add three debugfs hooks: * status: Check if we have a connection with the CSME firwmare. This hook is a read only.
* req_ownership: Send a SAP command to request ownership. This flow should be triggered by iwlwifi (from user space through vendor commands really), but being able to trigger an ownership request from debugfs allows us to request ownership without connecting afterwards. This is an "error" flow that the CSME firmware is designed to handle this way: + Grant ownership since the host asked for it + Wait 3 seconds to let the host connect + If the host didn't connect, take the device back (forcefully). + Don't grant any new ownership request in the following 30 seconds. This debugfs hook allows us to test this flow.
* send_start_message: Restart the communication with the CSME firmware from the very beginning. At the very beginning (upon iwlwifi start), iwlmei send a special message: SAP_ME_MSG_START. This hook allows to send it again and this will retrigger the whole flow. It is important to test this restart in the middle of normal operation since it can happen (in case the CSME firmware decided to reset for example).
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/20211112062814.7502-3-emmanuel.grumbach@intel.com
show more ...
|