All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] Bluetooth: btusb: off by one in rtl8723b_parse_firmware()
@ 2015-04-20 15:51 ` Dan Carpenter
  0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2015-04-20 15:51 UTC (permalink / raw)
  To: Marcel Holtmann, Daniel Drake
  Cc: Gustavo Padovan, Johan Hedberg, linux-bluetooth, kernel-janitors

The ">" should be ">=" so that we don't read past the end of the array.

Fixes: 9d9a113e3695 ('Bluetooth: btusb: Add Realtek 8723A/8723B/8761A/8821A support')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 920f6fb..d21f3b4 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -1502,7 +1502,7 @@ static int rtl8723b_parse_firmware(struct hci_dev *hdev, u16 lmp_subver,
 		return -EINVAL;
 	}
 
-	if (project_id > ARRAY_SIZE(project_id_to_lmp_subver)) {
+	if (project_id >= ARRAY_SIZE(project_id_to_lmp_subver)) {
 		BT_ERR("%s: unknown project id %d", hdev->name, project_id);
 		return -EINVAL;
 	}

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

* [patch] Bluetooth: btusb: off by one in rtl8723b_parse_firmware()
@ 2015-04-20 15:51 ` Dan Carpenter
  0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2015-04-20 15:51 UTC (permalink / raw)
  To: Marcel Holtmann, Daniel Drake
  Cc: Gustavo Padovan, Johan Hedberg, linux-bluetooth, kernel-janitors

The ">" should be ">=" so that we don't read past the end of the array.

Fixes: 9d9a113e3695 ('Bluetooth: btusb: Add Realtek 8723A/8723B/8761A/8821A support')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 920f6fb..d21f3b4 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -1502,7 +1502,7 @@ static int rtl8723b_parse_firmware(struct hci_dev *hdev, u16 lmp_subver,
 		return -EINVAL;
 	}
 
-	if (project_id > ARRAY_SIZE(project_id_to_lmp_subver)) {
+	if (project_id >= ARRAY_SIZE(project_id_to_lmp_subver)) {
 		BT_ERR("%s: unknown project id %d", hdev->name, project_id);
 		return -EINVAL;
 	}

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

* Re: [patch] Bluetooth: btusb: off by one in rtl8723b_parse_firmware()
  2015-04-20 15:51 ` Dan Carpenter
@ 2015-04-20 16:18   ` Daniel Drake
  -1 siblings, 0 replies; 6+ messages in thread
From: Daniel Drake @ 2015-04-20 16:18 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Marcel Holtmann, Gustavo Padovan, Johan Hedberg,
	Linux Bluetooth mailing list, kernel-janitors

On Mon, Apr 20, 2015 at 9:51 AM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> The ">" should be ">=" so that we don't read past the end of the array.
>
> Fixes: 9d9a113e3695 ('Bluetooth: btusb: Add Realtek 8723A/8723B/8761A/8821A support')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Oops! Your fix looks correct.

Thanks
Daniel

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

* Re: [patch] Bluetooth: btusb: off by one in rtl8723b_parse_firmware()
@ 2015-04-20 16:18   ` Daniel Drake
  0 siblings, 0 replies; 6+ messages in thread
From: Daniel Drake @ 2015-04-20 16:18 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Marcel Holtmann, Gustavo Padovan, Johan Hedberg,
	Linux Bluetooth mailing list, kernel-janitors

On Mon, Apr 20, 2015 at 9:51 AM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> The ">" should be ">=" so that we don't read past the end of the array.
>
> Fixes: 9d9a113e3695 ('Bluetooth: btusb: Add Realtek 8723A/8723B/8761A/8821A support')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Oops! Your fix looks correct.

Thanks
Daniel

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

* Re: [patch] Bluetooth: btusb: off by one in rtl8723b_parse_firmware()
  2015-04-20 15:51 ` Dan Carpenter
@ 2015-04-20 17:14   ` Marcel Holtmann
  -1 siblings, 0 replies; 6+ messages in thread
From: Marcel Holtmann @ 2015-04-20 17:14 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Daniel Drake, Gustavo F. Padovan, Johan Hedberg,
	bluez mailin list (linux-bluetooth@vger.kernel.org),
	kernel-janitors

Hi Dan,

> The ">" should be ">=" so that we don't read past the end of the array.
> 
> Fixes: 9d9a113e3695 ('Bluetooth: btusb: Add Realtek 8723A/8723B/8761A/8821A support')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

patch has been applied to bluetooth-next tree.

Regards

Marcel


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

* Re: [patch] Bluetooth: btusb: off by one in rtl8723b_parse_firmware()
@ 2015-04-20 17:14   ` Marcel Holtmann
  0 siblings, 0 replies; 6+ messages in thread
From: Marcel Holtmann @ 2015-04-20 17:14 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Daniel Drake, Gustavo F. Padovan, Johan Hedberg,
	bluez mailin list (linux-bluetooth@vger.kernel.org),
	kernel-janitors

Hi Dan,

> The ">" should be ">=" so that we don't read past the end of the array.
> 
> Fixes: 9d9a113e3695 ('Bluetooth: btusb: Add Realtek 8723A/8723B/8761A/8821A support')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

patch has been applied to bluetooth-next tree.

Regards

Marcel


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

end of thread, other threads:[~2015-04-20 17:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-20 15:51 [patch] Bluetooth: btusb: off by one in rtl8723b_parse_firmware() Dan Carpenter
2015-04-20 15:51 ` Dan Carpenter
2015-04-20 16:18 ` Daniel Drake
2015-04-20 16:18   ` Daniel Drake
2015-04-20 17:14 ` Marcel Holtmann
2015-04-20 17:14   ` 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.