All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] Bluetooth: Check for valid bdaddr in add_remote_oob_data
@ 2015-01-23  8:10 Johan Hedberg
  2015-01-23  8:10 ` [PATCH 2/2] Bluetooth: Remove incorrect check for BDADDR_BREDR address type Johan Hedberg
  2015-01-23 18:07 ` [PATCH 1/2] Bluetooth: Check for valid bdaddr in add_remote_oob_data Marcel Holtmann
  0 siblings, 2 replies; 4+ messages in thread
From: Johan Hedberg @ 2015-01-23  8:10 UTC (permalink / raw)
  To: linux-bluetooth

From: Johan Hedberg <johan.hedberg@intel.com>

Before doing any other verifications, the add_remote_oob_data function
should first check that the given address is valid. This patch adds such
a missing check to the beginning of the function.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
---
 net/bluetooth/mgmt.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 41e30055bae8..2c0de3e4e79a 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -3633,10 +3633,16 @@ unlock:
 static int add_remote_oob_data(struct sock *sk, struct hci_dev *hdev,
 			       void *data, u16 len)
 {
+	struct mgmt_addr_info *addr = data;
 	int err;
 
 	BT_DBG("%s ", hdev->name);
 
+	if (!bdaddr_type_is_valid(addr->type))
+		return cmd_complete(sk, hdev->id, MGMT_OP_ADD_REMOTE_OOB_DATA,
+				    MGMT_STATUS_INVALID_PARAMS, addr,
+				    sizeof(*addr));
+
 	hci_dev_lock(hdev);
 
 	if (len == MGMT_ADD_REMOTE_OOB_DATA_SIZE) {
-- 
2.1.0


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

* [PATCH 2/2] Bluetooth: Remove incorrect check for BDADDR_BREDR address type
  2015-01-23  8:10 [PATCH 1/2] Bluetooth: Check for valid bdaddr in add_remote_oob_data Johan Hedberg
@ 2015-01-23  8:10 ` Johan Hedberg
  2015-01-23 18:07   ` Marcel Holtmann
  2015-01-23 18:07 ` [PATCH 1/2] Bluetooth: Check for valid bdaddr in add_remote_oob_data Marcel Holtmann
  1 sibling, 1 reply; 4+ messages in thread
From: Johan Hedberg @ 2015-01-23  8:10 UTC (permalink / raw)
  To: linux-bluetooth

From: Johan Hedberg <johan.hedberg@intel.com>

The Add Remote OOB Data mgmt command should allow data to be passed for
LE as well. This patch removes a left-over check for BDADDR_BREDR that
should not be there anymore.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
---
 net/bluetooth/mgmt.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 2c0de3e4e79a..862a005d9db2 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -3672,14 +3672,6 @@ static int add_remote_oob_data(struct sock *sk, struct hci_dev *hdev,
 		u8 *rand192, *hash192;
 		u8 status;
 
-		if (cp->addr.type != BDADDR_BREDR) {
-			err = cmd_complete(sk, hdev->id,
-					   MGMT_OP_ADD_REMOTE_OOB_DATA,
-					   MGMT_STATUS_INVALID_PARAMS,
-					   &cp->addr, sizeof(cp->addr));
-			goto unlock;
-		}
-
 		if (bdaddr_type_is_le(cp->addr.type)) {
 			rand192 = NULL;
 			hash192 = NULL;
-- 
2.1.0


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

* Re: [PATCH 2/2] Bluetooth: Remove incorrect check for BDADDR_BREDR address type
  2015-01-23  8:10 ` [PATCH 2/2] Bluetooth: Remove incorrect check for BDADDR_BREDR address type Johan Hedberg
@ 2015-01-23 18:07   ` Marcel Holtmann
  0 siblings, 0 replies; 4+ messages in thread
From: Marcel Holtmann @ 2015-01-23 18:07 UTC (permalink / raw)
  To: Johan Hedberg; +Cc: linux-bluetooth

Hi Johan,

> The Add Remote OOB Data mgmt command should allow data to be passed for
> LE as well. This patch removes a left-over check for BDADDR_BREDR that
> should not be there anymore.
> 
> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
> ---
> net/bluetooth/mgmt.c | 8 --------
> 1 file changed, 8 deletions(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel


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

* Re: [PATCH 1/2] Bluetooth: Check for valid bdaddr in add_remote_oob_data
  2015-01-23  8:10 [PATCH 1/2] Bluetooth: Check for valid bdaddr in add_remote_oob_data Johan Hedberg
  2015-01-23  8:10 ` [PATCH 2/2] Bluetooth: Remove incorrect check for BDADDR_BREDR address type Johan Hedberg
@ 2015-01-23 18:07 ` Marcel Holtmann
  1 sibling, 0 replies; 4+ messages in thread
From: Marcel Holtmann @ 2015-01-23 18:07 UTC (permalink / raw)
  To: Johan Hedberg; +Cc: linux-bluetooth

Hi Johan,

> Before doing any other verifications, the add_remote_oob_data function
> should first check that the given address is valid. This patch adds such
> a missing check to the beginning of the function.
> 
> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
> ---
> net/bluetooth/mgmt.c | 6 ++++++
> 1 file changed, 6 insertions(+)

patch has been applied to bluetooth-next tree.

Regards

Marcel


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

end of thread, other threads:[~2015-01-23 18:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-23  8:10 [PATCH 1/2] Bluetooth: Check for valid bdaddr in add_remote_oob_data Johan Hedberg
2015-01-23  8:10 ` [PATCH 2/2] Bluetooth: Remove incorrect check for BDADDR_BREDR address type Johan Hedberg
2015-01-23 18:07   ` Marcel Holtmann
2015-01-23 18:07 ` [PATCH 1/2] Bluetooth: Check for valid bdaddr in add_remote_oob_data 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.