Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCHv2] Bluetooth: Ignore H5 non-link packets in non-active state
@ 2014-06-23 15:42 Loic Poulain
  2014-06-23 15:54 ` Greg KH
  2014-06-23 15:54 ` Marcel Holtmann
  0 siblings, 2 replies; 3+ messages in thread
From: Loic Poulain @ 2014-06-23 15:42 UTC (permalink / raw)
  To: marcel, johan.hedberg, gustavo; +Cc: linux-bluetooth, stable, Loic Poulain

When detecting a non-link packet, h5_reset_rx() frees the Rx skb.
Not returning after that will cause the upcoming h5_rx_payload()
call to dereference a now NULL Rx skb and trigger a kernel oops.

Signed-off-by: Loic Poulain <loic.poulain@intel.com>
---
 v2: commit message update (pointer deref)

 drivers/bluetooth/hci_h5.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/bluetooth/hci_h5.c b/drivers/bluetooth/hci_h5.c
index 04680ea..fede8ca 100644
--- a/drivers/bluetooth/hci_h5.c
+++ b/drivers/bluetooth/hci_h5.c
@@ -406,6 +406,7 @@ static int h5_rx_3wire_hdr(struct hci_uart *hu, unsigned char c)
 	    H5_HDR_PKT_TYPE(hdr) != HCI_3WIRE_LINK_PKT) {
 		BT_ERR("Non-link packet received in non-active state");
 		h5_reset_rx(h5);
+		return 0;
 	}
 
 	h5->rx_func = h5_rx_payload;
-- 
1.8.3.2


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

* Re: [PATCHv2] Bluetooth: Ignore H5 non-link packets in non-active state
  2014-06-23 15:42 [PATCHv2] Bluetooth: Ignore H5 non-link packets in non-active state Loic Poulain
@ 2014-06-23 15:54 ` Greg KH
  2014-06-23 15:54 ` Marcel Holtmann
  1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2014-06-23 15:54 UTC (permalink / raw)
  To: Loic Poulain; +Cc: marcel, johan.hedberg, gustavo, linux-bluetooth, stable

On Mon, Jun 23, 2014 at 05:42:44PM +0200, Loic Poulain wrote:
> When detecting a non-link packet, h5_reset_rx() frees the Rx skb.
> Not returning after that will cause the upcoming h5_rx_payload()
> call to dereference a now NULL Rx skb and trigger a kernel oops.
> 
> Signed-off-by: Loic Poulain <loic.poulain@intel.com>
> ---
>  v2: commit message update (pointer deref)
> 
>  drivers/bluetooth/hci_h5.c | 1 +
>  1 file changed, 1 insertion(+)

<formletter>

This is not the correct way to submit patches for inclusion in the
stable kernel tree.  Please read Documentation/stable_kernel_rules.txt
for how to do this properly.

</formletter>

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

* Re: [PATCHv2] Bluetooth: Ignore H5 non-link packets in non-active state
  2014-06-23 15:42 [PATCHv2] Bluetooth: Ignore H5 non-link packets in non-active state Loic Poulain
  2014-06-23 15:54 ` Greg KH
@ 2014-06-23 15:54 ` Marcel Holtmann
  1 sibling, 0 replies; 3+ messages in thread
From: Marcel Holtmann @ 2014-06-23 15:54 UTC (permalink / raw)
  To: Loic Poulain
  Cc: Johan Hedberg, Gustavo F. Padovan, Linux Bluetooth mailing list,
	stable

Hi Loic,

> When detecting a non-link packet, h5_reset_rx() frees the Rx skb.
> Not returning after that will cause the upcoming h5_rx_payload()
> call to dereference a now NULL Rx skb and trigger a kernel oops.
> 
> Signed-off-by: Loic Poulain <loic.poulain@intel.com>
> ---
> v2: commit message update (pointer deref)
> 
> drivers/bluetooth/hci_h5.c | 1 +
> 1 file changed, 1 insertion(+)

I applied the updated patch to bluetooth-next with a proper tag for stable.

Regards

Marcel


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

end of thread, other threads:[~2014-06-23 15:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-23 15:42 [PATCHv2] Bluetooth: Ignore H5 non-link packets in non-active state Loic Poulain
2014-06-23 15:54 ` Greg KH
2014-06-23 15:54 ` Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox