• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

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

system/bt


Commit MetaInfo

Revision7f4f039eacd819e74746258252233b4fe0c18c4b (tree)
Zeit2020-02-11 11:03:14
AutorChih-Wei Huang <cwhuang@linu...>
CommiterChih-Wei Huang

Log Message

Android 9.0.0 Release 53 (6107734)
-----BEGIN PGP SIGNATURE-----

iF0EABECAB0WIQRDQNE1cO+UXoOBCWTorT+BmrEOeAUCXji5JAAKCRDorT+BmrEO
eJboAKCSe9P52YLnIX6VnMmDDDsqg903CACffCK0Mg8A9OqfA8/j+eSXd1PLC1k=
=XSWP
-----END PGP SIGNATURE-----

Merge tag 'android-9.0.0_r53' into pie-x86

Android 9.0.0 Release 53 (6107734)

Ändern Zusammenfassung

Diff

--- a/hci/src/packet_fragmenter.cc
+++ b/hci/src/packet_fragmenter.cc
@@ -216,7 +216,8 @@ static void reassemble_and_dispatch(UNUSED_ATTR BT_HDR* packet) {
216216 "%s got packet which would exceed expected length of %d. "
217217 "Truncating.",
218218 __func__, partial_packet->len);
219- packet->len = partial_packet->len - partial_packet->offset;
219+ packet->len =
220+ (partial_packet->len - partial_packet->offset) + packet->offset;
220221 projected_offset = partial_packet->len;
221222 }
222223
--- a/stack/btm/btm_acl.cc
+++ b/stack/btm/btm_acl.cc
@@ -1089,7 +1089,7 @@ void btm_read_remote_features_complete(uint8_t* p) {
10891089 * Returns void
10901090 *
10911091 ******************************************************************************/
1092-void btm_read_remote_ext_features_complete(uint8_t* p) {
1092+void btm_read_remote_ext_features_complete(uint8_t* p, uint8_t evt_len) {
10931093 tACL_CONN* p_acl_cb;
10941094 uint8_t page_num, max_page;
10951095 uint16_t handle;
@@ -1097,6 +1097,14 @@ void btm_read_remote_ext_features_complete(uint8_t* p) {
10971097
10981098 BTM_TRACE_DEBUG("btm_read_remote_ext_features_complete");
10991099
1100+ if (evt_len < HCI_EXT_FEATURES_SUCCESS_EVT_LEN) {
1101+ android_errorWriteLog(0x534e4554, "141552859");
1102+ BTM_TRACE_ERROR(
1103+ "btm_read_remote_ext_features_complete evt length too short. length=%d",
1104+ evt_len);
1105+ return;
1106+ }
1107+
11001108 ++p;
11011109 STREAM_TO_UINT16(handle, p);
11021110 STREAM_TO_UINT8(page_num, p);
@@ -1116,6 +1124,19 @@ void btm_read_remote_ext_features_complete(uint8_t* p) {
11161124 return;
11171125 }
11181126
1127+ if (page_num > HCI_EXT_FEATURES_PAGE_MAX) {
1128+ android_errorWriteLog(0x534e4554, "141552859");
1129+ BTM_TRACE_ERROR("btm_read_remote_ext_features_complete num_page=%d invalid",
1130+ page_num);
1131+ return;
1132+ }
1133+
1134+ if (page_num > max_page) {
1135+ BTM_TRACE_WARNING(
1136+ "btm_read_remote_ext_features_complete num_page=%d, max_page=%d "
1137+ "invalid", page_num, max_page);
1138+ }
1139+
11191140 p_acl_cb = &btm_cb.acl_db[acl_idx];
11201141
11211142 /* 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);
121+extern void btm_read_remote_ext_features_complete(uint8_t* p, uint8_t evt_len);
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,7 +71,8 @@ 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);
74+static void btu_hcif_read_rmt_ext_features_comp_evt(uint8_t* p,
75+ uint8_t evt_len);
7576 static void btu_hcif_read_rmt_version_comp_evt(uint8_t* p);
7677 static void btu_hcif_qos_setup_comp_evt(uint8_t* p);
7778 static void btu_hcif_command_complete_evt(BT_HDR* response, void* context);
@@ -195,7 +196,7 @@ void btu_hcif_process_event(UNUSED_ATTR uint8_t controller_id, BT_HDR* p_msg) {
195196 btu_hcif_read_rmt_features_comp_evt(p);
196197 break;
197198 case HCI_READ_RMT_EXT_FEATURES_COMP_EVT:
198- btu_hcif_read_rmt_ext_features_comp_evt(p);
199+ btu_hcif_read_rmt_ext_features_comp_evt(p, hci_evt_len);
199200 break;
200201 case HCI_READ_RMT_VERSION_COMP_EVT:
201202 btu_hcif_read_rmt_version_comp_evt(p);
@@ -812,7 +813,8 @@ static void btu_hcif_read_rmt_features_comp_evt(uint8_t* p) {
812813 * Returns void
813814 *
814815 ******************************************************************************/
815-static void btu_hcif_read_rmt_ext_features_comp_evt(uint8_t* p) {
816+static void btu_hcif_read_rmt_ext_features_comp_evt(uint8_t* p,
817+ uint8_t evt_len) {
816818 uint8_t* p_cur = p;
817819 uint8_t status;
818820 uint16_t handle;
@@ -820,7 +822,7 @@ static void btu_hcif_read_rmt_ext_features_comp_evt(uint8_t* p) {
820822 STREAM_TO_UINT8(status, p_cur);
821823
822824 if (status == HCI_SUCCESS)
823- btm_read_remote_ext_features_complete(p);
825+ btm_read_remote_ext_features_complete(p, evt_len);
824826 else {
825827 STREAM_TO_UINT16(handle, p_cur);
826828 btm_read_remote_ext_features_failed(status, handle);
--- a/stack/include/hcidefs.h
+++ b/stack/include/hcidefs.h
@@ -1322,6 +1322,8 @@ typedef struct {
13221322
13231323 #define HCI_FEATURE_BYTES_PER_PAGE 8
13241324
1325+#define HCI_EXT_FEATURES_SUCCESS_EVT_LEN 13
1326+
13251327 #define HCI_FEATURES_KNOWN(x) \
13261328 (((x)[0] | (x)[1] | (x)[2] | (x)[3] | (x)[4] | (x)[5] | (x)[6] | (x)[7]) != 0)
13271329
--- a/stack/sdp/sdp_discovery.cc
+++ b/stack/sdp/sdp_discovery.cc
@@ -474,6 +474,7 @@ static void process_service_attr_rsp(tCONN_CB* p_ccb, uint8_t* p_reply,
474474 if (!sdp_copy_raw_data(p_ccb, false)) {
475475 SDP_TRACE_ERROR("sdp_copy_raw_data failed");
476476 sdp_disconnect(p_ccb, SDP_ILLEGAL_PARAMETER);
477+ return;
477478 }
478479
479480 #endif
@@ -703,6 +704,7 @@ static void process_service_search_attr_rsp(tCONN_CB* p_ccb, uint8_t* p_reply,
703704 if (!sdp_copy_raw_data(p_ccb, true)) {
704705 SDP_TRACE_ERROR("sdp_copy_raw_data failed");
705706 sdp_disconnect(p_ccb, SDP_ILLEGAL_PARAMETER);
707+ return;
706708 }
707709 #endif
708710