Re: [v2] Bluetooth: Add more enc key size check

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

 



Hi Alex,

On Mon, Dec 11, 2023 at 4:57 AM <bluez.test.bot@xxxxxxxxx> wrote:
>
> This is automated email and please do not reply to this email!
>
> Dear submitter,
>
> Thank you for submitting the patches to the linux bluetooth mailing list.
> This is a CI test results with your patch series:
> PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=808718
>
> ---Test result---
>
> Test Summary:
> CheckPatch                    PASS      0.48 seconds
> GitLint                       PASS      0.21 seconds
> SubjectPrefix                 PASS      0.07 seconds
> BuildKernel                   PASS      27.52 seconds
> CheckAllWarning               PASS      30.74 seconds
> CheckSparse                   PASS      36.91 seconds
> CheckSmatch                   PASS      99.35 seconds
> BuildKernel32                 PASS      27.19 seconds
> TestRunnerSetup               PASS      430.58 seconds
> TestRunner_l2cap-tester       PASS      24.23 seconds
> TestRunner_iso-tester         PASS      45.04 seconds
> TestRunner_bnep-tester        PASS      7.09 seconds
> TestRunner_mgmt-tester        PASS      160.98 seconds
> TestRunner_rfcomm-tester      PASS      11.03 seconds
> TestRunner_sco-tester         PASS      14.59 seconds
> TestRunner_ioctl-tester       PASS      12.19 seconds
> TestRunner_mesh-tester        PASS      8.72 seconds
> TestRunner_smp-tester         PASS      9.77 seconds
> TestRunner_userchan-tester    PASS      7.32 seconds
> IncrementalBuild              PASS      25.72 seconds
>

How about doing the following:

diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 2ad7b9f86f74..f9a8fb9fcce2 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -750,9 +750,12 @@ static u8 hci_cc_read_enc_key_size(struct hci_dev
*hdev, void *data,
        } else {
                conn->enc_key_size = rp->key_size;
                status = 0;
+
+               if (conn->enc_key_size < hdev->min_enc_key_size)
+                       status = HCI_ERROR_AUTH_FAILURE;
        }

-       hci_encrypt_cfm(conn, 0);
+       hci_encrypt_cfm(conn, status);

 done:
        hci_dev_unlock(hdev);

That way we don't have to proliferate the checks over to L2CAP, etc,
so we consider that the encryption itself fails if the
conn->enc_key_size < hdev->min_enc_key_size.

>
> ---
> Regards,
> Linux Bluetooth
>


-- 
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