• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #include <thread>
17 
18 #include <securec.h>
19 
20 #include "accesstoken_kit.h"
21 #include "nativetoken_kit.h"
22 #include "token_setproc.h"
23 
24 #include "i_net_policy_service.h"
25 #include "net_mgr_log_wrapper.h"
26 #include "net_policy_client.h"
27 #include "net_policy_constants.h"
28 #include "net_quota_policy.h"
29 #define private public
30 #include "net_policy_service.h"
31 #include "net_policy_service_stub.h"
32 
33 namespace OHOS {
34 namespace NetManagerStandard {
35 namespace {
36 const uint8_t *g_baseFuzzData = nullptr;
37 static constexpr uint32_t CREATE_LIMIT_ACTION_VALUE = 2;
38 static constexpr uint32_t CREATE_NET_TYPE_VALUE = 7;
39 static constexpr uint32_t CONVERT_NUMBER_TO_BOOL = 2;
40 size_t g_baseFuzzSize = 0;
41 size_t g_baseFuzzPos;
42 constexpr size_t STR_LEN = 10;
43 using namespace Security::AccessToken;
44 using Security::AccessToken::AccessTokenID;
45 HapInfoParams testInfoParms1 = {.userID = 1,
46                                 .bundleName = "net_policy_client_fuzzer",
47                                 .instIndex = 0,
48                                 .appIDDesc = "test"};
49 
50 PermissionDef testPermDef1 = {.permissionName = "ohos.permission.CONNECTIVITY_INTERNAL",
51                               .bundleName = "net_policy_client_fuzzer",
52                               .grantMode = 1,
53                               .availableLevel = APL_SYSTEM_BASIC,
54                               .label = "label",
55                               .labelId = 1,
56                               .description = "Test net policy connectivity internal",
57                               .descriptionId = 1};
58 
59 PermissionStateFull testState1 = {.permissionName = "ohos.permission.CONNECTIVITY_INTERNAL",
60                                   .isGeneral = true,
61                                   .resDeviceID = {"local"},
62                                   .grantStatus = {PermissionState::PERMISSION_GRANTED},
63                                   .grantFlags = {2}};
64 
65 HapPolicyParams testPolicyPrams1 = {.apl = APL_SYSTEM_BASIC,
66                                     .domain = "test.domain",
67                                     .permList = {testPermDef1},
68                                     .permStateList = {testState1}};
69 
70 HapInfoParams testInfoParms2 = {.userID = 1,
71                                 .bundleName = "net_policy_client_fuzzer",
72                                 .instIndex = 0,
73                                 .appIDDesc = "test"};
74 
75 PermissionDef testPermDef2 = {.permissionName = "ohos.permission.SET_NETWORK_POLICY",
76                               .bundleName = "net_policy_client_fuzzer",
77                               .grantMode = 1,
78                               .availableLevel = APL_SYSTEM_BASIC,
79                               .label = "label",
80                               .labelId = 1,
81                               .description = "Test net policy connectivity internal",
82                               .descriptionId = 1};
83 
84 PermissionStateFull testState2 = {.permissionName = "ohos.permission.SET_NETWORK_POLICY",
85                                   .isGeneral = true,
86                                   .resDeviceID = {"local"},
87                                   .grantStatus = {PermissionState::PERMISSION_GRANTED},
88                                   .grantFlags = {2}};
89 
90 HapPolicyParams testPolicyPrams2 = {.apl = APL_SYSTEM_BASIC,
91                                     .domain = "test.domain",
92                                     .permList = {testPermDef2},
93                                     .permStateList = {testState2}};
94 
95 HapInfoParams testInfoParms3 = {.userID = 1,
96                                 .bundleName = "net_policy_client_fuzzer",
97                                 .instIndex = 0,
98                                 .appIDDesc = "test"};
99 
100 PermissionDef testPermDef3 = {.permissionName = "ohos.permission.GET_NETWORK_POLICY",
101                               .bundleName = "net_policy_client_fuzzer",
102                               .grantMode = 1,
103                               .availableLevel = APL_SYSTEM_BASIC,
104                               .label = "label",
105                               .labelId = 1,
106                               .description = "Test net policy connectivity internal",
107                               .descriptionId = 1};
108 
109 PermissionStateFull testState3 = {.permissionName = "ohos.permission.GET_NETWORK_POLICY",
110                                   .isGeneral = true,
111                                   .resDeviceID = {"local"},
112                                   .grantStatus = {PermissionState::PERMISSION_GRANTED},
113                                   .grantFlags = {2}};
114 
115 HapPolicyParams testPolicyPrams3 = {.apl = APL_SYSTEM_BASIC,
116                                     .domain = "test.domain",
117                                     .permList = {testPermDef3},
118                                     .permStateList = {testState3}};
119 } // namespace
120 
GetData()121 template <class T> T GetData()
122 {
123     T object{};
124     size_t objectSize = sizeof(object);
125     if (g_baseFuzzData == nullptr || objectSize > g_baseFuzzSize - g_baseFuzzPos) {
126         return object;
127     }
128     errno_t ret = memcpy_s(&object, objectSize, g_baseFuzzData + g_baseFuzzPos, objectSize);
129     if (ret != EOK) {
130         return {};
131     }
132     g_baseFuzzPos += objectSize;
133     return object;
134 }
135 
GetStringFromData(int strlen)136 std::string GetStringFromData(int strlen)
137 {
138     char cstr[strlen];
139     cstr[strlen - 1] = '\0';
140     for (int i = 0; i < strlen - 1; i++) {
141         cstr[i] = GetData<char>();
142     }
143     std::string str(cstr);
144     return str;
145 }
146 
147 class AccessToken {
148 public:
AccessToken(HapInfoParams & testInfoParms,HapPolicyParams & testPolicyPrams)149     AccessToken(HapInfoParams &testInfoParms, HapPolicyParams &testPolicyPrams) : currentID_(GetSelfTokenID())
150     {
151         AccessTokenIDEx tokenIdEx = AccessTokenKit::AllocHapToken(testInfoParms, testPolicyPrams);
152         accessID_ = tokenIdEx.tokenIdExStruct.tokenID;
153         SetSelfTokenID(accessID_);
154     }
~AccessToken()155     ~AccessToken()
156     {
157         AccessTokenKit::DeleteToken(accessID_);
158         SetSelfTokenID(currentID_);
159     }
160 
161 private:
162     AccessTokenID currentID_;
163     AccessTokenID accessID_ = 0;
164 };
165 
166 class INetPolicyCallbackTest : public IRemoteStub<INetPolicyCallback> {
167 public:
NetUidPolicyChange(uint32_t uid,uint32_t policy)168     int32_t NetUidPolicyChange(uint32_t uid, uint32_t policy)
169     {
170         return 0;
171     }
172 
NetUidRuleChange(uint32_t uid,uint32_t rule)173     int32_t NetUidRuleChange(uint32_t uid, uint32_t rule)
174     {
175         return 0;
176     }
177 
NetQuotaPolicyChange(const std::vector<NetQuotaPolicy> & quotaPolicies)178     int32_t NetQuotaPolicyChange(const std::vector<NetQuotaPolicy> &quotaPolicies)
179     {
180         return 0;
181     }
182 
NetStrategySwitch(const std::string & iccid,bool enable)183     int32_t NetStrategySwitch(const std::string &iccid, bool enable)
184     {
185         return 0;
186     }
187 
NetMeteredIfacesChange(std::vector<std::string> & ifaces)188     int32_t NetMeteredIfacesChange(std::vector<std::string> &ifaces)
189     {
190         return 0;
191     }
192 
NetBackgroundPolicyChange(bool isBackgroundPolicyAllow)193     int32_t NetBackgroundPolicyChange(bool isBackgroundPolicyAllow)
194     {
195         return 0;
196     }
197 };
198 
199 static bool g_isInited = false;
200 
Init()201 void Init()
202 {
203     if (!g_isInited) {
204         DelayedSingleton<NetPolicyService>::GetInstance()->Init();
205         g_isInited = true;
206     }
207 }
208 
OnRemoteRequest(uint32_t code,MessageParcel & data)209 int32_t OnRemoteRequest(uint32_t code, MessageParcel &data)
210 {
211     if (!g_isInited) {
212         Init();
213     }
214 
215     MessageParcel reply;
216     MessageOption option;
217 
218     return DelayedSingleton<NetPolicyService>::GetInstance()->OnRemoteRequest(code, data, reply, option);
219 }
220 
WriteInterfaceToken(MessageParcel & data)221 bool WriteInterfaceToken(MessageParcel &data)
222 {
223     if (!data.WriteInterfaceToken(NetPolicyServiceStub::GetDescriptor())) {
224         return false;
225     }
226     return true;
227 }
228 
SetPolicyByUidFuzzTest(const uint8_t * data,size_t size)229 void SetPolicyByUidFuzzTest(const uint8_t *data, size_t size)
230 {
231     if ((data == nullptr) || (size == 0)) {
232         return;
233     }
234     g_baseFuzzData = data;
235     g_baseFuzzSize = size;
236     g_baseFuzzPos = 0;
237 
238     AccessToken token(testInfoParms2, testPolicyPrams2);
239     uint32_t uid = GetData<uint32_t>();
240     uint32_t policy = GetData<uint32_t>() % 3;
241 
242     MessageParcel dataParcel;
243     if (!WriteInterfaceToken(dataParcel)) {
244         return;
245     }
246     dataParcel.WriteUint32(uid);
247     dataParcel.WriteUint32(policy);
248 
249     OnRemoteRequest(INetPolicyService::CMD_NPS_SET_POLICY_BY_UID, dataParcel);
250 }
251 
GetPolicyByUidFuzzTest(const uint8_t * data,size_t size)252 void GetPolicyByUidFuzzTest(const uint8_t *data, size_t size)
253 {
254     if ((data == nullptr) || (size == 0)) {
255         return;
256     }
257     g_baseFuzzData = data;
258     g_baseFuzzSize = size;
259     g_baseFuzzPos = 0;
260     AccessToken token(testInfoParms3, testPolicyPrams3);
261     uint32_t uid = GetData<uint32_t>();
262 
263     MessageParcel dataParcel;
264     if (!WriteInterfaceToken(dataParcel)) {
265         return;
266     }
267     dataParcel.WriteUint32(uid);
268 
269     OnRemoteRequest(INetPolicyService::CMD_NPS_GET_POLICY_BY_UID, dataParcel);
270 }
271 
GetUidsByPolicyFuzzTest(const uint8_t * data,size_t size)272 void GetUidsByPolicyFuzzTest(const uint8_t *data, size_t size)
273 {
274     if ((data == nullptr) || (size == 0)) {
275         return;
276     }
277     AccessToken token(testInfoParms3, testPolicyPrams3);
278 
279     MessageParcel dataParcel;
280     if (!WriteInterfaceToken(dataParcel)) {
281         return;
282     }
283     uint32_t policy = GetData<uint32_t>() % 3;
284     dataParcel.WriteUint32(policy);
285 
286     OnRemoteRequest(INetPolicyService::CMD_NPS_GET_UIDS_BY_POLICY, dataParcel);
287 }
288 
SetBackgroundPolicyFuzzTest(const uint8_t * data,size_t size)289 void SetBackgroundPolicyFuzzTest(const uint8_t *data, size_t size)
290 {
291     if ((data == nullptr) || (size == 0)) {
292         return;
293     }
294     g_baseFuzzData = data;
295     g_baseFuzzSize = size;
296     g_baseFuzzPos = 0;
297 
298     AccessToken token(testInfoParms2, testPolicyPrams2);
299     bool isBackgroundPolicyAllow = GetData<uint32_t>() % CONVERT_NUMBER_TO_BOOL == 0;
300 
301     MessageParcel dataParcel;
302     if (!WriteInterfaceToken(dataParcel)) {
303         return;
304     }
305     dataParcel.WriteBool(isBackgroundPolicyAllow);
306     OnRemoteRequest(INetPolicyService::CMD_NPS_SET_BACKGROUND_POLICY, dataParcel);
307 }
308 
GetBackgroundPolicyByUidFuzzTest(const uint8_t * data,size_t size)309 void GetBackgroundPolicyByUidFuzzTest(const uint8_t *data, size_t size)
310 {
311     if ((data == nullptr) || (size == 0)) {
312         return;
313     }
314     g_baseFuzzData = data;
315     g_baseFuzzSize = size;
316     g_baseFuzzPos = 0;
317     AccessToken token(testInfoParms1, testPolicyPrams1);
318     uint32_t uid = GetData<uint32_t>();
319 
320     MessageParcel dataParcel;
321     if (!WriteInterfaceToken(dataParcel)) {
322         return;
323     }
324     dataParcel.WriteUint32(uid);
325     OnRemoteRequest(INetPolicyService::CMD_NPS_GET_BACKGROUND_POLICY_BY_UID, dataParcel);
326 }
327 
SetCellularPoliciesFuzzTest(const uint8_t * data,size_t size)328 void SetCellularPoliciesFuzzTest(const uint8_t *data, size_t size)
329 {
330     if ((data == nullptr) || (size == 0)) {
331         return;
332     }
333     AccessToken token(testInfoParms2, testPolicyPrams2);
334 
335     uint32_t vectorSize = GetData<uint32_t>() % 21;
336     std::vector<NetQuotaPolicy> quotaPolicies;
337     for (uint32_t i = 0; i < vectorSize; i++) {
338         NetQuotaPolicy netQuotaPolicy;
339         netQuotaPolicy.netType = GetData<uint32_t>() % CREATE_NET_TYPE_VALUE;
340 
341         netQuotaPolicy.iccid = GetStringFromData(STR_LEN);
342         netQuotaPolicy.ident = GetStringFromData(STR_LEN);
343         netQuotaPolicy.periodStartTime = GetData<int64_t>();
344         netQuotaPolicy.periodDuration = GetStringFromData(STR_LEN);
345 
346         netQuotaPolicy.warningBytes = GetData<int64_t>();
347         netQuotaPolicy.limitBytes = GetData<int64_t>();
348         netQuotaPolicy.metered = GetData<uint32_t>() % CONVERT_NUMBER_TO_BOOL == 0;
349         netQuotaPolicy.limitAction = GetData<uint32_t>() % CREATE_LIMIT_ACTION_VALUE == 0;
350 
351         quotaPolicies.push_back(netQuotaPolicy);
352     }
353 
354     MessageParcel dataParcel;
355     if (!WriteInterfaceToken(dataParcel)) {
356         return;
357     }
358 
359     NetQuotaPolicy::Marshalling(dataParcel, quotaPolicies);
360 
361     OnRemoteRequest(INetPolicyService::CMD_NPS_SET_NET_QUOTA_POLICIES, dataParcel);
362 }
363 
RegisterNetPolicyCallbackFuzzTest(const uint8_t * data,size_t size)364 void RegisterNetPolicyCallbackFuzzTest(const uint8_t *data, size_t size)
365 {
366     if ((data == nullptr) || (size == 0)) {
367         return;
368     }
369     AccessToken token(testInfoParms1, testPolicyPrams1);
370     sptr<INetPolicyCallbackTest> callback = new (std::nothrow) INetPolicyCallbackTest();
371     if (callback == nullptr) {
372         return;
373     }
374 
375     MessageParcel dataParcel;
376     if (!WriteInterfaceToken(dataParcel)) {
377         return;
378     }
379 
380     dataParcel.WriteRemoteObject(callback->AsObject().GetRefPtr());
381 
382     OnRemoteRequest(INetPolicyService::CMD_NPS_REGISTER_NET_POLICY_CALLBACK, dataParcel);
383 }
384 
UnregisterNetPolicyCallbackFuzzTest(const uint8_t * data,size_t size)385 void UnregisterNetPolicyCallbackFuzzTest(const uint8_t *data, size_t size)
386 {
387     if ((data == nullptr) || (size == 0)) {
388         return;
389     }
390     AccessToken token(testInfoParms1, testPolicyPrams1);
391     sptr<INetPolicyCallbackTest> callback = new (std::nothrow) INetPolicyCallbackTest();
392     if (callback == nullptr) {
393         return;
394     }
395 
396     MessageParcel dataParcel;
397     if (!WriteInterfaceToken(dataParcel)) {
398         return;
399     }
400 
401     dataParcel.WriteRemoteObject(callback->AsObject().GetRefPtr());
402 
403     OnRemoteRequest(INetPolicyService::CMD_NPS_UNREGISTER_NET_POLICY_CALLBACK, dataParcel);
404 }
405 
GetNetQuotaPoliciesFuzzTest(const uint8_t * data,size_t size)406 void GetNetQuotaPoliciesFuzzTest(const uint8_t *data, size_t size)
407 {
408     if ((data == nullptr) || (size == 0)) {
409         return;
410     }
411     AccessToken token(testInfoParms3, testPolicyPrams3);
412     MessageParcel dataParcel;
413     if (!WriteInterfaceToken(dataParcel)) {
414         return;
415     }
416 
417     OnRemoteRequest(INetPolicyService::CMD_NPS_GET_NET_QUOTA_POLICIES, dataParcel);
418 }
419 
SetNetQuotaPoliciesFuzzTest(const uint8_t * data,size_t size)420 void SetNetQuotaPoliciesFuzzTest(const uint8_t *data, size_t size)
421 {
422     if ((data == nullptr) || (size == 0)) {
423         return;
424     }
425     AccessToken token(testInfoParms2, testPolicyPrams2);
426 
427     uint32_t vectorSize = GetData<uint32_t>() % 21;
428     std::vector<NetQuotaPolicy> quotaPolicies;
429     for (uint32_t i = 0; i < vectorSize; i++) {
430         NetQuotaPolicy netQuotaPolicy;
431         netQuotaPolicy.netType = GetData<uint32_t>() % CREATE_NET_TYPE_VALUE;
432 
433         netQuotaPolicy.iccid = GetStringFromData(STR_LEN);
434         netQuotaPolicy.ident = GetStringFromData(STR_LEN);
435         netQuotaPolicy.periodStartTime = GetData<int64_t>();
436         netQuotaPolicy.periodDuration = GetStringFromData(STR_LEN);
437 
438         netQuotaPolicy.warningBytes = GetData<int64_t>();
439         netQuotaPolicy.limitBytes = GetData<int64_t>();
440         netQuotaPolicy.metered = GetData<uint32_t>() % CONVERT_NUMBER_TO_BOOL == 0;
441         netQuotaPolicy.limitAction = GetData<uint32_t>() % CREATE_LIMIT_ACTION_VALUE == 0;
442 
443         quotaPolicies.push_back(netQuotaPolicy);
444     }
445 
446     MessageParcel dataParcel;
447     if (!WriteInterfaceToken(dataParcel)) {
448         return;
449     }
450     NetQuotaPolicy::Marshalling(dataParcel, quotaPolicies);
451 
452     OnRemoteRequest(INetPolicyService::CMD_NPS_SET_NET_QUOTA_POLICIES, dataParcel);
453 }
454 
IsUidNetAllowedFuzzTest(const uint8_t * data,size_t size)455 void IsUidNetAllowedFuzzTest(const uint8_t *data, size_t size)
456 {
457     if ((data == nullptr) || (size == 0)) {
458         return;
459     }
460     g_baseFuzzData = data;
461     g_baseFuzzSize = size;
462     g_baseFuzzPos = 0;
463     AccessToken token(testInfoParms1, testPolicyPrams1);
464     uint32_t uid = GetData<uint32_t>();
465     bool metered = uid % CONVERT_NUMBER_TO_BOOL == 0;
466     std::string ifaceName = GetStringFromData(STR_LEN);
467 
468     MessageParcel dataParcel;
469     if (!WriteInterfaceToken(dataParcel)) {
470         return;
471     }
472 
473     dataParcel.WriteUint32(uid);
474     dataParcel.WriteBool(metered);
475 
476     OnRemoteRequest(INetPolicyService::CMD_NPS_IS_NET_ALLOWED_BY_METERED, dataParcel);
477 
478     MessageParcel dataParcel2;
479     if (!WriteInterfaceToken(dataParcel2)) {
480         return;
481     }
482 
483     dataParcel2.WriteUint32(uid);
484     dataParcel2.WriteString(ifaceName);
485 
486     OnRemoteRequest(INetPolicyService::CMD_NPS_IS_NET_ALLOWED_BY_IFACE, dataParcel2);
487 }
488 
ResetPoliciesFuzzTest(const uint8_t * data,size_t size)489 void ResetPoliciesFuzzTest(const uint8_t *data, size_t size)
490 {
491     if ((data == nullptr) || (size == 0)) {
492         return;
493     }
494     g_baseFuzzData = data;
495     g_baseFuzzSize = size;
496     g_baseFuzzPos = 0;
497     AccessToken token(testInfoParms2, testPolicyPrams2);
498     std::string iccid = GetStringFromData(STR_LEN);
499 
500     MessageParcel dataParcel;
501     if (!WriteInterfaceToken(dataParcel)) {
502         return;
503     }
504 
505     dataParcel.WriteString(iccid);
506 
507     OnRemoteRequest(INetPolicyService::CMD_NPS_RESET_POLICIES, dataParcel);
508 }
509 
UpdateRemindPolicyFuzzTest(const uint8_t * data,size_t size)510 void UpdateRemindPolicyFuzzTest(const uint8_t *data, size_t size)
511 {
512     if ((data == nullptr) || (size == 0)) {
513         return;
514     }
515     g_baseFuzzData = data;
516     g_baseFuzzSize = size;
517     g_baseFuzzPos = 0;
518 
519     AccessToken token(testInfoParms2, testPolicyPrams2);
520     int32_t netType = GetData<int32_t>();
521     uint32_t remindType = GetData<uint32_t>();
522     std::string iccid = GetStringFromData(STR_LEN);
523 
524     MessageParcel dataParcel;
525     if (!WriteInterfaceToken(dataParcel)) {
526         return;
527     }
528 
529     dataParcel.WriteInt32(netType);
530     dataParcel.WriteString(iccid);
531     dataParcel.WriteUint32(remindType);
532 
533     OnRemoteRequest(INetPolicyService::CMD_NPS_UPDATE_REMIND_POLICY, dataParcel);
534 }
535 
SetDeviceIdleAllowedListFuzzTest(const uint8_t * data,size_t size)536 void SetDeviceIdleAllowedListFuzzTest(const uint8_t *data, size_t size)
537 {
538     if ((data == nullptr) || (size == 0)) {
539         return;
540     }
541     g_baseFuzzData = data;
542     g_baseFuzzSize = size;
543     g_baseFuzzPos = 0;
544 
545     AccessToken token(testInfoParms1, testPolicyPrams1);
546     bool isAllowed = GetData<int32_t>() % CONVERT_NUMBER_TO_BOOL == 0;
547     uint32_t uid = GetData<uint32_t>();
548 
549     MessageParcel dataParcel;
550     if (!WriteInterfaceToken(dataParcel)) {
551         return;
552     }
553 
554     dataParcel.WriteUint32(uid);
555     dataParcel.WriteBool(isAllowed);
556 
557     OnRemoteRequest(INetPolicyService::CMD_NPS_SET_IDLE_ALLOWED_LIST, dataParcel);
558 }
559 
SetDeviceIdlePolicyFuzzTest(const uint8_t * data,size_t size)560 void SetDeviceIdlePolicyFuzzTest(const uint8_t *data, size_t size)
561 {
562     if ((data == nullptr) || (size == 0)) {
563         return;
564     }
565     g_baseFuzzData = data;
566     g_baseFuzzSize = size;
567     g_baseFuzzPos = 0;
568 
569     AccessToken token(testInfoParms1, testPolicyPrams1);
570     bool enable = GetData<int32_t>() % CONVERT_NUMBER_TO_BOOL == 0;
571 
572     MessageParcel dataParcel;
573     if (!WriteInterfaceToken(dataParcel)) {
574         return;
575     }
576 
577     dataParcel.WriteBool(enable);
578 
579     OnRemoteRequest(INetPolicyService::CMD_NPS_SET_DEVICE_IDLE_POLICY, dataParcel);
580 }
581 } // namespace NetManagerStandard
582 } // namespace OHOS
583 
LLVMFuzzerTestOneInput(const uint8_t * data,size_t size)584 extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
585 {
586     /* Run your code on data */
587     OHOS::NetManagerStandard::SetPolicyByUidFuzzTest(data, size);
588     OHOS::NetManagerStandard::GetPolicyByUidFuzzTest(data, size);
589     OHOS::NetManagerStandard::GetUidsByPolicyFuzzTest(data, size);
590     OHOS::NetManagerStandard::GetBackgroundPolicyByUidFuzzTest(data, size);
591     OHOS::NetManagerStandard::SetCellularPoliciesFuzzTest(data, size);
592     OHOS::NetManagerStandard::RegisterNetPolicyCallbackFuzzTest(data, size);
593     OHOS::NetManagerStandard::GetNetQuotaPoliciesFuzzTest(data, size);
594     OHOS::NetManagerStandard::SetNetQuotaPoliciesFuzzTest(data, size);
595     OHOS::NetManagerStandard::IsUidNetAllowedFuzzTest(data, size);
596     OHOS::NetManagerStandard::ResetPoliciesFuzzTest(data, size);
597     OHOS::NetManagerStandard::UpdateRemindPolicyFuzzTest(data, size);
598     OHOS::NetManagerStandard::SetDeviceIdleAllowedListFuzzTest(data, size);
599     OHOS::NetManagerStandard::SetDeviceIdlePolicyFuzzTest(data, size);
600     OHOS::NetManagerStandard::UnregisterNetPolicyCallbackFuzzTest(data, size);
601     return 0;
602 }
603