Check memory parameters before copying to user space

Signed-off-by: Ian Levine <ian.levine@huawei.com>
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
This commit is contained in:
Ian Levine 2023-06-06 09:32:58 +03:00 committed by Robert Baldyga
parent 14aea0eda0
commit c9f301249e

View File

@ -1075,6 +1075,9 @@ int cache_mngt_core_pool_get_paths(struct kcas_core_pool_path *cmd_info)
struct get_paths_ctx visitor_ctx = {0}; struct get_paths_ctx visitor_ctx = {0};
int result; int result;
if (visitor_ctx->core_path_name_tab == NULL)
return -EINVAL;
visitor_ctx.core_path_name_tab = cmd_info->core_path_tab; visitor_ctx.core_path_name_tab = cmd_info->core_path_tab;
visitor_ctx.max_count = cmd_info->core_pool_count; visitor_ctx.max_count = cmd_info->core_pool_count;