Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Bluetooth: Always use non-bonding requirement when not bondable

When we're not bondable we should never send any other SSP
authentication requirement besides one of the non-bonding ones.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>

authored by

Johan Hedberg and committed by
Marcel Holtmann
82c295b1 b2939475

+8 -3
+8 -3
net/bluetooth/hci_event.c
··· 3671 3671 if (conn->io_capability != HCI_IO_NO_INPUT_OUTPUT && 3672 3672 conn->auth_type != HCI_AT_NO_BONDING) 3673 3673 conn->auth_type |= 0x01; 3674 - 3675 - cp.authentication = conn->auth_type; 3676 3674 } else { 3677 3675 conn->auth_type = hci_get_auth_req(conn); 3678 - cp.authentication = conn->auth_type; 3679 3676 } 3677 + 3678 + /* If we're not bondable, force one of the non-bondable 3679 + * authentication requirement values. 3680 + */ 3681 + if (!test_bit(HCI_BONDABLE, &hdev->dev_flags)) 3682 + conn->auth_type &= HCI_AT_NO_BONDING_MITM; 3683 + 3684 + cp.authentication = conn->auth_type; 3680 3685 3681 3686 if (hci_find_remote_oob_data(hdev, &conn->dst) && 3682 3687 (conn->out || test_bit(HCI_CONN_REMOTE_OOB, &conn->flags)))