mirror of
https://gitee.com/openharmony/communication_wifi.git
synced 2025-03-07 08:30:18 +00:00
放开wifi对CFI的屏蔽
Signed-off-by: hxyang111111 <yanghuaxia2@h-partners.com>
This commit is contained in:
parent
cc3bf3187d
commit
adb029a414
@ -75,6 +75,12 @@ if (defined(ohos_lite)) {
|
||||
ohos_static_library("rpc_server") {
|
||||
branch_protector_ret = "pac_ret"
|
||||
|
||||
sanitize = {
|
||||
cfi = true
|
||||
boundary_sanitize = true
|
||||
cfi_cross_dso = true
|
||||
debug = false
|
||||
}
|
||||
sources = crpc_server_sources
|
||||
|
||||
include_dirs = [ "include" ]
|
||||
@ -91,6 +97,12 @@ if (defined(ohos_lite)) {
|
||||
ohos_static_library("rpc_client") {
|
||||
branch_protector_ret = "pac_ret"
|
||||
|
||||
sanitize = {
|
||||
cfi = true
|
||||
boundary_sanitize = true
|
||||
cfi_cross_dso = true
|
||||
debug = false
|
||||
}
|
||||
sources = crpc_client_sources
|
||||
include_dirs = [
|
||||
"include",
|
||||
|
@ -22,7 +22,6 @@ ohos_shared_library("wifi") {
|
||||
boundary_sanitize = true
|
||||
cfi_cross_dso = true
|
||||
debug = false
|
||||
blocklist = "../../wifi_frameworks_sdk_block.txt"
|
||||
}
|
||||
install_enable = true
|
||||
include_dirs = [
|
||||
@ -82,7 +81,6 @@ ohos_shared_library("wifiext") {
|
||||
boundary_sanitize = true
|
||||
cfi_cross_dso = true
|
||||
debug = false
|
||||
blocklist = "../../wifi_frameworks_sdk_block.txt"
|
||||
}
|
||||
install_enable = true
|
||||
include_dirs = [
|
||||
@ -136,7 +134,6 @@ ohos_shared_library("wifi_native_js") {
|
||||
boundary_sanitize = true
|
||||
cfi_cross_dso = true
|
||||
debug = false
|
||||
blocklist = "../../wifi_frameworks_sdk_block.txt"
|
||||
}
|
||||
install_enable = true
|
||||
include_dirs = [
|
||||
@ -196,7 +193,6 @@ ohos_shared_library("wifimanager") {
|
||||
boundary_sanitize = true
|
||||
cfi_cross_dso = true
|
||||
debug = false
|
||||
blocklist = "../../wifi_frameworks_sdk_block.txt"
|
||||
}
|
||||
install_enable = true
|
||||
include_dirs = [
|
||||
@ -253,7 +249,6 @@ ohos_shared_library("wifimanagerext") {
|
||||
boundary_sanitize = true
|
||||
cfi_cross_dso = true
|
||||
debug = false
|
||||
blocklist = "../../wifi_frameworks_sdk_block.txt"
|
||||
}
|
||||
install_enable = true
|
||||
include_dirs = [
|
||||
|
@ -113,6 +113,12 @@ if (defined(ohos_lite)) {
|
||||
ohos_source_set("wifi_device_proxy_impl") {
|
||||
branch_protector_ret = "pac_ret"
|
||||
|
||||
sanitize = {
|
||||
cfi = true
|
||||
boundary_sanitize = true
|
||||
cfi_cross_dso = true
|
||||
debug = false
|
||||
}
|
||||
part_name = "wifi"
|
||||
sources = [
|
||||
"src/wifi_device_impl.cpp",
|
||||
@ -136,6 +142,12 @@ if (defined(ohos_lite)) {
|
||||
ohos_source_set("wifi_hotspot_proxy_impl") {
|
||||
branch_protector_ret = "pac_ret"
|
||||
|
||||
sanitize = {
|
||||
cfi = true
|
||||
boundary_sanitize = true
|
||||
cfi_cross_dso = true
|
||||
debug = false
|
||||
}
|
||||
part_name = "wifi"
|
||||
sources = [
|
||||
"src/wifi_hotspot_impl.cpp",
|
||||
@ -159,6 +171,12 @@ if (defined(ohos_lite)) {
|
||||
ohos_source_set("wifi_scan_proxy_impl") {
|
||||
branch_protector_ret = "pac_ret"
|
||||
|
||||
sanitize = {
|
||||
cfi = true
|
||||
boundary_sanitize = true
|
||||
cfi_cross_dso = true
|
||||
debug = false
|
||||
}
|
||||
part_name = "wifi"
|
||||
sources = [
|
||||
"src/wifi_scan_impl.cpp",
|
||||
@ -182,6 +200,12 @@ if (defined(ohos_lite)) {
|
||||
ohos_source_set("wifi_p2p_proxy_impl") {
|
||||
branch_protector_ret = "pac_ret"
|
||||
|
||||
sanitize = {
|
||||
cfi = true
|
||||
boundary_sanitize = true
|
||||
cfi_cross_dso = true
|
||||
debug = false
|
||||
}
|
||||
part_name = "wifi"
|
||||
sources = [
|
||||
"src/wifi_p2p_impl.cpp",
|
||||
@ -209,7 +233,6 @@ if (defined(ohos_lite)) {
|
||||
boundary_sanitize = true
|
||||
cfi_cross_dso = true
|
||||
debug = false
|
||||
blocklist = "../wifi_frameworks_sdk_block.txt"
|
||||
}
|
||||
install_enable = true
|
||||
sources = [
|
||||
|
@ -417,7 +417,7 @@ EventManager& EventManager::GetInstance()
|
||||
return g_eventManger;
|
||||
}
|
||||
|
||||
void EventManager::Init()
|
||||
NO_SANITIZE("cfi") void EventManager::Init()
|
||||
{
|
||||
if (mSaStatusListener == nullptr) {
|
||||
int32_t ret;
|
||||
|
@ -78,6 +78,12 @@ if (defined(ohos_lite)) {
|
||||
ohos_static_library("crpc_server") {
|
||||
branch_protector_ret = "pac_ret"
|
||||
|
||||
sanitize = {
|
||||
cfi = true
|
||||
boundary_sanitize = true
|
||||
cfi_cross_dso = true
|
||||
debug = false
|
||||
}
|
||||
sources = crpc_server_sources
|
||||
|
||||
include_dirs = [
|
||||
@ -98,6 +104,12 @@ if (defined(ohos_lite)) {
|
||||
ohos_static_library("crpc_client") {
|
||||
branch_protector_ret = "pac_ret"
|
||||
|
||||
sanitize = {
|
||||
cfi = true
|
||||
boundary_sanitize = true
|
||||
cfi_cross_dso = true
|
||||
debug = false
|
||||
}
|
||||
sources = crpc_client_sources
|
||||
include_dirs = [
|
||||
"include",
|
||||
@ -118,6 +130,12 @@ if (defined(ohos_lite)) {
|
||||
ohos_shared_library("crpc_client_updater") {
|
||||
branch_protector_ret = "pac_ret"
|
||||
|
||||
sanitize = {
|
||||
cfi = true
|
||||
boundary_sanitize = true
|
||||
cfi_cross_dso = true
|
||||
debug = false
|
||||
}
|
||||
install_enable = true
|
||||
sources = [ "./src/client_updater.c" ]
|
||||
include_dirs = [ "include" ]
|
||||
|
@ -233,6 +233,12 @@ if (defined(ohos_lite)) {
|
||||
ohos_source_set("wifi_scan_service_impl") {
|
||||
branch_protector_ret = "pac_ret"
|
||||
|
||||
sanitize = {
|
||||
cfi = true
|
||||
boundary_sanitize = true
|
||||
cfi_cross_dso = true
|
||||
debug = false
|
||||
}
|
||||
part_name = "wifi"
|
||||
sources = [
|
||||
"$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_scan_sa/wifi_scan_callback_proxy.cpp",
|
||||
@ -273,6 +279,12 @@ if (defined(ohos_lite)) {
|
||||
ohos_source_set("wifi_device_service_impl") {
|
||||
branch_protector_ret = "pac_ret"
|
||||
|
||||
sanitize = {
|
||||
cfi = true
|
||||
boundary_sanitize = true
|
||||
cfi_cross_dso = true
|
||||
debug = false
|
||||
}
|
||||
part_name = "wifi"
|
||||
sources = [
|
||||
"$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_sta_sa/wifi_device_callback_proxy.cpp",
|
||||
@ -334,6 +346,12 @@ if (defined(ohos_lite)) {
|
||||
ohos_source_set("wifi_hotspot_service_impl") {
|
||||
branch_protector_ret = "pac_ret"
|
||||
|
||||
sanitize = {
|
||||
cfi = true
|
||||
boundary_sanitize = true
|
||||
cfi_cross_dso = true
|
||||
debug = false
|
||||
}
|
||||
part_name = "wifi"
|
||||
sources = [
|
||||
"$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_ap_sa/wifi_hotspot_callback_proxy.cpp",
|
||||
@ -384,6 +402,12 @@ if (defined(ohos_lite)) {
|
||||
ohos_source_set("wifi_p2p_service_impl") {
|
||||
branch_protector_ret = "pac_ret"
|
||||
|
||||
sanitize = {
|
||||
cfi = true
|
||||
boundary_sanitize = true
|
||||
cfi_cross_dso = true
|
||||
debug = false
|
||||
}
|
||||
part_name = "wifi"
|
||||
sources = [
|
||||
"$WIFI_ROOT_DIR/frameworks/native/src/wifi_hid2d_msg.cpp",
|
||||
|
@ -71,7 +71,7 @@ void Handler::StopHandlerThread()
|
||||
return;
|
||||
}
|
||||
|
||||
void *Handler::RunHandleThreadFunc(void *pInstance)
|
||||
void *Handler::RunHandleThreadFunc(void *pInstance) __attribute__((no_sanitize("cfi")))
|
||||
{
|
||||
if (pInstance == nullptr) {
|
||||
LOGE("pInstance is null.\n");
|
||||
|
@ -119,7 +119,7 @@ WifiInternalEventDispatcher::WifiInternalEventDispatcher() : mRunFlag(true)
|
||||
WifiInternalEventDispatcher::~WifiInternalEventDispatcher()
|
||||
{}
|
||||
|
||||
int WifiInternalEventDispatcher::Init()
|
||||
NO_SANITIZE("cfi") int WifiInternalEventDispatcher::Init()
|
||||
{
|
||||
/* first init system notify service client here ! */
|
||||
|
||||
|
@ -143,6 +143,12 @@ if (defined(ohos_lite)) {
|
||||
ohos_source_set("wifi_utils") {
|
||||
branch_protector_ret = "pac_ret"
|
||||
|
||||
sanitize = {
|
||||
cfi = true
|
||||
boundary_sanitize = true
|
||||
cfi_cross_dso = true
|
||||
debug = false
|
||||
}
|
||||
part_name = "wifi"
|
||||
sources = []
|
||||
|
||||
|
@ -96,7 +96,7 @@ void StandByListerner::RegisterStandByEvent()
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(standByEventMutex);
|
||||
if (isStandBySubscribered) {
|
||||
WIFI_LOGI("isStandBySubscribered is true!");
|
||||
WIFI_LOGI("isStandBySubscribered is true");
|
||||
return;
|
||||
}
|
||||
OHOS::EventFwk::MatchingSkills matchingSkills;
|
||||
@ -116,7 +116,7 @@ void StandByListerner::UnRegisterStandByEvent()
|
||||
WIFI_LOGI("UnRegisterStandByEvent enter");
|
||||
std::unique_lock<std::mutex> lock(standByEventMutex);
|
||||
if (!isStandBySubscribered) {
|
||||
WIFI_LOGI("isStandBySubscribered is false!");
|
||||
WIFI_LOGI("isStandBySubscribered is false");
|
||||
return;
|
||||
}
|
||||
if (!EventFwk::CommonEventManager::UnSubscribeCommonEvent(standBySubscriber_)) {
|
||||
|
@ -81,17 +81,17 @@ WifiEventSubscriberManager::WifiEventSubscriberManager()
|
||||
WifiTimer::GetInstance()->Register(timeoutCallback, locationTimerId, TIMEOUT_EVENT_SUBSCRIBER, false);
|
||||
WIFI_LOGI("RegisterLocationEvent success! locationTimerId:%{public}u", locationTimerId);
|
||||
}
|
||||
if (batterySubscriber_ == nullptr && batteryTimerId == 0) {
|
||||
if (!isBatterySubscribered && batteryTimerId == 0) {
|
||||
WifiTimer::TimerCallback timeoutCallback = std::bind(&WifiEventSubscriberManager::RegisterBatteryEvent, this);
|
||||
WifiTimer::GetInstance()->Register(timeoutCallback, batteryTimerId, TIMEOUT_EVENT_SUBSCRIBER, false);
|
||||
WIFI_LOGI("RegisterBatteryEvent success! locationTimerId:%{public}u", batteryTimerId);
|
||||
}
|
||||
if (eventSubscriber_ == nullptr && appEventTimerId == 0) {
|
||||
if (!isEventSubscribered && appEventTimerId == 0) {
|
||||
WifiTimer::TimerCallback timeoutCallback = std::bind(&WifiEventSubscriberManager::RegisterAppRemoved, this);
|
||||
WifiTimer::GetInstance()->Register(timeoutCallback, appEventTimerId, TIMEOUT_EVENT_SUBSCRIBER, false);
|
||||
}
|
||||
|
||||
if (thermalLevelSubscriber_ == nullptr && thermalTimerId == 0) {
|
||||
if (!isThermalLevelSubscribered && thermalTimerId == 0) {
|
||||
WifiTimer::TimerCallback timeoutCallback = std::bind(&WifiEventSubscriberManager::RegisterThermalLevel, this);
|
||||
WifiTimer::GetInstance()->Register(timeoutCallback, thermalTimerId, TIMEOUT_EVENT_SUBSCRIBER, false);
|
||||
}
|
||||
@ -127,13 +127,13 @@ WifiEventSubscriberManager::~WifiEventSubscriberManager()
|
||||
if (deviceProvisionObserver_) {
|
||||
UnRegisterDeviceProvisionEvent();
|
||||
}
|
||||
if (batterySubscriber_) {
|
||||
if (isBatterySubscribered) {
|
||||
UnRegisterBatteryEvent();
|
||||
}
|
||||
if (eventSubscriber_) {
|
||||
if (isEventSubscribered) {
|
||||
UnRegisterAppRemoved();
|
||||
}
|
||||
if (thermalLevelSubscriber_) {
|
||||
if (isThermalLevelSubscribered) {
|
||||
UnRegisterThermalLevel();
|
||||
}
|
||||
#ifdef HAS_POWERMGR_PART
|
||||
@ -490,7 +490,7 @@ void WifiEventSubscriberManager::UnRegisterDeviceProvisionEvent()
|
||||
void WifiEventSubscriberManager::RegisterBatteryEvent()
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(batteryEventMutex);
|
||||
if (batterySubscriber_) {
|
||||
if (isBatterySubscribered) {
|
||||
return;
|
||||
}
|
||||
OHOS::EventFwk::MatchingSkills matchingSkills;
|
||||
@ -502,6 +502,7 @@ void WifiEventSubscriberManager::RegisterBatteryEvent()
|
||||
WIFI_LOGE("BatteryEvent SubscribeCommonEvent() failed");
|
||||
} else {
|
||||
WIFI_LOGI("BatteryEvent SubscribeCommonEvent() OK");
|
||||
isBatterySubscribered = true;
|
||||
WifiTimer::GetInstance()->UnRegister(batteryTimerId);
|
||||
}
|
||||
}
|
||||
@ -509,12 +510,13 @@ void WifiEventSubscriberManager::RegisterBatteryEvent()
|
||||
void WifiEventSubscriberManager::UnRegisterBatteryEvent()
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(batteryEventMutex);
|
||||
if (!batterySubscriber_) {
|
||||
if (!isBatterySubscribered) {
|
||||
return;
|
||||
}
|
||||
if (!EventFwk::CommonEventManager::UnSubscribeCommonEvent(batterySubscriber_)) {
|
||||
WIFI_LOGE("BatteryEvent UnSubscribeCommonEvent() failed");
|
||||
} else {
|
||||
isBatterySubscribered = false;
|
||||
WIFI_LOGI("BatteryEvent UnSubscribeCommonEvent() OK");
|
||||
}
|
||||
}
|
||||
@ -651,7 +653,7 @@ void WifiEventSubscriberManager::UnRegisterPowerStateListener()
|
||||
void WifiEventSubscriberManager::RegisterAppRemoved()
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(appEventMutex);
|
||||
if (eventSubscriber_) {
|
||||
if (isEventSubscribered) {
|
||||
return;
|
||||
}
|
||||
OHOS::EventFwk::MatchingSkills matchingSkills;
|
||||
@ -662,6 +664,7 @@ void WifiEventSubscriberManager::RegisterAppRemoved()
|
||||
WIFI_LOGE("AppEvent SubscribeCommonEvent() failed");
|
||||
} else {
|
||||
WIFI_LOGI("AppEvent SubscribeCommonEvent() OK");
|
||||
isEventSubscribered = true;
|
||||
WifiTimer::GetInstance()->UnRegister(appEventTimerId);
|
||||
}
|
||||
}
|
||||
@ -669,12 +672,13 @@ void WifiEventSubscriberManager::RegisterAppRemoved()
|
||||
void WifiEventSubscriberManager::UnRegisterAppRemoved()
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(appEventMutex);
|
||||
if (!eventSubscriber_) {
|
||||
if (!isEventSubscribered) {
|
||||
return;
|
||||
}
|
||||
if (!EventFwk::CommonEventManager::UnSubscribeCommonEvent(eventSubscriber_)) {
|
||||
WIFI_LOGE("AppEvent UnSubscribeCommonEvent() failed");
|
||||
} else {
|
||||
isEventSubscribered = false;
|
||||
WIFI_LOGI("AppEvent UnSubscribeCommonEvent() OK");
|
||||
}
|
||||
}
|
||||
@ -682,7 +686,7 @@ void WifiEventSubscriberManager::UnRegisterAppRemoved()
|
||||
void WifiEventSubscriberManager::RegisterThermalLevel()
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(thermalEventMutex);
|
||||
if (thermalLevelSubscriber_) {
|
||||
if (isThermalLevelSubscribered) {
|
||||
return;
|
||||
}
|
||||
OHOS::EventFwk::MatchingSkills matchingSkills;
|
||||
@ -693,6 +697,7 @@ void WifiEventSubscriberManager::RegisterThermalLevel()
|
||||
WIFI_LOGE("THERMAL_LEVEL_CHANGED SubscribeCommonEvent() failed");
|
||||
} else {
|
||||
WIFI_LOGI("THERMAL_LEVEL_CHANGED SubscribeCommonEvent() OK");
|
||||
isThermalLevelSubscribered = true;
|
||||
WifiTimer::GetInstance()->UnRegister(thermalTimerId);
|
||||
}
|
||||
}
|
||||
@ -700,12 +705,13 @@ void WifiEventSubscriberManager::RegisterThermalLevel()
|
||||
void WifiEventSubscriberManager::UnRegisterThermalLevel()
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(thermalEventMutex);
|
||||
if (!thermalLevelSubscriber_) {
|
||||
if (!isThermalLevelSubscribered) {
|
||||
return;
|
||||
}
|
||||
if (!EventFwk::CommonEventManager::UnSubscribeCommonEvent(thermalLevelSubscriber_)) {
|
||||
WIFI_LOGE("THERMAL_LEVEL_CHANGED UnSubscribeCommonEvent() failed");
|
||||
} else {
|
||||
isThermalLevelSubscribered = false;
|
||||
WIFI_LOGI("THERMAL_LEVEL_CHANGED UnSubscribeCommonEvent() OK");
|
||||
}
|
||||
}
|
||||
|
@ -124,6 +124,7 @@ private:
|
||||
std::shared_ptr<AirplaneModeEventSubscriber> airplaneModeEventSubscriber_ = nullptr;
|
||||
uint32_t batteryTimerId{0};
|
||||
std::shared_ptr<BatteryEventSubscriber> batterySubscriber_ = nullptr;
|
||||
bool isBatterySubscribered = false;
|
||||
uint32_t locationTimerId{0};
|
||||
uint32_t migrateTimerId{0};
|
||||
static bool mIsMdmForbidden;
|
||||
@ -131,8 +132,10 @@ private:
|
||||
bool islocationModeObservered = false;
|
||||
uint32_t appEventTimerId{0};
|
||||
std::shared_ptr<AppEventSubscriber> eventSubscriber_ = nullptr;
|
||||
bool isEventSubscribered = false;
|
||||
uint32_t thermalTimerId{0};
|
||||
std::shared_ptr<ThermalLevelSubscriber> thermalLevelSubscriber_ = nullptr;
|
||||
bool isThermalLevelSubscribered = false;
|
||||
};
|
||||
|
||||
} // namespace Wifi
|
||||
|
@ -97,6 +97,12 @@ if (defined(ohos_lite)) {
|
||||
ohos_executable("wifi_hal_service") {
|
||||
branch_protector_ret = "pac_ret"
|
||||
|
||||
sanitize = {
|
||||
cfi = true
|
||||
boundary_sanitize = true
|
||||
cfi_cross_dso = true
|
||||
debug = false
|
||||
}
|
||||
install_enable = true
|
||||
sources = local_base_sources
|
||||
|
||||
@ -153,6 +159,12 @@ if (defined(ohos_lite)) {
|
||||
ohos_executable("wifi_hal_service_updater") {
|
||||
branch_protector_ret = "pac_ret"
|
||||
|
||||
sanitize = {
|
||||
cfi = true
|
||||
boundary_sanitize = true
|
||||
cfi_cross_dso = true
|
||||
debug = false
|
||||
}
|
||||
install_enable = true
|
||||
sources = local_base_sources
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user