[PATCH xtables-addons 3/8] xt_condition: use `xt_check_proc_name` to validate /proc file-name.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



4.16 introduced a standard function to do the job, so let's use it.

Signed-off-by: Jeremy Sowden <jeremy@xxxxxxxxxx>
---
 extensions/xt_condition.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/extensions/xt_condition.c b/extensions/xt_condition.c
index c2c48670c788..1d9d7352f069 100644
--- a/extensions/xt_condition.c
+++ b/extensions/xt_condition.c
@@ -135,9 +135,7 @@ static int condition_mt_check(const struct xt_mtchk_param *par)
 	struct condition_net *condition_net = condition_pernet(par->net);
 
 	/* Forbid certain names */
-	if (*info->name == '\0' || *info->name == '.' ||
-	    info->name[sizeof(info->name)-1] != '\0' ||
-	    memchr(info->name, '/', sizeof(info->name)) != NULL) {
+	if (xt_check_proc_name(info->name, sizeof(info->name))) {
 		printk(KERN_INFO KBUILD_MODNAME ": name not allowed or too "
 		       "long: \"%.*s\"\n", (unsigned int)sizeof(info->name),
 		       info->name);
-- 
2.32.0




[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux