Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commits on Source (5)
  • Brian Delwiche's avatar
    Remove flag btsec_check_valid_discovery_database · e1038719
    Brian Delwiche authored
    This flag has been soaked for more than a month and is ready for
    removal.
    
    This is a cherry-pick of ag/30363401 -- the 25Q2 branch was cut with the flag still present and we need to remove that flag to close.
    
    Bug: 356201480
    Flag: EXEMPT flag removal
    Test: m libbluetooth
    Tag: #security
    Ignore-AOSP-First: Security
    Change-Id: I31d47316748515fb44d729ba14946f98420afb36
    (cherry picked from commit 769caf391c6055c6f9db945b71d96b2f01c8799c)
    e1038719
  • Brian Delwiche's avatar
    Remove flag bonded_device_smp_failure_handling · 3a1bc082
    Brian Delwiche authored
    Flag has been in Nextfood for nine weeks per Gantry and should be safe
    to remove.
    
    This is a cherry-pick of the reland version and is required because the 25Q2 branch was cut after the fix was in place but before the flag was removed.
    
    Test: mmm packages/modules/Bluetooth
    Flag: EXEMPT removing flag com.android.bluetooth.flags.bonded_device_smp_failure_handling
    Bug: 385181815
    Change-Id: I2cc107a3de1b84cd45af13209ed45cfcec5a5216
    (cherry picked from commit 77cc20f000ef4e69fdc1297f6f99e9b379ab5733)
    DISABLE_TOPIC_PROTECTOR
    3a1bc082
  • Brian Delwiche's avatar
    Fix use after free in acl_arbiter · d6cb1ec8
    Brian Delwiche authored
    In SendPacketToPeer of acl_arbiter.cc, a buffer length is logged in one
    case after an intermediate call may free the buffer, leading to use
    after free.
    
    Log instead from the buffer's source, which has not been freed at this
    point in the code.
    
    Bug: 406785684
    Flag: EXEMPT obvious logic fix
    Test: m libbluetooth
    Test: researcher POC
    Tag: #security
    Change-Id: Idd13399c24399d01bcd668a4b779ef1980273691
    (cherry picked from commit 243d7484e59730c522640b616445b2747b3062e5)
    d6cb1ec8
  • Brian Delwiche's avatar
  • Michael Bestas's avatar
    Merge branch 'android16-security-release' of... · 0428c101
    Michael Bestas authored
    Merge branch 'android16-security-release' of https://android.googlesource.com/platform/packages/modules/Bluetooth into lineage-23.0
    
    * 'android16-security-release' of https://android.googlesource.com/platform/packages/modules/Bluetooth:
      Fix use after free in acl_arbiter
      Remove flag bonded_device_smp_failure_handling
      Remove flag btsec_check_valid_discovery_database
    
    Change-Id: Ibd306a11c26c812da55557ca29603be91e2c17aa
    0428c101
......@@ -141,16 +141,6 @@ flag {
}
}
flag {
name: "bonded_device_smp_failure_handling"
namespace: "bluetooth"
description: "Don't remove bond on SMP failure for bonded devices in peripheral role"
bug: "385181815"
metadata {
purpose: PURPOSE_BUGFIX
}
}
flag {
name: "peripheral_auth_req"
namespace: "bluetooth"
......
......@@ -18,16 +18,6 @@ flag {
bug: "333634398"
}
flag {
name: "btsec_check_valid_discovery_database"
namespace: "bluetooth"
description: "Check for a valid discovery database before using it, and don't set up a discovery database for a new HF client if one has already been defined for it"
bug: "356201480"
metadata {
purpose: PURPOSE_BUGFIX
}
}
flag {
name: "le_enc_on_reconnect"
namespace: "bluetooth"
......
......@@ -283,8 +283,7 @@ void bta_hf_client_cb_init(tBTA_HF_CLIENT_CB* client_cb, uint16_t handle) {
client_cb->enabled_hf_indicators.clear();
client_cb->peer_hf_indicators.clear();
if (client_cb->p_disc_db &&
com::android::bluetooth::flags::btsec_check_valid_discovery_database()) {
if (client_cb->p_disc_db) {
if (!get_legacy_stack_sdp_api()->service.SDP_CancelServiceSearch(client_cb->p_disc_db)) {
log::warn("Unable to cancel SDP service discovery peer:{}", client_cb->peer_addr);
}
......
......@@ -361,8 +361,7 @@ void bta_hf_client_do_disc(tBTA_HF_CLIENT_CB* client_cb) {
/* If we already have a non-null discovery database at this point, we can get
* into a race condition leading to UAF once this connection is closed.
* This should only happen with malicious modifications to a client. */
if (com::android::bluetooth::flags::btsec_check_valid_discovery_database() &&
client_cb->p_disc_db != NULL) {
if (client_cb->p_disc_db != NULL) {
log::error("Tried to set up a HF client with a preexisting discovery database.");
client_cb->p_disc_db = NULL;
// We manually set the state here because it's possible to call this from an
......
......@@ -115,7 +115,7 @@ void AclArbiter::SendPacketToPeer(uint8_t tcb_idx, ::rust::Vec<uint8_t> buffer)
if (stack::l2cap::get_interface().L2CA_SendFixedChnlData(L2CAP_ATT_CID, p_tcb->peer_bda,
p_buf) != tL2CAP_DW_RESULT::SUCCESS) {
log::warn("Unable to send L2CAP data peer:{} fixed_cid:{} len:{}", p_tcb->peer_bda,
L2CAP_ATT_CID, p_buf->len);
L2CAP_ATT_CID, buffer.size());
}
} else {
log::error("Dropping packet since connection no longer exists");
......
......@@ -1637,10 +1637,6 @@ void btm_ble_connection_established(const RawAddress& bda) {
static bool btm_ble_complete_evt_ignore(const tBTM_SEC_DEV_REC* p_dev_rec,
const tBTM_LE_EVT_DATA* p_data) {
if (!com::android::bluetooth::flags::bonded_device_smp_failure_handling()) {
return false;
}
// Peripheral role: Encryption request results in SMP Security request. SMP may generate a
// SMP_COMPLT_EVT failure event cases like below:
// 1) Some central devices don't handle cross-over between encryption and SMP security request
......
......@@ -643,8 +643,7 @@ static void process_service_search_attr_rsp(tCONN_CB* p_ccb, uint8_t* p_reply,
uint16_t bytes_left = SDP_DATA_BUF_SIZE;
/* If we don't have a valid discovery database, we can't do anything. */
if (com::android::bluetooth::flags::btsec_check_valid_discovery_database() &&
p_ccb->p_db == NULL) {
if (p_ccb->p_db == NULL) {
log::warn(
"Attempted continuation or first time request with invalid discovery "
"database");
......