未验证 提交 9f7673b2 编写于 作者: O openharmony_ci 提交者: Gitee

!1576 seccomp模块清除安全告警

Merge pull request !1576 from 夏不白/seccomp_check_path
......@@ -34,8 +34,10 @@
#ifdef __aarch64__
#define FILTER_LIB_PATH_FORMAT "/system/lib64/lib%s_filter.z.so"
#define FILTER_LIB_PATH_HEAD "/system/lib64/lib"
#else
#define FILTER_LIB_PATH_FORMAT "/system/lib/lib%s_filter.z.so"
#define FILTER_LIB_PATH_HEAD "/system/lib/lib"
#endif
#define FILTER_NAME_FORMAT "g_%sSeccompFilter"
#define FILTER_SIZE_STRING "Size"
......@@ -114,6 +116,10 @@ static int GetSeccompPolicy(const char *filterName, int **handler,
return INPUT_ERROR;
}
if (strncmp(filterLibRealPath, FILTER_LIB_PATH_HEAD, strlen(FILTER_LIB_PATH_HEAD))) {
return INPUT_ERROR;
}
char filterVaribleName[PATH_MAX] = {0};
struct sock_filter *filter = NULL;
size_t *filterSize = NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册