diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2015-01-23 08:10:38 (GMT) |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2015-01-23 17:59:30 (GMT) |
commit | 5d57e7964c3261827cc718b0e5317ac4950e2f21 (patch) | |
tree | 9e4c4bdd5cc3bc4af997005e252d9c6035b29f2f /net/bluetooth/mgmt.c | |
parent | ed93ec69c7e0e80d733dced5b73af0f23cc3b061 (diff) | |
download | linux-5d57e7964c3261827cc718b0e5317ac4950e2f21.tar.xz |
Bluetooth: Check for valid bdaddr in add_remote_oob_data
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>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/mgmt.c')
-rw-r--r-- | net/bluetooth/mgmt.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 41e3005..2c0de3e 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) { |