linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] Bluetooth: mgmt: Fix some code style and indentation issues
@ 2012-03-16 15:02 Szymon Janc
  2012-03-16 15:02 ` [PATCH 2/2] Bluetooth: mgmt: Don't allow to set invalid value to DeviceID source Szymon Janc
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Szymon Janc @ 2012-03-16 15:02 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: kanak.gupta, Szymon Janc

Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
---
 net/bluetooth/mgmt.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 212b8a4..70eee11 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -1144,8 +1144,8 @@ static int set_ssp(struct sock *sk, struct hci_dev *hdev, void *data, u16 len)
 	}
 
 	if (mgmt_pending_find(MGMT_OP_SET_SSP, hdev)) {
-	     err = cmd_status(sk, hdev->id, MGMT_OP_SET_SSP,
-			      MGMT_STATUS_BUSY);
+		err = cmd_status(sk, hdev->id, MGMT_OP_SET_SSP,
+				 MGMT_STATUS_BUSY);
 		goto failed;
 	}
 
@@ -3048,7 +3048,7 @@ int mgmt_device_disconnected(struct hci_dev *hdev, bdaddr_t *bdaddr,
 			 sk);
 
 	if (sk)
-	  sock_put(sk);
+		sock_put(sk);
 
 	mgmt_pending_foreach(MGMT_OP_UNPAIR_DEVICE, hdev, unpair_device_rsp,
 			     hdev);
@@ -3460,10 +3460,10 @@ int mgmt_le_enable_complete(struct hci_dev *hdev, u8 enable, u8 status)
 
 		if (enable && test_and_clear_bit(HCI_LE_ENABLED,
 						 &hdev->dev_flags))
-		  err = new_settings(hdev, NULL);
+			err = new_settings(hdev, NULL);
 
-		mgmt_pending_foreach(MGMT_OP_SET_LE, hdev,
-				     cmd_status_rsp, &mgmt_err);
+		mgmt_pending_foreach(MGMT_OP_SET_LE, hdev, cmd_status_rsp,
+				     &mgmt_err);
 
 		return err;
 	}
-- 
on behalf of ST-Ericsson


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

* [PATCH 2/2] Bluetooth: mgmt: Don't allow to set invalid value to DeviceID source
  2012-03-16 15:02 [PATCH 1/2] Bluetooth: mgmt: Fix some code style and indentation issues Szymon Janc
@ 2012-03-16 15:02 ` Szymon Janc
  2012-03-16 15:06   ` Gustavo Padovan
  2012-03-16 16:10   ` Marcel Holtmann
  2012-03-16 15:05 ` [PATCH 1/2] Bluetooth: mgmt: Fix some code style and indentation issues Gustavo Padovan
  2012-03-16 16:09 ` Marcel Holtmann
  2 siblings, 2 replies; 10+ messages in thread
From: Szymon Janc @ 2012-03-16 15:02 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: kanak.gupta, Szymon Janc

Reply with MGMT_STATUS_INVALID_PARAMS when userspace is trying to set
source with out-of-scope value.

Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
---
 net/bluetooth/mgmt.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 70eee11..a5ec832 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -2528,12 +2528,19 @@ static int set_device_id(struct sock *sk, struct hci_dev *hdev, void *data,
 {
 	struct mgmt_cp_set_device_id *cp = data;
 	int err;
+	__u16 source;
 
 	BT_DBG("%s", hdev->name);
 
+	source = __le16_to_cpu(cp->source);
+
+	if (source > 0x0002)
+		return cmd_status(sk, hdev->id, MGMT_OP_SET_DEVICE_ID,
+				  MGMT_STATUS_INVALID_PARAMS);
+
 	hci_dev_lock(hdev);
 
-	hdev->devid_source = __le16_to_cpu(cp->source);
+	hdev->devid_source = source;
 	hdev->devid_vendor = __le16_to_cpu(cp->vendor);
 	hdev->devid_product = __le16_to_cpu(cp->product);
 	hdev->devid_version = __le16_to_cpu(cp->version);
-- 
on behalf of ST-Ericsson


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

* Re: [PATCH 1/2] Bluetooth: mgmt: Fix some code style and indentation issues
  2012-03-16 15:02 [PATCH 1/2] Bluetooth: mgmt: Fix some code style and indentation issues Szymon Janc
  2012-03-16 15:02 ` [PATCH 2/2] Bluetooth: mgmt: Don't allow to set invalid value to DeviceID source Szymon Janc
@ 2012-03-16 15:05 ` Gustavo Padovan
  2012-03-16 16:09 ` Marcel Holtmann
  2 siblings, 0 replies; 10+ messages in thread
From: Gustavo Padovan @ 2012-03-16 15:05 UTC (permalink / raw)
  To: Szymon Janc; +Cc: linux-bluetooth, kanak.gupta

Hi Szymon,

* Szymon Janc <szymon.janc@tieto.com> [2012-03-16 16:02:56 +0100]:

> Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
> ---
>  net/bluetooth/mgmt.c |   12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)

Acked-by: Gustavo Padovan <gustavo@padovan.org>

	Gustavo

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

* Re: [PATCH 2/2] Bluetooth: mgmt: Don't allow to set invalid value to DeviceID source
  2012-03-16 15:02 ` [PATCH 2/2] Bluetooth: mgmt: Don't allow to set invalid value to DeviceID source Szymon Janc
@ 2012-03-16 15:06   ` Gustavo Padovan
  2012-03-16 16:11     ` Marcel Holtmann
  2012-03-16 16:13     ` Johan Hedberg
  2012-03-16 16:10   ` Marcel Holtmann
  1 sibling, 2 replies; 10+ messages in thread
From: Gustavo Padovan @ 2012-03-16 15:06 UTC (permalink / raw)
  To: Szymon Janc; +Cc: linux-bluetooth, kanak.gupta

Hi Szymon,

* Szymon Janc <szymon.janc@tieto.com> [2012-03-16 16:02:57 +0100]:

> Reply with MGMT_STATUS_INVALID_PARAMS when userspace is trying to set
> source with out-of-scope value.
> 
> Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
> ---
>  net/bluetooth/mgmt.c |    9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)

This one should go to bluetooth.git first.

Acked-by: Gustavo Padovan <gustavo@padovan.org>

	Gustavo

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

* Re: [PATCH 1/2] Bluetooth: mgmt: Fix some code style and indentation issues
  2012-03-16 15:02 [PATCH 1/2] Bluetooth: mgmt: Fix some code style and indentation issues Szymon Janc
  2012-03-16 15:02 ` [PATCH 2/2] Bluetooth: mgmt: Don't allow to set invalid value to DeviceID source Szymon Janc
  2012-03-16 15:05 ` [PATCH 1/2] Bluetooth: mgmt: Fix some code style and indentation issues Gustavo Padovan
@ 2012-03-16 16:09 ` Marcel Holtmann
  2 siblings, 0 replies; 10+ messages in thread
From: Marcel Holtmann @ 2012-03-16 16:09 UTC (permalink / raw)
  To: Szymon Janc; +Cc: linux-bluetooth, kanak.gupta

Hi Szymon,

> Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
> ---
>  net/bluetooth/mgmt.c |   12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)

Acked-by: Marcel Holtmann <marcel@holtmann.org>

Regards

Marcel



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

* Re: [PATCH 2/2] Bluetooth: mgmt: Don't allow to set invalid value to DeviceID source
  2012-03-16 15:02 ` [PATCH 2/2] Bluetooth: mgmt: Don't allow to set invalid value to DeviceID source Szymon Janc
  2012-03-16 15:06   ` Gustavo Padovan
@ 2012-03-16 16:10   ` Marcel Holtmann
  1 sibling, 0 replies; 10+ messages in thread
From: Marcel Holtmann @ 2012-03-16 16:10 UTC (permalink / raw)
  To: Szymon Janc; +Cc: linux-bluetooth, kanak.gupta

Hi Szymon,

> Reply with MGMT_STATUS_INVALID_PARAMS when userspace is trying to set
> source with out-of-scope value.
> 
> Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
> ---
>  net/bluetooth/mgmt.c |    9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)

Acked-by: Marcel Holtmann <marcel@holtmann.org>

Regards

Marcel



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

* Re: [PATCH 2/2] Bluetooth: mgmt: Don't allow to set invalid value to DeviceID source
  2012-03-16 15:06   ` Gustavo Padovan
@ 2012-03-16 16:11     ` Marcel Holtmann
  2012-03-16 16:13     ` Johan Hedberg
  1 sibling, 0 replies; 10+ messages in thread
From: Marcel Holtmann @ 2012-03-16 16:11 UTC (permalink / raw)
  To: Gustavo Padovan; +Cc: Szymon Janc, linux-bluetooth, kanak.gupta

Hi Gustavo,

> * Szymon Janc <szymon.janc@tieto.com> [2012-03-16 16:02:57 +0100]:
> 
> > Reply with MGMT_STATUS_INVALID_PARAMS when userspace is trying to set
> > source with out-of-scope value.
> > 
> > Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
> > ---
> >  net/bluetooth/mgmt.c |    9 ++++++++-
> >  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> This one should go to bluetooth.git first.

why? What would it be doing there?

This code is not even scheduled for 3.4 anymore.

Regards

Marcel



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

* Re: [PATCH 2/2] Bluetooth: mgmt: Don't allow to set invalid value to DeviceID source
  2012-03-16 15:06   ` Gustavo Padovan
  2012-03-16 16:11     ` Marcel Holtmann
@ 2012-03-16 16:13     ` Johan Hedberg
  2012-03-16 16:20       ` Marcel Holtmann
  1 sibling, 1 reply; 10+ messages in thread
From: Johan Hedberg @ 2012-03-16 16:13 UTC (permalink / raw)
  To: Gustavo Padovan, Szymon Janc, linux-bluetooth, kanak.gupta

Hi,

On Fri, Mar 16, 2012, Gustavo Padovan wrote:
> * Szymon Janc <szymon.janc@tieto.com> [2012-03-16 16:02:57 +0100]:
> 
> > Reply with MGMT_STATUS_INVALID_PARAMS when userspace is trying to set
> > source with out-of-scope value.
> > 
> > Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
> > ---
> >  net/bluetooth/mgmt.c |    9 ++++++++-
> >  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> This one should go to bluetooth.git first.
> 
> Acked-by: Gustavo Padovan <gustavo@padovan.org>

I went ahead and applied both directly to my bluetooth-next tree. I
don't think this one is critical enough to deserve to go to
bluetooth.git.

Johan

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

* Re: [PATCH 2/2] Bluetooth: mgmt: Don't allow to set invalid value to DeviceID source
  2012-03-16 16:13     ` Johan Hedberg
@ 2012-03-16 16:20       ` Marcel Holtmann
  2012-03-16 16:31         ` Johan Hedberg
  0 siblings, 1 reply; 10+ messages in thread
From: Marcel Holtmann @ 2012-03-16 16:20 UTC (permalink / raw)
  To: Johan Hedberg; +Cc: Gustavo Padovan, Szymon Janc, linux-bluetooth, kanak.gupta

Hi Johan,

> > > Reply with MGMT_STATUS_INVALID_PARAMS when userspace is trying to set
> > > source with out-of-scope value.
> > > 
> > > Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
> > > ---
> > >  net/bluetooth/mgmt.c |    9 ++++++++-
> > >  1 file changed, 8 insertions(+), 1 deletion(-)
> > 
> > This one should go to bluetooth.git first.
> > 
> > Acked-by: Gustavo Padovan <gustavo@padovan.org>
> 
> I went ahead and applied both directly to my bluetooth-next tree. I
> don't think this one is critical enough to deserve to go to
> bluetooth.git.

you are both kidding me here right now, right? Of course this is not
going into bluetooth.git since it is not even in net-next or scheduled
for the next merge window.

And nothing goes into bluetooth.git first (unless it only applies
there). Everything goes into bluetooth-next.git first.

Regards

Marcel



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

* Re: [PATCH 2/2] Bluetooth: mgmt: Don't allow to set invalid value to DeviceID source
  2012-03-16 16:20       ` Marcel Holtmann
@ 2012-03-16 16:31         ` Johan Hedberg
  0 siblings, 0 replies; 10+ messages in thread
From: Johan Hedberg @ 2012-03-16 16:31 UTC (permalink / raw)
  To: Marcel Holtmann
  Cc: Gustavo Padovan, Szymon Janc, linux-bluetooth, kanak.gupta

Hi Marcel,

On Fri, Mar 16, 2012, Marcel Holtmann wrote:
> Hi Johan,
> 
> > > > Reply with MGMT_STATUS_INVALID_PARAMS when userspace is trying to set
> > > > source with out-of-scope value.
> > > > 
> > > > Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
> > > > ---
> > > >  net/bluetooth/mgmt.c |    9 ++++++++-
> > > >  1 file changed, 8 insertions(+), 1 deletion(-)
> > > 
> > > This one should go to bluetooth.git first.
> > > 
> > > Acked-by: Gustavo Padovan <gustavo@padovan.org>
> > 
> > I went ahead and applied both directly to my bluetooth-next tree. I
> > don't think this one is critical enough to deserve to go to
> > bluetooth.git.
> 
> you are both kidding me here right now, right? Of course this is not
> going into bluetooth.git since it is not even in net-next or scheduled
> for the next merge window.
> 
> And nothing goes into bluetooth.git first (unless it only applies
> there). Everything goes into bluetooth-next.git first.

You're right. I realized this just as I sent the email.

Johan

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

end of thread, other threads:[~2012-03-16 16:31 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-16 15:02 [PATCH 1/2] Bluetooth: mgmt: Fix some code style and indentation issues Szymon Janc
2012-03-16 15:02 ` [PATCH 2/2] Bluetooth: mgmt: Don't allow to set invalid value to DeviceID source Szymon Janc
2012-03-16 15:06   ` Gustavo Padovan
2012-03-16 16:11     ` Marcel Holtmann
2012-03-16 16:13     ` Johan Hedberg
2012-03-16 16:20       ` Marcel Holtmann
2012-03-16 16:31         ` Johan Hedberg
2012-03-16 16:10   ` Marcel Holtmann
2012-03-16 15:05 ` [PATCH 1/2] Bluetooth: mgmt: Fix some code style and indentation issues Gustavo Padovan
2012-03-16 16:09 ` Marcel Holtmann

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