Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP1:Update
qemu.12301
0315-qemu-bridge-helper-restrict-interfa.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0315-qemu-bridge-helper-restrict-interfa.patch of Package qemu.12301
From 5595860ef9a9311d40dc12bc8ee8e41864b5522d Mon Sep 17 00:00:00 2001 From: Liang Yan <lyan@suse.com> Date: Thu, 25 Jul 2019 13:28:26 -0400 Subject: [PATCH] qemu-bridge-helper: restrict interface name The interface names in qemu-bridge-helper are 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 ACLs rules. If user supplied '--br=bridge' name is not restricted to the same length, it could lead to ACL bypass issue. Restrict bridge name to IFNAMSIZ, including null byte. Reported-by: Riccardo Schirone <rschiron@redhat.com> Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org> [LY: BSC#1140402 CVE-2019-13164] Signed-off-by: Liang Yan <lyan@suse.com> --- qemu-bridge-helper.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/qemu-bridge-helper.c b/qemu-bridge-helper.c index 36eb3bcfd6..5c746126c9 100644 --- a/qemu-bridge-helper.c +++ b/qemu-bridge-helper.c @@ -119,6 +119,13 @@ static int parse_acl_file(const char *filename, ACLList *acl_list) } *argend = 0; + if (!g_str_equal(cmd, "include") && strlen(arg) >= IFNAMSIZ) { + fprintf(stderr, "name `%s' too long: %zu\n", arg, strlen(arg)); + fclose(f); + errno = EINVAL; + return -1; + } + if (strcmp(cmd, "deny") == 0) { acl_rule = g_malloc(sizeof(*acl_rule)); if (strcmp(arg, "all") == 0) { @@ -264,6 +271,10 @@ int main(int argc, char **argv) return EXIT_FAILURE; } } + if (strlen(bridge) >= IFNAMSIZ) { + fprintf(stderr, "name `%s' too long: %zu\n", bridge, strlen(bridge)); + return EXIT_FAILURE; + } if (bridge == NULL || unixfd == -1) { usage();
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor