• 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ão91f38752fa70188a33f07342d55c08125f1b0f98 (tree)
Hora2019-11-26 12:04:10
AutorAutomerger Merge Worker <android-build-automerger-merge-worker@syst...>
CommiterAutomerger Merge Worker

Mensagem de Log

Merge "Revert "Fix potential OOB write in btm_read_remote_ext_features_complete"" into oc-dev am: aa754ed3ec am: 53afb387a4 am: a651e35ad0

Change-Id: Idf9a04bc8291f8e08ca504c373d77750c1280b74

Mudança Sumário

Diff

--- a/stack/btm/btm_acl.cc
+++ b/stack/btm/btm_acl.cc
@@ -49,7 +49,6 @@
4949 #include "device/include/interop.h"
5050 #include "hcidefs.h"
5151 #include "hcimsgs.h"
52-#include "log/log.h"
5352 #include "l2c_int.h"
5453 #include "osi/include/log.h"
5554 #include "osi/include/osi.h"
@@ -1083,7 +1082,7 @@ void btm_read_remote_features_complete(uint8_t* p) {
10831082 * Returns void
10841083 *
10851084 ******************************************************************************/
1086-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) {
10871086 tACL_CONN* p_acl_cb;
10881087 uint8_t page_num, max_page;
10891088 uint16_t handle;
@@ -1091,14 +1090,6 @@ void btm_read_remote_ext_features_complete(uint8_t* p, uint8_t evt_len) {
10911090
10921091 BTM_TRACE_DEBUG("btm_read_remote_ext_features_complete");
10931092
1094- if (evt_len < HCI_EXT_FEATURES_SUCCESS_EVT_LEN) {
1095- android_errorWriteLog(0x534e4554, "141552859");
1096- BTM_TRACE_ERROR(
1097- "btm_read_remote_ext_features_complete evt length too short. length=%d",
1098- evt_len);
1099- return;
1100- }
1101-
11021093 ++p;
11031094 STREAM_TO_UINT16(handle, p);
11041095 STREAM_TO_UINT8(page_num, p);
@@ -1118,13 +1109,6 @@ void btm_read_remote_ext_features_complete(uint8_t* p, uint8_t evt_len) {
11181109 return;
11191110 }
11201111
1121- if (page_num > max_page) {
1122- android_errorWriteLog(0x534e4554, "141552859");
1123- BTM_TRACE_ERROR("btm_read_remote_ext_features_complete num_page=%d invalid",
1124- page_num);
1125- return;
1126- }
1127-
11281112 p_acl_cb = &btm_cb.acl_db[acl_idx];
11291113
11301114 /* 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