Re: [PATCH v2 30/32] Bluetooth: Fix validating LE PSM values

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Johan,

On Thu, Dec 5, 2013 at 9:11 AM,  <johan.hedberg@xxxxxxxxx> wrote:
> +static bool is_valid_psm(u16 psm, u8 dst_type)
> +{
> +       if (!psm)
> +               return false;
> +
> +       if (bdaddr_type_is_le(dst_type))
> +               return (psm < 0x00ff);

Shouldn't be "psm <= 0x00ff" here?

> +
> +       /* PSM must be odd and lsb of upper byte must be 0 */
> +       return ((psm & 0x0101) == 0x0001);
> +}
> +
>  int l2cap_chan_connect(struct l2cap_chan *chan, __le16 psm, u16 cid,
>                        bdaddr_t *dst, u8 dst_type)
>  {

Best Regards,
-- 
Anderson Lizardo
Instituto Nokia de Tecnologia - INdT
Manaus - Brazil
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux