1d9f0492fSopenharmony_ci# Copyright (c) 2023 Huawei Device Co., Ltd. 2d9f0492fSopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License"); 3d9f0492fSopenharmony_ci# you may not use this file except in compliance with the License. 4d9f0492fSopenharmony_ci# You may obtain a copy of the License at 5d9f0492fSopenharmony_ci# 6d9f0492fSopenharmony_ci# http://www.apache.org/licenses/LICENSE-2.0 7d9f0492fSopenharmony_ci# 8d9f0492fSopenharmony_ci# Unless required by applicable law or agreed to in writing, software 9d9f0492fSopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS, 10d9f0492fSopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11d9f0492fSopenharmony_ci# See the License for the specific language governing permissions and 12d9f0492fSopenharmony_ci# limitations under the License. 13d9f0492fSopenharmony_ci 14d9f0492fSopenharmony_ci# For now, it supports architechture of ['arm', 'arm64', 'riscv64']. 15d9f0492fSopenharmony_ci 16d9f0492fSopenharmony_ci@returnValue 17d9f0492fSopenharmony_ciTRAP 18d9f0492fSopenharmony_ci 19d9f0492fSopenharmony_ci@headFiles 20d9f0492fSopenharmony_ci<linux/sched.h> 21d9f0492fSopenharmony_ci<stdint.h> 22d9f0492fSopenharmony_ci 23d9f0492fSopenharmony_ci@priority 24d9f0492fSopenharmony_ciioctl;all 25d9f0492fSopenharmony_cifutex;all 26d9f0492fSopenharmony_ci 27d9f0492fSopenharmony_ci@allowList 28d9f0492fSopenharmony_ciio_setup;all 29d9f0492fSopenharmony_ciio_destroy;all 30d9f0492fSopenharmony_ciio_submit;all 31d9f0492fSopenharmony_ciio_cancel;all 32d9f0492fSopenharmony_ciio_getevents;all 33d9f0492fSopenharmony_cisetxattr;all 34d9f0492fSopenharmony_cilsetxattr;all 35d9f0492fSopenharmony_cifsetxattr;all 36d9f0492fSopenharmony_cigetxattr;all 37d9f0492fSopenharmony_cilgetxattr;all 38d9f0492fSopenharmony_cifgetxattr;all 39d9f0492fSopenharmony_cilistxattr;all 40d9f0492fSopenharmony_cillistxattr;all 41d9f0492fSopenharmony_ciflistxattr;all 42d9f0492fSopenharmony_ciremovexattr;all 43d9f0492fSopenharmony_cilremovexattr;all 44d9f0492fSopenharmony_cifremovexattr;all 45d9f0492fSopenharmony_cigetcwd;all 46d9f0492fSopenharmony_cieventfd2;all 47d9f0492fSopenharmony_ciepoll_create1;all 48d9f0492fSopenharmony_ciepoll_ctl;all 49d9f0492fSopenharmony_ciepoll_pwait;all 50d9f0492fSopenharmony_cidup;all 51d9f0492fSopenharmony_cidup3;all 52d9f0492fSopenharmony_cifcntl;all 53d9f0492fSopenharmony_ciinotify_init1;all 54d9f0492fSopenharmony_ciinotify_add_watch;all 55d9f0492fSopenharmony_ciinotify_rm_watch;all 56d9f0492fSopenharmony_ciioctl;all 57d9f0492fSopenharmony_ciioprio_set;arm64 58d9f0492fSopenharmony_ciioprio_set;riscv64 59d9f0492fSopenharmony_ciioprio_get;arm64 60d9f0492fSopenharmony_ciioprio_get;riscv64 61d9f0492fSopenharmony_ciflock;all 62d9f0492fSopenharmony_cimknodat;all 63d9f0492fSopenharmony_cimkdirat;all 64d9f0492fSopenharmony_ciunlinkat;all 65d9f0492fSopenharmony_cisymlinkat;all 66d9f0492fSopenharmony_cilinkat;all 67d9f0492fSopenharmony_cirenameat;arm 68d9f0492fSopenharmony_cirenameat;arm64 69d9f0492fSopenharmony_cipivot_root;riscv64 70d9f0492fSopenharmony_cistatfs;arm64 71d9f0492fSopenharmony_cistatfs;riscv64 72d9f0492fSopenharmony_cifstatfs;arm64 73d9f0492fSopenharmony_cifstatfs;riscv64 74d9f0492fSopenharmony_citruncate;all 75d9f0492fSopenharmony_ciftruncate;arm64 76d9f0492fSopenharmony_ciftruncate;riscv64 77d9f0492fSopenharmony_cifallocate;all 78d9f0492fSopenharmony_cifaccessat;all 79d9f0492fSopenharmony_cichdir;all 80d9f0492fSopenharmony_cifchdir;all 81d9f0492fSopenharmony_cifchmod;all 82d9f0492fSopenharmony_cifchmodat;all 83d9f0492fSopenharmony_cifchownat;all 84d9f0492fSopenharmony_cifchown;arm64 85d9f0492fSopenharmony_cifchown;riscv64 86d9f0492fSopenharmony_ciopenat;all 87d9f0492fSopenharmony_ciclose;all 88d9f0492fSopenharmony_cipipe2;all 89d9f0492fSopenharmony_ciquotactl;all 90d9f0492fSopenharmony_cigetdents64;all 91d9f0492fSopenharmony_cilseek;all 92d9f0492fSopenharmony_ciread;all 93d9f0492fSopenharmony_ciwrite;all 94d9f0492fSopenharmony_cireadv;all 95d9f0492fSopenharmony_ciwritev;all 96d9f0492fSopenharmony_cipread64;all 97d9f0492fSopenharmony_cipwrite64;all 98d9f0492fSopenharmony_cipreadv;all 99d9f0492fSopenharmony_cipwritev;all 100d9f0492fSopenharmony_cisendfile;all 101d9f0492fSopenharmony_cipselect6;all 102d9f0492fSopenharmony_cippoll;all 103d9f0492fSopenharmony_cisignalfd4;all 104d9f0492fSopenharmony_civmsplice;all 105d9f0492fSopenharmony_cisplice;all 106d9f0492fSopenharmony_citee;all 107d9f0492fSopenharmony_cireadlinkat;all 108d9f0492fSopenharmony_cinewfstatat;arm64 109d9f0492fSopenharmony_cinewfstatat;riscv64 110d9f0492fSopenharmony_cifstat;arm64 111d9f0492fSopenharmony_cifstat;riscv64 112d9f0492fSopenharmony_cisync;all 113d9f0492fSopenharmony_cifsync;all 114d9f0492fSopenharmony_cifdatasync;all 115d9f0492fSopenharmony_cisync_file_range;arm64 116d9f0492fSopenharmony_cisync_file_range;riscv64 117d9f0492fSopenharmony_citimerfd_create;all 118d9f0492fSopenharmony_citimerfd_settime;all 119d9f0492fSopenharmony_citimerfd_gettime;all 120d9f0492fSopenharmony_ciutimensat;all 121d9f0492fSopenharmony_cicapget;all 122d9f0492fSopenharmony_cicapset;all 123d9f0492fSopenharmony_cipersonality;all 124d9f0492fSopenharmony_ciexit;all 125d9f0492fSopenharmony_ciexit_group;all 126d9f0492fSopenharmony_ciwaitid;all 127d9f0492fSopenharmony_ciset_tid_address;all 128d9f0492fSopenharmony_cifutex;all 129d9f0492fSopenharmony_cinanosleep;all 130d9f0492fSopenharmony_cigetitimer;all 131d9f0492fSopenharmony_cisetitimer;all 132d9f0492fSopenharmony_citimer_create;all 133d9f0492fSopenharmony_citimer_gettime;all 134d9f0492fSopenharmony_citimer_getoverrun;all 135d9f0492fSopenharmony_citimer_settime;all 136d9f0492fSopenharmony_citimer_delete;all 137d9f0492fSopenharmony_ciclock_gettime;all 138d9f0492fSopenharmony_ciclock_getres;all 139d9f0492fSopenharmony_ciclock_nanosleep;all 140d9f0492fSopenharmony_ciptrace;all 141d9f0492fSopenharmony_cisched_setparam;all 142d9f0492fSopenharmony_cisched_setscheduler;all 143d9f0492fSopenharmony_cisched_getscheduler;all 144d9f0492fSopenharmony_cisched_getparam;all 145d9f0492fSopenharmony_cisched_setaffinity;all 146d9f0492fSopenharmony_cisched_getaffinity;all 147d9f0492fSopenharmony_cisched_yield;all 148d9f0492fSopenharmony_cisched_get_priority_max;all 149d9f0492fSopenharmony_cisched_get_priority_min;all 150d9f0492fSopenharmony_cisched_rr_get_interval;all 151d9f0492fSopenharmony_cirestart_syscall;all 152d9f0492fSopenharmony_cikill;all 153d9f0492fSopenharmony_citkill;all 154d9f0492fSopenharmony_citgkill;all 155d9f0492fSopenharmony_cisigaltstack;all 156d9f0492fSopenharmony_cirt_sigsuspend;all 157d9f0492fSopenharmony_cirt_sigaction;all 158d9f0492fSopenharmony_cirt_sigprocmask;all 159d9f0492fSopenharmony_cirt_sigpending;all 160d9f0492fSopenharmony_cirt_sigtimedwait;all 161d9f0492fSopenharmony_cirt_sigqueueinfo;all 162d9f0492fSopenharmony_cirt_sigreturn;all 163d9f0492fSopenharmony_cisetpriority;all 164d9f0492fSopenharmony_cigetpriority;all 165d9f0492fSopenharmony_cisetresgid;arm64 166d9f0492fSopenharmony_cisetresgid;riscv64 167d9f0492fSopenharmony_cisetgid;arm64 168d9f0492fSopenharmony_cisetgid;riscv64 169d9f0492fSopenharmony_cisetuid;arm64 170d9f0492fSopenharmony_cisetuid;riscv64 171d9f0492fSopenharmony_cisetresuid;arm64 172d9f0492fSopenharmony_cisetresuid;riscv64 173d9f0492fSopenharmony_cigetresuid;arm64 174d9f0492fSopenharmony_cigetresuid;riscv64 175d9f0492fSopenharmony_cigetresgid;arm64 176d9f0492fSopenharmony_cigetresgid;riscv64 177d9f0492fSopenharmony_citimes;all 178d9f0492fSopenharmony_cisetpgid;all 179d9f0492fSopenharmony_cigetpgid;all 180d9f0492fSopenharmony_cigetsid;all 181d9f0492fSopenharmony_cisetsid;all 182d9f0492fSopenharmony_cigetgroups;arm64 183d9f0492fSopenharmony_cigetgroups;riscv64 184d9f0492fSopenharmony_cisetgroups;arm64 185d9f0492fSopenharmony_cisetgroups;riscv64 186d9f0492fSopenharmony_ciuname;all 187d9f0492fSopenharmony_cigetrlimit;arm64 188d9f0492fSopenharmony_cigetrlimit;riscv64 189d9f0492fSopenharmony_cisetrlimit;all 190d9f0492fSopenharmony_cigetrusage;all 191d9f0492fSopenharmony_ciumask;all 192d9f0492fSopenharmony_ciprctl;all 193d9f0492fSopenharmony_cigetcpu;all 194d9f0492fSopenharmony_cigettimeofday;all 195d9f0492fSopenharmony_cigetpid;all 196d9f0492fSopenharmony_cigetppid;all 197d9f0492fSopenharmony_cigetuid;all 198d9f0492fSopenharmony_cigeteuid;arm64 199d9f0492fSopenharmony_cigeteuid;riscv64 200d9f0492fSopenharmony_cigetgid;arm64 201d9f0492fSopenharmony_cigetgid;riscv64 202d9f0492fSopenharmony_cigetegid;arm64 203d9f0492fSopenharmony_cigetegid;riscv64 204d9f0492fSopenharmony_cigettid;all 205d9f0492fSopenharmony_cisysinfo;all 206d9f0492fSopenharmony_cisocket;all 207d9f0492fSopenharmony_cisocketpair;all 208d9f0492fSopenharmony_cibind;all 209d9f0492fSopenharmony_cilisten;all 210d9f0492fSopenharmony_ciaccept;all 211d9f0492fSopenharmony_ciconnect;all 212d9f0492fSopenharmony_cigetsockname;all 213d9f0492fSopenharmony_cigetpeername;all 214d9f0492fSopenharmony_cisendto;all 215d9f0492fSopenharmony_cirecvfrom;all 216d9f0492fSopenharmony_cisetsockopt;all 217d9f0492fSopenharmony_cigetsockopt;all 218d9f0492fSopenharmony_cishutdown;all 219d9f0492fSopenharmony_cisendmsg;all 220d9f0492fSopenharmony_cirecvmsg;all 221d9f0492fSopenharmony_cireadahead;all 222d9f0492fSopenharmony_cibrk;all 223d9f0492fSopenharmony_cimunmap;all 224d9f0492fSopenharmony_cimremap;all 225d9f0492fSopenharmony_ciexecve;all 226d9f0492fSopenharmony_cimmap;arm64 227d9f0492fSopenharmony_cimmap;riscv64 228d9f0492fSopenharmony_cifadvise64;arm64 229d9f0492fSopenharmony_cifadvise64;riscv64 230d9f0492fSopenharmony_cimprotect;all 231d9f0492fSopenharmony_cimsync;all 232d9f0492fSopenharmony_cimlock;all 233d9f0492fSopenharmony_cimunlock;all 234d9f0492fSopenharmony_cimlockall;all 235d9f0492fSopenharmony_cimunlockall;all 236d9f0492fSopenharmony_cimincore;all 237d9f0492fSopenharmony_cimadvise;all 238d9f0492fSopenharmony_cirt_tgsigqueueinfo;all 239d9f0492fSopenharmony_ciperf_event_open;all 240d9f0492fSopenharmony_ciaccept4;all 241d9f0492fSopenharmony_cirecvmmsg;all 242d9f0492fSopenharmony_ciwait4;all 243d9f0492fSopenharmony_ciprlimit64;all 244d9f0492fSopenharmony_cisyncfs;all 245d9f0492fSopenharmony_cisendmmsg;all 246d9f0492fSopenharmony_ciprocess_vm_readv;all 247d9f0492fSopenharmony_ciprocess_vm_writev;all 248d9f0492fSopenharmony_cisched_setattr;all 249d9f0492fSopenharmony_cisched_getattr;all 250d9f0492fSopenharmony_cirenameat2;all 251d9f0492fSopenharmony_ciseccomp;all 252d9f0492fSopenharmony_cigetrandom;all 253d9f0492fSopenharmony_cimemfd_create;all 254d9f0492fSopenharmony_ciexecveat;all 255d9f0492fSopenharmony_ciuserfaultfd;all 256d9f0492fSopenharmony_cimembarrier;all 257d9f0492fSopenharmony_cimlock2;all 258d9f0492fSopenharmony_cicopy_file_range;all 259d9f0492fSopenharmony_cipreadv2;all 260d9f0492fSopenharmony_cipwritev2;all 261d9f0492fSopenharmony_cistatx;all 262d9f0492fSopenharmony_cipidfd_send_signal;all 263d9f0492fSopenharmony_cipidfd_open;all 264d9f0492fSopenharmony_cipidfd_getfd;all 265d9f0492fSopenharmony_cifaccessat2;all 266d9f0492fSopenharmony_ciprocess_madvise;all 267d9f0492fSopenharmony_ciset_robust_list;all 268d9f0492fSopenharmony_cifork;arm 269d9f0492fSopenharmony_ciopen;arm 270d9f0492fSopenharmony_cicreat;arm 271d9f0492fSopenharmony_cilink;arm 272d9f0492fSopenharmony_ciunlink;arm 273d9f0492fSopenharmony_cichmod;arm 274d9f0492fSopenharmony_ciaccess;arm 275d9f0492fSopenharmony_cirename;arm 276d9f0492fSopenharmony_cimkdir;arm 277d9f0492fSopenharmony_cirmdir;arm 278d9f0492fSopenharmony_cipipe;arm 279d9f0492fSopenharmony_cidup2;arm 280d9f0492fSopenharmony_cisigaction;arm 281d9f0492fSopenharmony_cisymlink;arm 282d9f0492fSopenharmony_cireadlink;arm 283d9f0492fSopenharmony_cisigreturn;arm 284d9f0492fSopenharmony_ci_llseek;arm 285d9f0492fSopenharmony_cigetdents;arm 286d9f0492fSopenharmony_ci_newselect;arm 287d9f0492fSopenharmony_cipoll;arm 288d9f0492fSopenharmony_civfork;arm 289d9f0492fSopenharmony_ciugetrlimit;arm 290d9f0492fSopenharmony_cimmap2;arm 291d9f0492fSopenharmony_citruncate64;arm 292d9f0492fSopenharmony_ciftruncate64;arm 293d9f0492fSopenharmony_cistat64;arm 294d9f0492fSopenharmony_cilstat64;arm 295d9f0492fSopenharmony_cifstat64;arm 296d9f0492fSopenharmony_cilchown32;arm 297d9f0492fSopenharmony_cigetuid32;arm 298d9f0492fSopenharmony_cigetgid32;arm 299d9f0492fSopenharmony_cigeteuid32;arm 300d9f0492fSopenharmony_cigetegid32;arm 301d9f0492fSopenharmony_cigetgroups32;arm 302d9f0492fSopenharmony_cifchown32;arm 303d9f0492fSopenharmony_cisetgroups32;arm 304d9f0492fSopenharmony_cisetresuid32;arm 305d9f0492fSopenharmony_cisetresgid32;arm 306d9f0492fSopenharmony_cigetresuid32;arm 307d9f0492fSopenharmony_cigetresgid32;arm 308d9f0492fSopenharmony_cichown32;arm 309d9f0492fSopenharmony_cisetuid32;arm 310d9f0492fSopenharmony_cisetgid32;arm 311d9f0492fSopenharmony_cifcntl64;arm 312d9f0492fSopenharmony_cisendfile64;arm 313d9f0492fSopenharmony_ciepoll_create;arm 314d9f0492fSopenharmony_ciepoll_wait;arm 315d9f0492fSopenharmony_ciremap_file_pages;arm 316d9f0492fSopenharmony_cistatfs64;arm 317d9f0492fSopenharmony_cifstatfs64;arm 318d9f0492fSopenharmony_cifadvise64_64;arm 319d9f0492fSopenharmony_ciinotify_init;arm 320d9f0492fSopenharmony_cifstatat64;arm 321d9f0492fSopenharmony_cisync_file_range2;arm 322d9f0492fSopenharmony_cieventfd;arm 323d9f0492fSopenharmony_ciclock_gettime64;arm 324d9f0492fSopenharmony_ciclock_settime64;arm 325d9f0492fSopenharmony_ciclock_adjtime64;arm 326d9f0492fSopenharmony_ciclock_getres_time64;arm 327d9f0492fSopenharmony_ciclock_nanosleep_time64;arm 328d9f0492fSopenharmony_citimer_gettime64;arm 329d9f0492fSopenharmony_citimer_settime64;arm 330d9f0492fSopenharmony_citimerfd_gettime64;arm 331d9f0492fSopenharmony_citimerfd_settime64;arm 332d9f0492fSopenharmony_ciutimensat_time64;arm 333d9f0492fSopenharmony_cipselect6_time64;arm 334d9f0492fSopenharmony_cippoll_time64;arm 335d9f0492fSopenharmony_cirecvmmsg_time64;arm 336d9f0492fSopenharmony_cisemtimedop_time64;arm 337d9f0492fSopenharmony_cirt_sigtimedwait_time64;arm 338d9f0492fSopenharmony_cifutex_time64;arm 339d9f0492fSopenharmony_cisched_rr_get_interval_time64;arm 340d9f0492fSopenharmony_cicacheflush;arm 341d9f0492fSopenharmony_ciset_tls;arm 342d9f0492fSopenharmony_ci 343d9f0492fSopenharmony_ci@allowListWithArgs 344d9f0492fSopenharmony_ciclone: if (arg0 & (CLONE_NEWNS | CLONE_NEWPID | CLONE_NEWNET | CLONE_NEWCGROUP | CLONE_NEWUTS | CLONE_NEWIPC | CLONE_NEWUSER)) == 0 ; return ALLOW; else return TRAP;all 345