|
|
@@ -917,8 +917,9 @@ static int hashlimit_mt_check_v1(const struct xt_mtchk_param *par)
|
|
|
struct hashlimit_cfg3 cfg = {};
|
|
|
int ret;
|
|
|
|
|
|
- if (info->name[sizeof(info->name) - 1] != '\0')
|
|
|
- return -EINVAL;
|
|
|
+ ret = xt_check_proc_name(info->name, sizeof(info->name));
|
|
|
+ if (ret)
|
|
|
+ return ret;
|
|
|
|
|
|
ret = cfg_copy(&cfg, (void *)&info->cfg, 1);
|
|
|
|
|
|
@@ -935,8 +936,9 @@ static int hashlimit_mt_check_v2(const struct xt_mtchk_param *par)
|
|
|
struct hashlimit_cfg3 cfg = {};
|
|
|
int ret;
|
|
|
|
|
|
- if (info->name[sizeof(info->name) - 1] != '\0')
|
|
|
- return -EINVAL;
|
|
|
+ ret = xt_check_proc_name(info->name, sizeof(info->name));
|
|
|
+ if (ret)
|
|
|
+ return ret;
|
|
|
|
|
|
ret = cfg_copy(&cfg, (void *)&info->cfg, 2);
|
|
|
|
|
|
@@ -950,9 +952,11 @@ static int hashlimit_mt_check_v2(const struct xt_mtchk_param *par)
|
|
|
static int hashlimit_mt_check(const struct xt_mtchk_param *par)
|
|
|
{
|
|
|
struct xt_hashlimit_mtinfo3 *info = par->matchinfo;
|
|
|
+ int ret;
|
|
|
|
|
|
- if (info->name[sizeof(info->name) - 1] != '\0')
|
|
|
- return -EINVAL;
|
|
|
+ ret = xt_check_proc_name(info->name, sizeof(info->name));
|
|
|
+ if (ret)
|
|
|
+ return ret;
|
|
|
|
|
|
return hashlimit_mt_check_common(par, &info->hinfo, &info->cfg,
|
|
|
info->name, 3);
|