Skip to contentSkip to conversation

FAILED: patch "[PATCH] rtlwifi: Fix kernel oops introduced with commit e49656147359" failed to apply to 4.9-stable tree

PATCH [email protected] 3 participants 8 messages Jan 6, 2017 – Jan 10, 2017

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 4.9-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

Quoted 1 line

From 22b68b93ae2506bd56ee3bf232a51bc8ab955b56 Mon Sep 17 00:00:00 2001

From: Larry Finger <[email protected]>
Date: Mon, 19 Dec 2016 20:38:12 -0600
Subject: [PATCH] rtlwifi: Fix kernel oops introduced with commit e49656147359

With commit e49656147359 {"rtlwifi: Use dev_kfree_skb_irq instead of kfree_skb"), the method used to free an skb was changed because the kfree_skb() was inside a spinlock. What was forgotten is that kfree_skb() guards against a NULL value for the argument. Routine dev_kfree_skb_irq() does not, and a test is needed to prevent kernel panics.

Fixes e49656147359 ("rtlwifi: Use dev_kfree_skb_irq instead of kfree_skb")
Cc Stable <[email protected]> # 4.9+
Cc Wei Yongjun <[email protected]>
drivers/net/wireless/realtek/rtlwifi/core.c +2 -1
index 2caa4ad04dba..ded1493fee9c 100644
@@ -1829,7 +1829,8 @@ bool rtl_cmd_send_packet(struct ieee80211_hw *hw, struct sk_buff *skb)
 
 	spin_lock_irqsave(&rtlpriv->locks.irq_th_lock, flags);
 	pskb = __skb_dequeue(&ring->queue);
-	dev_kfree_skb_irq(pskb);
+	if (pskb)
+		dev_kfree_skb_irq(pskb);
 
 	/*this is wrong, fill_tx_cmddesc needs update*/
 	pdesc = &ring->desc[0];
#1 lore raw
Quoted 22 lines · <[email protected]> writes:

The patch below does not apply to the 4.9-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 22b68b93ae2506bd56ee3bf232a51bc8ab955b56 Mon Sep 17 00:00:00 2001
From: Larry Finger <[email protected]>
Date: Mon, 19 Dec 2016 20:38:12 -0600
Subject: [PATCH] rtlwifi: Fix kernel oops introduced with commit e49656147359

With commit e49656147359 {"rtlwifi: Use dev_kfree_skb_irq instead of kfree_skb"), the method used to free an skb was changed because the kfree_skb() was inside a spinlock. What was forgotten is that kfree_skb() guards against a NULL value for the argument. Routine dev_kfree_skb_irq() does not, and a test is needed to prevent kernel panics.

Quoted 5 lines
Fixes e49656147359 ("rtlwifi: Use dev_kfree_skb_irq instead of kfree_skb")
Cc Stable <[email protected]> # 4.9+
Cc Wei Yongjun <[email protected]>

Larry, are you planning to port this to 4.9?

Signature · 1 line
Kalle Valo
#2 lore raw
Quoted 24 lines · Kalle Valo
Quoted 22 lines · <[email protected]> writes:

The patch below does not apply to the 4.9-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 22b68b93ae2506bd56ee3bf232a51bc8ab955b56 Mon Sep 17 00:00:00 2001
From: Larry Finger <[email protected]>
Date: Mon, 19 Dec 2016 20:38:12 -0600
Subject: [PATCH] rtlwifi: Fix kernel oops introduced with commit e49656147359

With commit e49656147359 {"rtlwifi: Use dev_kfree_skb_irq instead of kfree_skb"), the method used to free an skb was changed because the kfree_skb() was inside a spinlock. What was forgotten is that kfree_skb() guards against a NULL value for the argument. Routine dev_kfree_skb_irq() does not, and a test is needed to prevent kernel panics.

Quoted 7 lines
Quoted 5 lines
Fixes e49656147359 ("rtlwifi: Use dev_kfree_skb_irq instead of kfree_skb")
Cc Stable <[email protected]> # 4.9+
Cc Wei Yongjun <[email protected]>

Larry, are you planning to port this to 4.9?

No. Apparently I got confused again and my use of the Cc to stable was incorrect. Commit 49656147359 was not applied until the 4.10 merge. The source of the confusion is related to when the various commits appear in the git log for mainline. The code, however, has the final word. :)

Dropping this patch in Stable is the correct option.

Larry

#3 lore raw
Quoted 31 lines · Larry Finger
Quoted 30 lines · Kalle Valo
Quoted 27 lines · <[email protected]> writes:

The patch below does not apply to the 4.9-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 22b68b93ae2506bd56ee3bf232a51bc8ab955b56 Mon Sep 17 00:00:00 2001
From: Larry Finger <[email protected]>
Date: Mon, 19 Dec 2016 20:38:12 -0600
Subject: [PATCH] rtlwifi: Fix kernel oops introduced with commit e49656147359

With commit e49656147359 {"rtlwifi: Use dev_kfree_skb_irq instead of kfree_skb"), the method used to free an skb was changed because the kfree_skb() was inside a spinlock. What was forgotten is that kfree_skb() guards against a NULL value for the argument. Routine dev_kfree_skb_irq() does not, and a test is needed to prevent kernel panics.

Fixes e49656147359 ("rtlwifi: Use dev_kfree_skb_irq instead of kfree_skb")
Cc Stable <[email protected]> # 4.9+
Cc Wei Yongjun <[email protected]>
Quoted 7 lines
Quoted 1 line

Larry, are you planning to port this to 4.9?

No. Apparently I got confused again and my use of the Cc to stable was incorrect. Commit 49656147359 was not applied until the 4.10 merge. The source of the confusion is related to when the various commits appear in the git log for mainline. The code, however, has the final word. :)

Ah, ok. I'm actually having similar problems and planning to come up with a some sort of web page which would show what was the first Linux release to contain the commit. (git-describe doesn't tell that and AFAIK there is no other git command to show it.) If only I had more free time :)

Signature · 1 line
Kalle Valo
author maintainer
#4 lore raw
Quoted 41 lines · Kalle Valo
Quoted 31 lines · Larry Finger
Quoted 30 lines · Kalle Valo
Quoted 27 lines · <[email protected]> writes:

The patch below does not apply to the 4.9-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 22b68b93ae2506bd56ee3bf232a51bc8ab955b56 Mon Sep 17 00:00:00 2001
From: Larry Finger <[email protected]>
Date: Mon, 19 Dec 2016 20:38:12 -0600
Subject: [PATCH] rtlwifi: Fix kernel oops introduced with commit e49656147359

With commit e49656147359 {"rtlwifi: Use dev_kfree_skb_irq instead of kfree_skb"), the method used to free an skb was changed because the kfree_skb() was inside a spinlock. What was forgotten is that kfree_skb() guards against a NULL value for the argument. Routine dev_kfree_skb_irq() does not, and a test is needed to prevent kernel panics.

Fixes e49656147359 ("rtlwifi: Use dev_kfree_skb_irq instead of kfree_skb")
Cc Stable <[email protected]> # 4.9+
Cc Wei Yongjun <[email protected]>
Quoted 7 lines
Quoted 1 line

Larry, are you planning to port this to 4.9?

No. Apparently I got confused again and my use of the Cc to stable was incorrect. Commit 49656147359 was not applied until the 4.10 merge. The source of the confusion is related to when the various commits appear in the git log for mainline. The code, however, has the final word. :)

Quoted 4 lines

Ah, ok. I'm actually having similar problems and planning to come up with a some sort of web page which would show what was the first Linux release to contain the commit. (git-describe doesn't tell that and AFAIK there is no other git command to show it.) If only I had more free time :)

git describe --contains

#5 lore raw
Quoted 8 lines · Greg KH
Quoted 8 lines
Quoted 7 lines
Quoted 1 line

Larry, are you planning to port this to 4.9?

No. Apparently I got confused again and my use of the Cc to stable was incorrect. Commit 49656147359 was not applied until the 4.10 merge. The source of the confusion is related to when the various commits appear in the git log for mainline. The code, however, has the final word. :)

Quoted 6 lines
Quoted 4 lines

Ah, ok. I'm actually having similar problems and planning to come up with a some sort of web page which would show what was the first Linux release to contain the commit. (git-describe doesn't tell that and AFAIK there is no other git command to show it.) If only I had more free time :)

git describe --contains

Wow, just what I needed. Thanks!

$ git describe --contains --match=v* 22b68b93ae25
v4.10-rc1~16^2~8^2
Signature · 1 line
Kalle Valo
#6 lore raw
In reply to Greg KH
Quoted 8 lines · Greg KH
Quoted 5 lines · Kalle Valo

Ah, ok. I'm actually having similar problems and planning to come up with a some sort of web page which would show what was the first Linux release to contain the commit. (git-describe doesn't tell that and AFAIK there is no other git command to show it.) If only I had more free time :)

git describe --contains

Greg,

Thanks for that info. Now, all we have to do is remember to run the command on mainline rather than our development branches.

Larry

#7 lore raw
Quoted 8 lines · Larry Finger
Quoted 7 lines · Greg KH
Quoted 5 lines · Kalle Valo

Ah, ok. I'm actually having similar problems and planning to come up with a some sort of web page which would show what was the first Linux release to contain the commit. (git-describe doesn't tell that and AFAIK there is no other git command to show it.) If only I had more free time :)

Quoted 6 lines
Quoted 1 line

git describe --contains

Greg,

Thanks for that info. Now, all we have to do is remember to run the command on mainline rather than our development branches.

I'm still planning to implement some sort of user friendly service for this, thanks to Greg the implementation just got a lot easier. I'm thinking of at least showing the first release it was included in (like in this case v4.10-rc1) but also the trees where the patch is currently. This way you and me don't need to remember anything, except the url where to find it :)

Signature · 1 line
Kalle Valo