]> git.proxmox.com Git - mirror_iproute2.git/commit
netns: avoid directory traversal
authorMatteo Croce <mcroce@redhat.com>
Wed, 19 Jul 2017 22:36:32 +0000 (00:36 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Fri, 21 Jul 2017 00:23:52 +0000 (17:23 -0700)
commit79928fd0552b520aa36a22e71144d10a32f7e4fe
treea0e36c3dda3329f8e0e2d2ed1ecaec8c42a42fca
parentb09515553fded944713955815a3f1cc855384abd
netns: avoid directory traversal

ip netns keeps track of created namespaces with bind mounts named
/var/run/netns/<namespace>. No input sanitization is done, allowing creation and
deletion of files relatives to /var/run/netns or, if the path is non existent or
invalid, allows to create "untracked" namespaces (invisible to the tool).

This commit denies creation or deletion of namespaces with names contaning
"/" or matching exactly "." or "..".

Signed-off-by: Matteo Croce <mcroce@redhat.com>
ip/ipnetns.c