Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/kvaneesh/tags/for-upstream-sign…
Browse files Browse the repository at this point in the history
…ed' into staging

VirtFS update:

* Fix for virtfs-proxy-helper crash
* Gracefully handle the error condition on input validation in virtfs-proxy-helper

# gpg: Signature made Tue Jun 16 16:21:28 2015 BST using RSA key ID 04C4E23A
# gpg: Good signature from "Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>"
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 4846 9DE7 1860 360F A6E9  968C DE41 A4FE 04C4 E23A

* remotes/kvaneesh/tags/for-upstream-signed:
  virtfs-proxy-helper: fail gracefully if socket path is too long
  virtfs-proxy-helper: add missing long option terminator

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
  • Loading branch information
pm215 committed Jun 17, 2015
2 parents 93f6d1c + f8d30a4 commit 8c29f8d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion fsdev/virtfs-proxy-helper.c
Expand Up @@ -49,6 +49,7 @@ static struct option helper_opts[] = {
{"socket", required_argument, NULL, 's'},
{"uid", required_argument, NULL, 'u'},
{"gid", required_argument, NULL, 'g'},
{},
};

static bool is_daemon;
Expand Down Expand Up @@ -738,7 +739,12 @@ static int proxy_socket(const char *path, uid_t uid, gid_t gid)
return -1;
}

g_assert(strlen(path) < sizeof(proxy.sun_path));
if (strlen(path) >= sizeof(proxy.sun_path)) {
do_log(LOG_CRIT, "UNIX domain socket path exceeds %zu characters\n",
sizeof(proxy.sun_path));
return -1;
}

sock = socket(AF_UNIX, SOCK_STREAM, 0);
if (sock < 0) {
do_perror("socket");
Expand Down

0 comments on commit 8c29f8d

Please sign in to comment.