All of lore.kernel.org
 help / color / mirror / Atom feed
* FAILED: patch "[PATCH] rtlwifi: Fix kernel oops introduced with commit e49656147359" failed to apply to 4.9-stable tree
@ 2017-01-06 12:20 gregkh
  2017-01-09 14:40 ` Kalle Valo
  0 siblings, 1 reply; 8+ messages in thread
From: gregkh @ 2017-01-06 12:20 UTC (permalink / raw)
  To: Larry.Finger, kvalo, stable, weiyongjun1; +Cc: stable


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 <stable@vger.kernel.org>.

thanks,

greg k-h

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

>From 22b68b93ae2506bd56ee3bf232a51bc8ab955b56 Mon Sep 17 00:00:00 2001
From: Larry Finger <Larry.Finger@lwfinger.net>
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")
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org> # 4.9+
Cc: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

diff --git a/drivers/net/wireless/realtek/rtlwifi/core.c b/drivers/net/wireless/realtek/rtlwifi/core.c
index 2caa4ad04dba..ded1493fee9c 100644
--- a/drivers/net/wireless/realtek/rtlwifi/core.c
+++ b/drivers/net/wireless/realtek/rtlwifi/core.c
@@ -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];


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

* Re: FAILED: patch "[PATCH] rtlwifi: Fix kernel oops introduced with commit e49656147359" failed to apply to 4.9-stable tree
  2017-01-06 12:20 FAILED: patch "[PATCH] rtlwifi: Fix kernel oops introduced with commit e49656147359" failed to apply to 4.9-stable tree gregkh
@ 2017-01-09 14:40 ` Kalle Valo
  2017-01-09 17:19   ` Larry Finger
  0 siblings, 1 reply; 8+ messages in thread
From: Kalle Valo @ 2017-01-09 14:40 UTC (permalink / raw)
  To: Larry.Finger; +Cc: gregkh, stable, weiyongjun1

<gregkh@linuxfoundation.org> 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 <stable@vger.kernel.org>.
>
> thanks,
>
> greg k-h
>
> ------------------ original commit in Linus's tree ------------------
>
> From 22b68b93ae2506bd56ee3bf232a51bc8ab955b56 Mon Sep 17 00:00:00 2001
> From: Larry Finger <Larry.Finger@lwfinger.net>
> 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")
> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
> Cc: Stable <stable@vger.kernel.org> # 4.9+
> Cc: Wei Yongjun <weiyongjun1@huawei.com>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

Larry, are you planning to port this to 4.9?

-- 
Kalle Valo

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

* Re: FAILED: patch "[PATCH] rtlwifi: Fix kernel oops introduced with commit e49656147359" failed to apply to 4.9-stable tree
  2017-01-09 14:40 ` Kalle Valo
@ 2017-01-09 17:19   ` Larry Finger
  2017-01-09 18:30     ` Kalle Valo
  0 siblings, 1 reply; 8+ messages in thread
From: Larry Finger @ 2017-01-09 17:19 UTC (permalink / raw)
  To: Kalle Valo; +Cc: gregkh, stable, weiyongjun1

On 01/09/2017 08:40 AM, Kalle Valo wrote:
> <gregkh@linuxfoundation.org> 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 <stable@vger.kernel.org>.
>>
>> thanks,
>>
>> greg k-h
>>
>> ------------------ original commit in Linus's tree ------------------
>>
>> From 22b68b93ae2506bd56ee3bf232a51bc8ab955b56 Mon Sep 17 00:00:00 2001
>> From: Larry Finger <Larry.Finger@lwfinger.net>
>> 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")
>> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
>> Cc: Stable <stable@vger.kernel.org> # 4.9+
>> Cc: Wei Yongjun <weiyongjun1@huawei.com>
>> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
>
> 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



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

* Re: FAILED: patch "[PATCH] rtlwifi: Fix kernel oops introduced with commit e49656147359" failed to apply to 4.9-stable tree
  2017-01-09 17:19   ` Larry Finger
@ 2017-01-09 18:30     ` Kalle Valo
  2017-01-09 20:04       ` Greg KH
  0 siblings, 1 reply; 8+ messages in thread
From: Kalle Valo @ 2017-01-09 18:30 UTC (permalink / raw)
  To: Larry Finger; +Cc: gregkh, stable, weiyongjun1

Larry Finger <Larry.Finger@lwfinger.net> writes:

> On 01/09/2017 08:40 AM, Kalle Valo wrote:
>> <gregkh@linuxfoundation.org> 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 <stable@vger.kernel.org>.
>>>
>>> thanks,
>>>
>>> greg k-h
>>>
>>> ------------------ original commit in Linus's tree ------------------
>>>
>>> From 22b68b93ae2506bd56ee3bf232a51bc8ab955b56 Mon Sep 17 00:00:00 2001
>>> From: Larry Finger <Larry.Finger@lwfinger.net>
>>> 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")
>>> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
>>> Cc: Stable <stable@vger.kernel.org> # 4.9+
>>> Cc: Wei Yongjun <weiyongjun1@huawei.com>
>>> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
>>
>> 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 :)

-- 
Kalle Valo

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

* Re: FAILED: patch "[PATCH] rtlwifi: Fix kernel oops introduced with commit e49656147359" failed to apply to 4.9-stable tree
  2017-01-09 18:30     ` Kalle Valo
@ 2017-01-09 20:04       ` Greg KH
  2017-01-09 20:39         ` Kalle Valo
  2017-01-09 22:40         ` Larry Finger
  0 siblings, 2 replies; 8+ messages in thread
From: Greg KH @ 2017-01-09 20:04 UTC (permalink / raw)
  To: Kalle Valo; +Cc: Larry Finger, stable, weiyongjun1

On Mon, Jan 09, 2017 at 08:30:42PM +0200, Kalle Valo wrote:
> Larry Finger <Larry.Finger@lwfinger.net> writes:
> 
> > On 01/09/2017 08:40 AM, Kalle Valo wrote:
> >> <gregkh@linuxfoundation.org> 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 <stable@vger.kernel.org>.
> >>>
> >>> thanks,
> >>>
> >>> greg k-h
> >>>
> >>> ------------------ original commit in Linus's tree ------------------
> >>>
> >>> From 22b68b93ae2506bd56ee3bf232a51bc8ab955b56 Mon Sep 17 00:00:00 2001
> >>> From: Larry Finger <Larry.Finger@lwfinger.net>
> >>> 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")
> >>> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
> >>> Cc: Stable <stable@vger.kernel.org> # 4.9+
> >>> Cc: Wei Yongjun <weiyongjun1@huawei.com>
> >>> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
> >>
> >> 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 :)

git describe --contains


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

* Re: FAILED: patch "[PATCH] rtlwifi: Fix kernel oops introduced with commit e49656147359" failed to apply to 4.9-stable tree
  2017-01-09 20:04       ` Greg KH
@ 2017-01-09 20:39         ` Kalle Valo
  2017-01-09 22:40         ` Larry Finger
  1 sibling, 0 replies; 8+ messages in thread
From: Kalle Valo @ 2017-01-09 20:39 UTC (permalink / raw)
  To: Greg KH; +Cc: Larry Finger, stable, weiyongjun1

Greg KH <gregkh@linuxfoundation.org> writes:

>> >> 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 :)
>
> git describe --contains

Wow, just what I needed. Thanks!

$ git describe --contains --match=v* 22b68b93ae25
v4.10-rc1~16^2~8^2

-- 
Kalle Valo

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

* Re: FAILED: patch "[PATCH] rtlwifi: Fix kernel oops introduced with commit e49656147359" failed to apply to 4.9-stable tree
  2017-01-09 20:04       ` Greg KH
  2017-01-09 20:39         ` Kalle Valo
@ 2017-01-09 22:40         ` Larry Finger
  2017-01-10  5:35           ` Kalle Valo
  1 sibling, 1 reply; 8+ messages in thread
From: Larry Finger @ 2017-01-09 22:40 UTC (permalink / raw)
  To: Greg KH, Kalle Valo; +Cc: stable, weiyongjun1

On 01/09/2017 02:04 PM, Greg KH wrote:
> On Mon, Jan 09, 2017 at 08:30:42PM +0200, Kalle Valo wrote:
>>
>> 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



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

* Re: FAILED: patch "[PATCH] rtlwifi: Fix kernel oops introduced with commit e49656147359" failed to apply to 4.9-stable tree
  2017-01-09 22:40         ` Larry Finger
@ 2017-01-10  5:35           ` Kalle Valo
  0 siblings, 0 replies; 8+ messages in thread
From: Kalle Valo @ 2017-01-10  5:35 UTC (permalink / raw)
  To: Larry Finger; +Cc: Greg KH, stable, weiyongjun1

Larry Finger <Larry.Finger@lwfinger.net> writes:

> On 01/09/2017 02:04 PM, Greg KH wrote:
>> On Mon, Jan 09, 2017 at 08:30:42PM +0200, Kalle Valo wrote:
>>>
>>> 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.

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 :)

-- 
Kalle Valo

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

end of thread, other threads:[~2017-01-10  5:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-06 12:20 FAILED: patch "[PATCH] rtlwifi: Fix kernel oops introduced with commit e49656147359" failed to apply to 4.9-stable tree gregkh
2017-01-09 14:40 ` Kalle Valo
2017-01-09 17:19   ` Larry Finger
2017-01-09 18:30     ` Kalle Valo
2017-01-09 20:04       ` Greg KH
2017-01-09 20:39         ` Kalle Valo
2017-01-09 22:40         ` Larry Finger
2017-01-10  5:35           ` 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.