[Bug 203997] [REGRESSION] Unable to connect BT audio device on 5.1.15

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

 



https://bugzilla.kernel.org/show_bug.cgi?id=203997

--- Comment #8 from Matias Karhumaa (matias.karhumaa@xxxxxxxxx) ---
Ah, I think recent regression fix [1] caused another bug:

--snip--
static bool l2cap_check_enc_key_size(struct hci_conn *hcon)
{
        /* The minimum encryption key size needs to be enforced by the
         * host stack before establishing any L2CAP connections. The
         * specification in theory allows a minimum of 1, but to align
         * BR/EDR and LE transports, a minimum of 7 is chosen.
         *
         * This check might also be called for unencrypted connections
         * that have no key size requirements. Ensure that the link is
         * actually encrypted before enforcing a key size.
         */
        return (!test_bit(HCI_CONN_ENCRYPT, &hcon->flags) ||
                hcon->enc_key_size > HCI_MIN_ENC_KEY_SIZE);
}
--snip--

If Encryption key size is 7, L2CAP connection will fail. I think it should be
something like this:

In l2cap_core.c

static bool l2cap_check_enc_key_size(struct hci_conn *hcon)
{
        /* The minimum encryption key size needs to be enforced by the
         * host stack before establishing any L2CAP connections. The
         * specification in theory allows a minimum of 1, but to align
         * BR/EDR and LE transports, a minimum of 7 is chosen.
         *
         * This check might also be called for unencrypted connections
         * that have no key size requirements. Ensure that the link is
         * actually encrypted before enforcing a key size.
         */
        return (!test_bit(HCI_CONN_ENCRYPT, &hcon->flags) ||
                hcon->enc_key_size >= HCI_MIN_ENC_KEY_SIZE);
}
--snip--

Could you test the fix?

[1]:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/net/bluetooth?id=693cd8ce3f882524a5d06f7800dd8492411877b3

-- 
You are receiving this mail because:
You are the assignee for the bug.



[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