Re: [PATCH] Bluetooth: L2CAP: Fix errors during L2CAP_CREDIT_BASED_CONNECTION_REQ (0x17)

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

 



Hi Konstantin,

On Wed, Apr 29, 2020 at 9:52 AM CEE Forostyan, Konstantin
<Konstantin.Forostyan@xxxxxxxxxxxxx> wrote:
>
> Hi All,
>
> During Bluetooth qualification tests I found out that Bluetooth stack responds with an error to a correct L2CAP_CREDIT_BASED_CONNECTION_REQ. Please review the 2 bugfixes I made in kernel in order to correct this problem.
>
> Best regards
> Konstantin
>
>
> --- a/net/bluetooth/l2cap_core.c        2020-04-28 18:19:10.481887583 +0200
> +++ b/net/bluetooth/l2cap_core.c        2020-04-28 18:21:41.000000000 +0200
> @@ -5817,7 +5817,7 @@
>         if (!enable_ecred)
>                 return -EINVAL;
>
> -       if (cmd_len < sizeof(*req) || cmd_len - sizeof(*req) % sizeof(u16)) {
> +       if (cmd_len < sizeof(*req) || (cmd_len - sizeof(*req)) % sizeof(u16)) {
>                 result = L2CAP_CR_LE_INVALID_PARAMS;
>                 goto response;
>         }
> @@ -5855,7 +5855,7 @@
>         }
>
>         result = L2CAP_CR_LE_SUCCESS;
> -       cmd_len -= sizeof(req);
> +       cmd_len -= sizeof(*req);
>         num_scid = cmd_len / sizeof(u16);
>
>         for (i = 0; i < num_scid; i++) {

Weird that I didn't run into this when creating the test for
l2cap-tester, they look correct though so please send them as proper
patches so we can apply to bluetooth-next, also please ensure
l2cap-tester is working.

-- 
Luiz Augusto von Dentz



[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