• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

system/bt


Commit MetaInfo

Revisão1003b2c2b45bbc26c0beadeb10179dd8bd9f80f4 (tree)
Hora2019-11-23 04:29:41
AutorAdam Seaton <aseaton@goog...>
CommiterAdam Seaton

Mensagem de Log

Revert "Fix potential OOB write in btm_read_remote_ext_features_complete"

This reverts commit 9935f2ba7d9e78ff4c82bd3384960e27072a0b21.

Reason for revert: reverting due to functional regressions in Auto.

Bug: 144205318
Change-Id: I41dbcc0c5cb88dc72b13db2dd76e4751d7e98a6c

Mudança Sumário

Diff

--- a/stack/btm/btm_acl.cc
+++ b/stack/btm/btm_acl.cc
@@ -1082,7 +1082,7 @@ void btm_read_remote_features_complete(uint8_t* p) {
10821082 * Returns void
10831083 *
10841084 ******************************************************************************/
1085-void btm_read_remote_ext_features_complete(uint8_t* p, uint8_t evt_len) {
1085+void btm_read_remote_ext_features_complete(uint8_t* p) {
10861086 tACL_CONN* p_acl_cb;
10871087 uint8_t page_num, max_page;
10881088 uint16_t handle;
@@ -1090,14 +1090,6 @@ void btm_read_remote_ext_features_complete(uint8_t* p, uint8_t evt_len) {
10901090
10911091 BTM_TRACE_DEBUG("btm_read_remote_ext_features_complete");
10921092
1093- if (evt_len < HCI_EXT_FEATURES_SUCCESS_EVT_LEN) {
1094- android_errorWriteLog(0x534e4554, "141552859");
1095- BTM_TRACE_ERROR(
1096- "btm_read_remote_ext_features_complete evt length too short. length=%d",
1097- evt_len);
1098- return;
1099- }
1100-
11011093 ++p;
11021094 STREAM_TO_UINT16(handle, p);
11031095 STREAM_TO_UINT8(page_num, p);
@@ -1117,13 +1109,6 @@ void btm_read_remote_ext_features_complete(uint8_t* p, uint8_t evt_len) {
11171109 return;
11181110 }
11191111
1120- if (page_num > max_page) {
1121- android_errorWriteLog(0x534e4554, "141552859");
1122- BTM_TRACE_ERROR("btm_read_remote_ext_features_complete num_page=%d invalid",
1123- page_num);
1124- return;
1125- }
1126-
11271112 p_acl_cb = &btm_cb.acl_db[acl_idx];
11281113
11291114 /* Copy the received features page */
--- a/stack/btm/btm_int.h
+++ b/stack/btm/btm_int.h
@@ -118,7 +118,7 @@ extern uint16_t btm_get_acl_disc_reason_code(void);
118118 extern tBTM_STATUS btm_remove_acl(const RawAddress& bd_addr,
119119 tBT_TRANSPORT transport);
120120 extern void btm_read_remote_features_complete(uint8_t* p);
121-extern void btm_read_remote_ext_features_complete(uint8_t* p, uint8_t evt_len);
121+extern void btm_read_remote_ext_features_complete(uint8_t* p);
122122 extern void btm_read_remote_ext_features_failed(uint8_t status,
123123 uint16_t handle);
124124 extern void btm_read_remote_version_complete(uint8_t* p);
--- a/stack/btu/btu_hcif.cc
+++ b/stack/btu/btu_hcif.cc
@@ -71,8 +71,7 @@ static void btu_hcif_authentication_comp_evt(uint8_t* p);
7171 static void btu_hcif_rmt_name_request_comp_evt(uint8_t* p, uint16_t evt_len);
7272 static void btu_hcif_encryption_change_evt(uint8_t* p);
7373 static void btu_hcif_read_rmt_features_comp_evt(uint8_t* p);
74-static void btu_hcif_read_rmt_ext_features_comp_evt(uint8_t* p,
75- uint8_t evt_len);
74+static void btu_hcif_read_rmt_ext_features_comp_evt(uint8_t* p);
7675 static void btu_hcif_read_rmt_version_comp_evt(uint8_t* p);
7776 static void btu_hcif_qos_setup_comp_evt(uint8_t* p);
7877 static void btu_hcif_command_complete_evt(BT_HDR* response, void* context);
@@ -196,7 +195,7 @@ void btu_hcif_process_event(UNUSED_ATTR uint8_t controller_id, BT_HDR* p_msg) {
196195 btu_hcif_read_rmt_features_comp_evt(p);
197196 break;
198197 case HCI_READ_RMT_EXT_FEATURES_COMP_EVT:
199- btu_hcif_read_rmt_ext_features_comp_evt(p, hci_evt_len);
198+ btu_hcif_read_rmt_ext_features_comp_evt(p);
200199 break;
201200 case HCI_READ_RMT_VERSION_COMP_EVT:
202201 btu_hcif_read_rmt_version_comp_evt(p);
@@ -813,8 +812,7 @@ static void btu_hcif_read_rmt_features_comp_evt(uint8_t* p) {
813812 * Returns void
814813 *
815814 ******************************************************************************/
816-static void btu_hcif_read_rmt_ext_features_comp_evt(uint8_t* p,
817- uint8_t evt_len) {
815+static void btu_hcif_read_rmt_ext_features_comp_evt(uint8_t* p) {
818816 uint8_t* p_cur = p;
819817 uint8_t status;
820818 uint16_t handle;
@@ -822,7 +820,7 @@ static void btu_hcif_read_rmt_ext_features_comp_evt(uint8_t* p,
822820 STREAM_TO_UINT8(status, p_cur);
823821
824822 if (status == HCI_SUCCESS)
825- btm_read_remote_ext_features_complete(p, evt_len);
823+ btm_read_remote_ext_features_complete(p);
826824 else {
827825 STREAM_TO_UINT16(handle, p_cur);
828826 btm_read_remote_ext_features_failed(status, handle);
--- a/stack/include/hcidefs.h
+++ b/stack/include/hcidefs.h
@@ -1322,8 +1322,6 @@ typedef struct {
13221322
13231323 #define HCI_FEATURE_BYTES_PER_PAGE 8
13241324
1325-#define HCI_EXT_FEATURES_SUCCESS_EVT_LEN 13
1326-
13271325 #define HCI_FEATURES_KNOWN(x) \
13281326 (((x)[0] | (x)[1] | (x)[2] | (x)[3] | (x)[4] | (x)[5] | (x)[6] | (x)[7]) != 0)
13291327