All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: 6lowpan: Do not free skb when packet is dropped
@ 2014-12-10 12:19 Jukka Rissanen
  2014-12-18 14:05 ` Jukka Rissanen
  2014-12-19 12:43 ` Marcel Holtmann
  0 siblings, 2 replies; 5+ messages in thread
From: Jukka Rissanen @ 2014-12-10 12:19 UTC (permalink / raw)
  To: linux-bluetooth

If we need to drop the message because of some error in the
compression etc, then do not free the skb as that is done
automatically in other part of networking stack.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
---
 net/bluetooth/6lowpan.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c
index bdcaefd..ca5b4ec 100644
--- a/net/bluetooth/6lowpan.c
+++ b/net/bluetooth/6lowpan.c
@@ -390,7 +390,6 @@ static int recv_pkt(struct sk_buff *skb, struct net_device *dev,
 
 drop:
 	dev->stats.rx_dropped++;
-	kfree_skb(skb);
 	return NET_RX_DROP;
 }
 
-- 
1.8.3.1


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

* Re: [PATCH] Bluetooth: 6lowpan: Do not free skb when packet is dropped
  2014-12-10 12:19 [PATCH] Bluetooth: 6lowpan: Do not free skb when packet is dropped Jukka Rissanen
@ 2014-12-18 14:05 ` Jukka Rissanen
  2014-12-18 16:49   ` Marcel Holtmann
  2014-12-19 12:43 ` Marcel Holtmann
  1 sibling, 1 reply; 5+ messages in thread
From: Jukka Rissanen @ 2014-12-18 14:05 UTC (permalink / raw)
  To: linux-bluetooth

Ping.

On ke, 2014-12-10 at 14:19 +0200, Jukka Rissanen wrote:
> If we need to drop the message because of some error in the
> compression etc, then do not free the skb as that is done
> automatically in other part of networking stack.
> 
> Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
> ---
>  net/bluetooth/6lowpan.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c
> index bdcaefd..ca5b4ec 100644
> --- a/net/bluetooth/6lowpan.c
> +++ b/net/bluetooth/6lowpan.c
> @@ -390,7 +390,6 @@ static int recv_pkt(struct sk_buff *skb, struct net_device *dev,
>  
>  drop:
>  	dev->stats.rx_dropped++;
> -	kfree_skb(skb);
>  	return NET_RX_DROP;
>  }
>  


This patch should be applied at least in bluetooth-next. I have not seen
any errors in earlier kernels as we never seem to go to this branch but
because of Alex's ip header compression patches (that are still
pending), this error branch will be hit quite easily in the future. The
patch could be applied also to earlier kernels just in case.


Cheers,
Jukka



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

* Re: [PATCH] Bluetooth: 6lowpan: Do not free skb when packet is dropped
  2014-12-18 14:05 ` Jukka Rissanen
@ 2014-12-18 16:49   ` Marcel Holtmann
  2014-12-19 12:14     ` Jukka Rissanen
  0 siblings, 1 reply; 5+ messages in thread
From: Marcel Holtmann @ 2014-12-18 16:49 UTC (permalink / raw)
  To: Jukka Rissanen; +Cc: linux-bluetooth

Hi Jukka,

>> If we need to drop the message because of some error in the
>> compression etc, then do not free the skb as that is done
>> automatically in other part of networking stack.
>> 
>> Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
>> ---
>> net/bluetooth/6lowpan.c | 1 -
>> 1 file changed, 1 deletion(-)
>> 
>> diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c
>> index bdcaefd..ca5b4ec 100644
>> --- a/net/bluetooth/6lowpan.c
>> +++ b/net/bluetooth/6lowpan.c
>> @@ -390,7 +390,6 @@ static int recv_pkt(struct sk_buff *skb, struct net_device *dev,
>> 
>> drop:
>> 	dev->stats.rx_dropped++;
>> -	kfree_skb(skb);
>> 	return NET_RX_DROP;
>> }
>> 
> 
> 
> This patch should be applied at least in bluetooth-next. I have not seen
> any errors in earlier kernels as we never seem to go to this branch but
> because of Alex's ip header compression patches (that are still
> pending), this error branch will be hit quite easily in the future. The
> patch could be applied also to earlier kernels just in case.

are we talking about 3.19 candidate or 3.20 kernel?

Regards

Marcel


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

* Re: [PATCH] Bluetooth: 6lowpan: Do not free skb when packet is dropped
  2014-12-18 16:49   ` Marcel Holtmann
@ 2014-12-19 12:14     ` Jukka Rissanen
  0 siblings, 0 replies; 5+ messages in thread
From: Jukka Rissanen @ 2014-12-19 12:14 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: linux-bluetooth

Hi Marcel,

On to, 2014-12-18 at 17:49 +0100, Marcel Holtmann wrote:
> Hi Jukka,
> 
> >> If we need to drop the message because of some error in the
> >> compression etc, then do not free the skb as that is done
> >> automatically in other part of networking stack.
> >> 
> >> Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
> >> ---
> >> net/bluetooth/6lowpan.c | 1 -
> >> 1 file changed, 1 deletion(-)
> >> 
> >> diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c
> >> index bdcaefd..ca5b4ec 100644
> >> --- a/net/bluetooth/6lowpan.c
> >> +++ b/net/bluetooth/6lowpan.c
> >> @@ -390,7 +390,6 @@ static int recv_pkt(struct sk_buff *skb, struct net_device *dev,
> >> 
> >> drop:
> >> 	dev->stats.rx_dropped++;
> >> -	kfree_skb(skb);
> >> 	return NET_RX_DROP;
> >> }
> >> 
> > 
> > 
> > This patch should be applied at least in bluetooth-next. I have not seen
> > any errors in earlier kernels as we never seem to go to this branch but
> > because of Alex's ip header compression patches (that are still
> > pending), this error branch will be hit quite easily in the future. The
> > patch could be applied also to earlier kernels just in case.
> 
> are we talking about 3.19 candidate or 3.20 kernel?

Any earlier kernel having BT 6lowpan is affected to this double free.
The bug was introduced by commit 18722c24 dated a year ago.

Alex's patch (introducing nhc framework) will trigger this bug more
easily and it was proposed Dec 8, but because of some issues a new patch
version is expected.


Cheers,
Jukka

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

* Re: [PATCH] Bluetooth: 6lowpan: Do not free skb when packet is dropped
  2014-12-10 12:19 [PATCH] Bluetooth: 6lowpan: Do not free skb when packet is dropped Jukka Rissanen
  2014-12-18 14:05 ` Jukka Rissanen
@ 2014-12-19 12:43 ` Marcel Holtmann
  1 sibling, 0 replies; 5+ messages in thread
From: Marcel Holtmann @ 2014-12-19 12:43 UTC (permalink / raw)
  To: Jukka Rissanen; +Cc: linux-bluetooth

Hi Jukka,

> If we need to drop the message because of some error in the
> compression etc, then do not free the skb as that is done
> automatically in other part of networking stack.
> 
> Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
> ---
> net/bluetooth/6lowpan.c | 1 -
> 1 file changed, 1 deletion(-)

patch has been applied to bluetooth tree.

Regards

Marcel


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

end of thread, other threads:[~2014-12-19 12:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-10 12:19 [PATCH] Bluetooth: 6lowpan: Do not free skb when packet is dropped Jukka Rissanen
2014-12-18 14:05 ` Jukka Rissanen
2014-12-18 16:49   ` Marcel Holtmann
2014-12-19 12:14     ` Jukka Rissanen
2014-12-19 12:43 ` Marcel Holtmann

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.