qemu-bridge-helper: restrict interface name to IFNAMSIZ
commit6f5d8671225dc77190647f18a27a0d156d4ca97a
authorPrasad J Pandit <pjp@fedoraproject.org>
Tue, 23 Jul 2019 10:47:52 +0000 (23 16:17 +0530)
committerJason Wang <jasowang@redhat.com>
Mon, 29 Jul 2019 08:29:30 +0000 (29 16:29 +0800)
treedd5953e52468dfc108a332a86c178574348564cd
parentf46efa9b0895a7ff8ed0b4e874aee52a49f2a878
qemu-bridge-helper: restrict interface name to IFNAMSIZ

The network interface name in Linux is defined to be of size
IFNAMSIZ(=16), including the terminating null('\0') byte.
The same is applied to interface names read from 'bridge.conf'
file to form ACL rules. If user supplied '--br=bridge' name
is not restricted to the same length, it could lead to ACL bypass
issue. Restrict interface name to IFNAMSIZ, including null byte.

Reported-by: Riccardo Schirone <rschiron@redhat.com>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
qemu-bridge-helper.c