All of lore.kernel.org
 help / color / mirror / Atom feed
* pull request: iwlwifi 2015-12-16
@ 2015-12-16  8:15 Grumbach, Emmanuel
  2015-12-16 14:20 ` Kalle Valo
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Grumbach, Emmanuel @ 2015-12-16  8:15 UTC (permalink / raw)
  To: Kalle Valo <kvalo@adurom.com> Kalle Valo; +Cc: linux-wireless

Hi Kalle,

This is a pull request with small fixes for 4.4.
Note that due to the large number of files being renamed, you need to
set merge.renameLimit to a big number to merge wl-drv into wl-drv-next
but you probably noticed that already :)

The following changes since commit 9513c5e18a0dc55a1fc9c890715098ba2315830b:

  iwlwifi: mvm: Avoid dereferencing sta if it was already flushed
(2015-11-15 21:18:01 +0200)

are available in the git repository at:

 
https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-fixes.git tags/iwlwifi-for-kalle-2015-12-16

for you to fetch changes up to 4585436091cd812b1165aab71bd4847ea1cb08ec:

  iwlwifi: mvm: protect RCU dereference in iwl_mvm_get_key_sta_id
(2015-12-13 13:38:26 +0200)

----------------------------------------------------------------
* don't load firmware that won't exist for 7260
* fix RCU splat

----------------------------------------------------------------
Johannes Berg (2):
      iwlwifi: separate firmware version for 7260 devices
      iwlwifi: mvm: protect RCU dereference in iwl_mvm_get_key_sta_id

 drivers/net/wireless/iwlwifi/iwl-7000.c | 49
+++++++++++++++++++++++++++++++++++--------------
 drivers/net/wireless/iwlwifi/mvm/sta.c  | 15 +++++++++------
 2 files changed, 44 insertions(+), 20 deletions(-)


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: pull request: iwlwifi 2015-12-16
  2015-12-16  8:15 pull request: iwlwifi 2015-12-16 Grumbach, Emmanuel
@ 2015-12-16 14:20 ` Kalle Valo
  2015-12-16 14:23   ` Grumbach, Emmanuel
  2015-12-16 14:23 ` [PATCH 1/2] iwlwifi: separate firmware version for 7260 devices Emmanuel Grumbach
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 6+ messages in thread
From: Kalle Valo @ 2015-12-16 14:20 UTC (permalink / raw)
  To: Grumbach, Emmanuel; +Cc: linux-wireless

"Grumbach, Emmanuel" <emmanuel.grumbach@intel.com> writes:

> This is a pull request with small fixes for 4.4. Note that due to the
> large number of files being renamed, you need to set merge.renameLimit
> to a big number to merge wl-drv into wl-drv-next but you probably
> noticed that already :)

Actually I don't normally merge wireless-drivers to
wireless-drivers-next, that happens "automatically" the way I follow
net-next. But I'll keep this in mind, thanks.

>       iwlwifi: separate firmware version for 7260 devices

Was this patch sent for public review? I can't seem to find it.

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: pull request: iwlwifi 2015-12-16
  2015-12-16 14:20 ` Kalle Valo
@ 2015-12-16 14:23   ` Grumbach, Emmanuel
  0 siblings, 0 replies; 6+ messages in thread
From: Grumbach, Emmanuel @ 2015-12-16 14:23 UTC (permalink / raw)
  To: Kalle Valo; +Cc: linux-wireless

> 
> "Grumbach, Emmanuel" <emmanuel.grumbach@intel.com> writes:
> 
> > This is a pull request with small fixes for 4.4. Note that due to the
> > large number of files being renamed, you need to set merge.renameLimit
> > to a big number to merge wl-drv into wl-drv-next but you probably
> > noticed that already :)
> 
> Actually I don't normally merge wireless-drivers to wireless-drivers-next, that
> happens "automatically" the way I follow net-next. But I'll keep this in mind,
> thanks.
> 
> >       iwlwifi: separate firmware version for 7260 devices
> 
> Was this patch sent for public review? I can't seem to find it.
> 

Just did.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/2] iwlwifi: separate firmware version for 7260 devices
  2015-12-16  8:15 pull request: iwlwifi 2015-12-16 Grumbach, Emmanuel
  2015-12-16 14:20 ` Kalle Valo
@ 2015-12-16 14:23 ` Emmanuel Grumbach
  2015-12-16 14:23 ` [PATCH 2/2] iwlwifi: mvm: protect RCU dereference in iwl_mvm_get_key_sta_id Emmanuel Grumbach
  2015-12-18 13:04 ` pull request: iwlwifi 2015-12-16 Kalle Valo
  3 siblings, 0 replies; 6+ messages in thread
From: Emmanuel Grumbach @ 2015-12-16 14:23 UTC (permalink / raw)
  To: linux-wireless; +Cc: Johannes Berg, Emmanuel Grumbach

From: Johannes Berg <johannes.berg@intel.com>

The 7260 devices aren't going to be updated for completely new
firmware versions any more (only bugfixes), and haven't been
since API version 17. Encode that in the data structures to
avoid trying to load FW images that will never exist.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-7000.c | 49 +++++++++++++++++++++++----------
 1 file changed, 35 insertions(+), 14 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-7000.c b/drivers/net/wireless/iwlwifi/iwl-7000.c
index bf88ec3..d9a4aee 100644
--- a/drivers/net/wireless/iwlwifi/iwl-7000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-7000.c
@@ -69,13 +69,19 @@
 #include "iwl-agn-hw.h"
 
 /* Highest firmware API version supported */
-#define IWL7260_UCODE_API_MAX	19
+#define IWL7260_UCODE_API_MAX	17
+#define IWL7265_UCODE_API_MAX	19
+#define IWL7265D_UCODE_API_MAX	19
 
 /* Oldest version we won't warn about */
 #define IWL7260_UCODE_API_OK	13
+#define IWL7265_UCODE_API_OK	13
+#define IWL7265D_UCODE_API_OK	13
 
 /* Lowest firmware API version supported */
 #define IWL7260_UCODE_API_MIN	13
+#define IWL7265_UCODE_API_MIN	13
+#define IWL7265D_UCODE_API_MIN	13
 
 /* NVM versions */
 #define IWL7260_NVM_VERSION		0x0a1d
@@ -149,10 +155,7 @@ static const struct iwl_ht_params iwl7000_ht_params = {
 	.ht40_bands = BIT(IEEE80211_BAND_2GHZ) | BIT(IEEE80211_BAND_5GHZ),
 };
 
-#define IWL_DEVICE_7000						\
-	.ucode_api_max = IWL7260_UCODE_API_MAX,			\
-	.ucode_api_ok = IWL7260_UCODE_API_OK,			\
-	.ucode_api_min = IWL7260_UCODE_API_MIN,			\
+#define IWL_DEVICE_7000_COMMON					\
 	.device_family = IWL_DEVICE_FAMILY_7000,		\
 	.max_inst_size = IWL60_RTC_INST_SIZE,			\
 	.max_data_size = IWL60_RTC_DATA_SIZE,			\
@@ -163,6 +166,24 @@ static const struct iwl_ht_params iwl7000_ht_params = {
 	.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,	\
 	.dccm_offset = IWL7000_DCCM_OFFSET
 
+#define IWL_DEVICE_7000						\
+	IWL_DEVICE_7000_COMMON,					\
+	.ucode_api_max = IWL7260_UCODE_API_MAX,			\
+	.ucode_api_ok = IWL7260_UCODE_API_OK,			\
+	.ucode_api_min = IWL7260_UCODE_API_MIN
+
+#define IWL_DEVICE_7005						\
+	IWL_DEVICE_7000_COMMON,					\
+	.ucode_api_max = IWL7265_UCODE_API_MAX,			\
+	.ucode_api_ok = IWL7265_UCODE_API_OK,			\
+	.ucode_api_min = IWL7265_UCODE_API_MIN
+
+#define IWL_DEVICE_7005D					\
+	IWL_DEVICE_7000_COMMON,					\
+	.ucode_api_max = IWL7265D_UCODE_API_MAX,		\
+	.ucode_api_ok = IWL7265D_UCODE_API_OK,			\
+	.ucode_api_min = IWL7265D_UCODE_API_MIN
+
 const struct iwl_cfg iwl7260_2ac_cfg = {
 	.name = "Intel(R) Dual Band Wireless AC 7260",
 	.fw_name_pre = IWL7260_FW_PRE,
@@ -266,7 +287,7 @@ static const struct iwl_ht_params iwl7265_ht_params = {
 const struct iwl_cfg iwl3165_2ac_cfg = {
 	.name = "Intel(R) Dual Band Wireless AC 3165",
 	.fw_name_pre = IWL7265D_FW_PRE,
-	IWL_DEVICE_7000,
+	IWL_DEVICE_7005D,
 	.ht_params = &iwl7000_ht_params,
 	.nvm_ver = IWL3165_NVM_VERSION,
 	.nvm_calib_ver = IWL3165_TX_POWER_VERSION,
@@ -277,7 +298,7 @@ const struct iwl_cfg iwl3165_2ac_cfg = {
 const struct iwl_cfg iwl7265_2ac_cfg = {
 	.name = "Intel(R) Dual Band Wireless AC 7265",
 	.fw_name_pre = IWL7265_FW_PRE,
-	IWL_DEVICE_7000,
+	IWL_DEVICE_7005,
 	.ht_params = &iwl7265_ht_params,
 	.nvm_ver = IWL7265_NVM_VERSION,
 	.nvm_calib_ver = IWL7265_TX_POWER_VERSION,
@@ -288,7 +309,7 @@ const struct iwl_cfg iwl7265_2ac_cfg = {
 const struct iwl_cfg iwl7265_2n_cfg = {
 	.name = "Intel(R) Dual Band Wireless N 7265",
 	.fw_name_pre = IWL7265_FW_PRE,
-	IWL_DEVICE_7000,
+	IWL_DEVICE_7005,
 	.ht_params = &iwl7265_ht_params,
 	.nvm_ver = IWL7265_NVM_VERSION,
 	.nvm_calib_ver = IWL7265_TX_POWER_VERSION,
@@ -299,7 +320,7 @@ const struct iwl_cfg iwl7265_2n_cfg = {
 const struct iwl_cfg iwl7265_n_cfg = {
 	.name = "Intel(R) Wireless N 7265",
 	.fw_name_pre = IWL7265_FW_PRE,
-	IWL_DEVICE_7000,
+	IWL_DEVICE_7005,
 	.ht_params = &iwl7265_ht_params,
 	.nvm_ver = IWL7265_NVM_VERSION,
 	.nvm_calib_ver = IWL7265_TX_POWER_VERSION,
@@ -310,7 +331,7 @@ const struct iwl_cfg iwl7265_n_cfg = {
 const struct iwl_cfg iwl7265d_2ac_cfg = {
 	.name = "Intel(R) Dual Band Wireless AC 7265",
 	.fw_name_pre = IWL7265D_FW_PRE,
-	IWL_DEVICE_7000,
+	IWL_DEVICE_7005D,
 	.ht_params = &iwl7265_ht_params,
 	.nvm_ver = IWL7265D_NVM_VERSION,
 	.nvm_calib_ver = IWL7265_TX_POWER_VERSION,
@@ -321,7 +342,7 @@ const struct iwl_cfg iwl7265d_2ac_cfg = {
 const struct iwl_cfg iwl7265d_2n_cfg = {
 	.name = "Intel(R) Dual Band Wireless N 7265",
 	.fw_name_pre = IWL7265D_FW_PRE,
-	IWL_DEVICE_7000,
+	IWL_DEVICE_7005D,
 	.ht_params = &iwl7265_ht_params,
 	.nvm_ver = IWL7265D_NVM_VERSION,
 	.nvm_calib_ver = IWL7265_TX_POWER_VERSION,
@@ -332,7 +353,7 @@ const struct iwl_cfg iwl7265d_2n_cfg = {
 const struct iwl_cfg iwl7265d_n_cfg = {
 	.name = "Intel(R) Wireless N 7265",
 	.fw_name_pre = IWL7265D_FW_PRE,
-	IWL_DEVICE_7000,
+	IWL_DEVICE_7005D,
 	.ht_params = &iwl7265_ht_params,
 	.nvm_ver = IWL7265D_NVM_VERSION,
 	.nvm_calib_ver = IWL7265_TX_POWER_VERSION,
@@ -342,5 +363,5 @@ const struct iwl_cfg iwl7265d_n_cfg = {
 
 MODULE_FIRMWARE(IWL7260_MODULE_FIRMWARE(IWL7260_UCODE_API_OK));
 MODULE_FIRMWARE(IWL3160_MODULE_FIRMWARE(IWL7260_UCODE_API_OK));
-MODULE_FIRMWARE(IWL7265_MODULE_FIRMWARE(IWL7260_UCODE_API_OK));
-MODULE_FIRMWARE(IWL7265D_MODULE_FIRMWARE(IWL7260_UCODE_API_OK));
+MODULE_FIRMWARE(IWL7265_MODULE_FIRMWARE(IWL7265_UCODE_API_OK));
+MODULE_FIRMWARE(IWL7265D_MODULE_FIRMWARE(IWL7265D_UCODE_API_OK));
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] iwlwifi: mvm: protect RCU dereference in iwl_mvm_get_key_sta_id
  2015-12-16  8:15 pull request: iwlwifi 2015-12-16 Grumbach, Emmanuel
  2015-12-16 14:20 ` Kalle Valo
  2015-12-16 14:23 ` [PATCH 1/2] iwlwifi: separate firmware version for 7260 devices Emmanuel Grumbach
@ 2015-12-16 14:23 ` Emmanuel Grumbach
  2015-12-18 13:04 ` pull request: iwlwifi 2015-12-16 Kalle Valo
  3 siblings, 0 replies; 6+ messages in thread
From: Emmanuel Grumbach @ 2015-12-16 14:23 UTC (permalink / raw)
  To: linux-wireless; +Cc: Johannes Berg, Emmanuel Grumbach

From: Johannes Berg <johannes.berg@intel.com>

Properly protect the RCU dereference in iwl_mvm_get_key_sta_id() when
coming from iwl_mvm_update_tkip_key() which cannot hold the mvm->mutex
by moving the call into the RCU critical section.
Modify the check to use rcu_dereference_check() to permit this.

Fixes: 9513c5e18a0d ("iwlwifi: mvm: Avoid dereferencing sta if it was already flushed")
Reported-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
 drivers/net/wireless/iwlwifi/mvm/sta.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/mvm/sta.c b/drivers/net/wireless/iwlwifi/mvm/sta.c
index 354acbd..2b976b1 100644
--- a/drivers/net/wireless/iwlwifi/mvm/sta.c
+++ b/drivers/net/wireless/iwlwifi/mvm/sta.c
@@ -1222,8 +1222,8 @@ static u8 iwl_mvm_get_key_sta_id(struct iwl_mvm *mvm,
 	    mvmvif->ap_sta_id != IWL_MVM_STATION_COUNT) {
 		u8 sta_id = mvmvif->ap_sta_id;
 
-		sta = rcu_dereference_protected(mvm->fw_id_to_mac_id[sta_id],
-						lockdep_is_held(&mvm->mutex));
+		sta = rcu_dereference_check(mvm->fw_id_to_mac_id[sta_id],
+					    lockdep_is_held(&mvm->mutex));
 		/*
 		 * It is possible that the 'sta' parameter is NULL,
 		 * for example when a GTK is removed - the sta_id will then
@@ -1590,14 +1590,15 @@ void iwl_mvm_update_tkip_key(struct iwl_mvm *mvm,
 			     u16 *phase1key)
 {
 	struct iwl_mvm_sta *mvm_sta;
-	u8 sta_id = iwl_mvm_get_key_sta_id(mvm, vif, sta);
+	u8 sta_id;
 	bool mcast = !(keyconf->flags & IEEE80211_KEY_FLAG_PAIRWISE);
 
-	if (WARN_ON_ONCE(sta_id == IWL_MVM_STATION_COUNT))
-		return;
-
 	rcu_read_lock();
 
+	sta_id = iwl_mvm_get_key_sta_id(mvm, vif, sta);
+	if (WARN_ON_ONCE(sta_id == IWL_MVM_STATION_COUNT))
+		goto unlock;
+
 	if (!sta) {
 		sta = rcu_dereference(mvm->fw_id_to_mac_id[sta_id]);
 		if (WARN_ON(IS_ERR_OR_NULL(sta))) {
@@ -1609,6 +1610,8 @@ void iwl_mvm_update_tkip_key(struct iwl_mvm *mvm,
 	mvm_sta = iwl_mvm_sta_from_mac80211(sta);
 	iwl_mvm_send_sta_key(mvm, mvm_sta, keyconf, mcast,
 			     iv32, phase1key, CMD_ASYNC, keyconf->hw_key_idx);
+
+ unlock:
 	rcu_read_unlock();
 }
 
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: pull request: iwlwifi 2015-12-16
  2015-12-16  8:15 pull request: iwlwifi 2015-12-16 Grumbach, Emmanuel
                   ` (2 preceding siblings ...)
  2015-12-16 14:23 ` [PATCH 2/2] iwlwifi: mvm: protect RCU dereference in iwl_mvm_get_key_sta_id Emmanuel Grumbach
@ 2015-12-18 13:04 ` Kalle Valo
  3 siblings, 0 replies; 6+ messages in thread
From: Kalle Valo @ 2015-12-18 13:04 UTC (permalink / raw)
  To: Grumbach, Emmanuel; +Cc: linux-wireless

"Grumbach, Emmanuel" <emmanuel.grumbach@intel.com> writes:

> This is a pull request with small fixes for 4.4.
> Note that due to the large number of files being renamed, you need to
> set merge.renameLimit to a big number to merge wl-drv into wl-drv-next
> but you probably noticed that already :)
>
> The following changes since commit 9513c5e18a0dc55a1fc9c890715098ba2315830b:
>
>   iwlwifi: mvm: Avoid dereferencing sta if it was already flushed
> (2015-11-15 21:18:01 +0200)
>
> are available in the git repository at:
>
>  
> https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-fixes.git tags/iwlwifi-for-kalle-2015-12-16

Pulled, thanks.

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-12-18 13:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-16  8:15 pull request: iwlwifi 2015-12-16 Grumbach, Emmanuel
2015-12-16 14:20 ` Kalle Valo
2015-12-16 14:23   ` Grumbach, Emmanuel
2015-12-16 14:23 ` [PATCH 1/2] iwlwifi: separate firmware version for 7260 devices Emmanuel Grumbach
2015-12-16 14:23 ` [PATCH 2/2] iwlwifi: mvm: protect RCU dereference in iwl_mvm_get_key_sta_id Emmanuel Grumbach
2015-12-18 13:04 ` pull request: iwlwifi 2015-12-16 Kalle Valo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.