From b5377431df6de037b668eba418dca28f1113d303 Mon Sep 17 00:00:00 2001 From: David Ahern Date: Thu, 16 Feb 2017 08:58:58 -0800 Subject: [PATCH] ip vrf: Detect invalid vrf name in pids command Verify VRF name is valid before attempting to read cgroups files. Signed-off-by: David Ahern --- ip/ipvrf.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ip/ipvrf.c b/ip/ipvrf.c index cb7f9fa6..5e204a9e 100644 --- a/ip/ipvrf.c +++ b/ip/ipvrf.c @@ -212,6 +212,10 @@ static int ipvrf_pids(int argc, char **argv) } vrf = argv[0]; + if (!name_is_vrf(vrf)) { + fprintf(stderr, "Invalid VRF name\n"); + return -1; + } mnt = find_cgroup2_mount(); if (!mnt)