netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Fixes for system freezes for r8188eu
@ 2019-01-03  2:12 Larry Finger
  2019-01-03  2:12 ` [PATCH 1/2] staging: rtl8188eu: Fix module loading from tasklet for CCMP encryption Larry Finger
  2019-01-03  2:12 ` [PATCH 2/2] staging: rtl8188eu: Fix module loading from tasklet for WEP encryption Larry Finger
  0 siblings, 2 replies; 3+ messages in thread
From: Larry Finger @ 2019-01-03  2:12 UTC (permalink / raw)
  To: gregkh; +Cc: netdev, devel, Larry Finger, Michael Straube, Ivan Safonov

The driver issues "scheduling while atomic" messages and will freeze the
system. These problems are due to attempting to dynamically load library
encryption routines from a tasklet. The fixes are relatively simple. All
that is needed is to replace indirect calls of the try_then_request_module()
macro with a direct call to lib80211_get_crypto_ops(), which forces a load
of the lib80211 module when the wifi driver is loaded.

There will be a similar patch for TKIP encryption; however, the faulty
patch has already been reverted, thus a fix to use the lib80211 routine
directly will be more intrusive. My original attempt failed, thus I am
delaying that fix.

Cc: Michael Straube <straube.linux@gmail.com>
Cc: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
Larry Finger (2):
  staging: rtl8188eu: Fix module loading from tasklet for CCMP
    encryption
  staging: rtl8188eu: Fix module loading from tasklet for WEP encryption

 drivers/staging/rtl8188eu/core/rtw_security.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

-- 
2.16.4

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

* [PATCH 1/2] staging: rtl8188eu: Fix module loading from tasklet for CCMP encryption
  2019-01-03  2:12 [PATCH 0/2] Fixes for system freezes for r8188eu Larry Finger
@ 2019-01-03  2:12 ` Larry Finger
  2019-01-03  2:12 ` [PATCH 2/2] staging: rtl8188eu: Fix module loading from tasklet for WEP encryption Larry Finger
  1 sibling, 0 replies; 3+ messages in thread
From: Larry Finger @ 2019-01-03  2:12 UTC (permalink / raw)
  To: gregkh; +Cc: netdev, devel, Larry Finger, Stable, Ivan Safonov

Commit 6bd082af7e36 ("staging:r8188eu: use lib80211 CCMP decrypt")
causes scheduling while atomic bugs followed by a hard freeze whenever
the driver tries to connect to a CCMP-encrypted network. Experimentation
showed that the freezes were eliminated when module lib80211 was
preloaded, which can be forced by calling lib80211_get_crypto_ops()
directly rather than indirectly through try_then_request_module().
With this change, no BUG messages are logged.

Fixes: 6bd082af7e36 ("staging:r8188eu: use lib80211 CCMP decrypt")
Cc: Stable <stable@vger.kernel.org> # v4.17+
Reported-and-tested-by: Michael Straube <straube.linux@gmail.com>
Cc: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
 drivers/staging/rtl8188eu/core/rtw_security.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_security.c b/drivers/staging/rtl8188eu/core/rtw_security.c
index f7407632e80b..052656a22821 100644
--- a/drivers/staging/rtl8188eu/core/rtw_security.c
+++ b/drivers/staging/rtl8188eu/core/rtw_security.c
@@ -1291,7 +1291,7 @@ u32 rtw_aes_decrypt(struct adapter *padapter, u8 *precvframe)
 			struct sk_buff *skb = ((struct recv_frame *)precvframe)->pkt;
 			void *crypto_private = NULL;
 			u8 *key, *pframe = skb->data;
-			struct lib80211_crypto_ops *crypto_ops = try_then_request_module(lib80211_get_crypto_ops("CCMP"), "lib80211_crypt_ccmp");
+			struct lib80211_crypto_ops *crypto_ops = lib80211_get_crypto_ops("CCMP");
 			struct security_priv *psecuritypriv = &padapter->securitypriv;
 			char iv[8], icv[8];
 
-- 
2.16.4

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

* [PATCH 2/2] staging: rtl8188eu: Fix module loading from tasklet for WEP encryption
  2019-01-03  2:12 [PATCH 0/2] Fixes for system freezes for r8188eu Larry Finger
  2019-01-03  2:12 ` [PATCH 1/2] staging: rtl8188eu: Fix module loading from tasklet for CCMP encryption Larry Finger
@ 2019-01-03  2:12 ` Larry Finger
  1 sibling, 0 replies; 3+ messages in thread
From: Larry Finger @ 2019-01-03  2:12 UTC (permalink / raw)
  To: gregkh; +Cc: netdev, devel, Larry Finger, Stable, Michael Straube, Ivan Safonov

Commit 2b2ea09e74a5 ("staging:r8188eu: Use lib80211 to decrypt WEP-frames")
causes scheduling while atomic bugs followed by a hard freeze whenever
the driver tries to connect to a WEP-encrypted network. Experimentation
showed that the freezes were eliminated when module lib80211 was
preloaded, which can be forced by calling lib80211_get_crypto_ops()
directly rather than indirectly through try_then_request_module().
With this change, no BUG messages are logged.

Fixes: 2b2ea09e74a5 ("staging:r8188eu: Use lib80211 to decrypt WEP-frames")
Cc: Stable <stable@vger.kernel.org> # v4.17+
Cc: Michael Straube <straube.linux@gmail.com>
Cc: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
 drivers/staging/rtl8188eu/core/rtw_security.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_security.c b/drivers/staging/rtl8188eu/core/rtw_security.c
index 052656a22821..bab96c870042 100644
--- a/drivers/staging/rtl8188eu/core/rtw_security.c
+++ b/drivers/staging/rtl8188eu/core/rtw_security.c
@@ -154,7 +154,7 @@ void rtw_wep_encrypt(struct adapter *padapter, u8 *pxmitframe)
 
 	pframe = ((struct xmit_frame *)pxmitframe)->buf_addr + hw_hdr_offset;
 
-	crypto_ops = try_then_request_module(lib80211_get_crypto_ops("WEP"), "lib80211_crypt_wep");
+	crypto_ops = lib80211_get_crypto_ops("WEP");
 
 	if (!crypto_ops)
 		return;
@@ -210,7 +210,7 @@ int rtw_wep_decrypt(struct adapter  *padapter, u8 *precvframe)
 		void *crypto_private = NULL;
 		int status = _SUCCESS;
 		const int keyindex = prxattrib->key_index;
-		struct lib80211_crypto_ops *crypto_ops = try_then_request_module(lib80211_get_crypto_ops("WEP"), "lib80211_crypt_wep");
+		struct lib80211_crypto_ops *crypto_ops = lib80211_get_crypto_ops("WEP");
 		char iv[4], icv[4];
 
 		if (!crypto_ops) {
-- 
2.16.4

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

end of thread, other threads:[~2019-01-03  2:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-03  2:12 [PATCH 0/2] Fixes for system freezes for r8188eu Larry Finger
2019-01-03  2:12 ` [PATCH 1/2] staging: rtl8188eu: Fix module loading from tasklet for CCMP encryption Larry Finger
2019-01-03  2:12 ` [PATCH 2/2] staging: rtl8188eu: Fix module loading from tasklet for WEP encryption Larry Finger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).