提交 c762040b 编写于 作者: X xiacong

<fix>

检查dlopen参数的头部路径
Signed-off-by: Nxiacong <xiacong4@huawei.com>
上级 1cb444dd
......@@ -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.
先完成此消息的编辑!
想要评论请 注册