Thread (6 messages) flat view 6 messages, 2 authors, 2017-02-19
STALE3484d

[PATCH iproute2 4/4] ip vrf: Detect invalid vrf name in pids command

From: David Ahern <hidden>
Date: 2017-02-16 16:59:07
Subsystem: the rest · Maintainer: Linus Torvalds

Verify VRF name is valid before attempting to read cgroups files.

Signed-off-by: David Ahern <redacted>
---
 ip/ipvrf.c | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/ip/ipvrf.c b/ip/ipvrf.c
index cb7f9fa6d1db..5e204a9ebbb1 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)
-- 
2.1.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help