Hello community,

here is the log from the commit of package hyper-v for openSUSE:Factory checked 
in at 2013-08-01 17:55:17
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/hyper-v (Old)
 and      /work/SRC/openSUSE:Factory/.hyper-v.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "hyper-v"

Changes:
--------
--- /work/SRC/openSUSE:Factory/hyper-v/hyper-v.changes  2013-08-01 
06:54:38.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.hyper-v.new/hyper-v.changes     2013-08-01 
17:55:18.000000000 +0200
@@ -1,0 +2,5 @@
+Thu Aug  1 14:21:57 CEST 2013 - [email protected]
+
+- Fix send/recv buffer allocation (bnc#828714)
+
+-------------------------------------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ hyper-v.tools.hv.hv_kvp_daemon.c ++++++
--- /var/tmp/diff_new_pack.Ho4sx4/_old  2013-08-01 17:55:18.000000000 +0200
+++ /var/tmp/diff_new_pack.Ho4sx4/_new  2013-08-01 17:55:18.000000000 +0200
@@ -79,8 +79,6 @@
        DNS
 };
 
-static char kvp_send_buffer[4096];
-static char kvp_recv_buffer[4096 * 2];
 static struct sockaddr_nl addr;
 static int in_hand_shake = 1;
 
@@ -1437,10 +1435,21 @@
        int     pool;
        char    *if_name;
        struct hv_kvp_ipaddr_value *kvp_ip_val;
+       char *kvp_send_buffer;
+       char *kvp_recv_buffer;
+       size_t kvp_recv_buffer_len;
 
        daemon(1, 0);
        openlog("KVP", 0, LOG_USER);
        syslog(LOG_INFO, "KVP starting; pid is:%d", getpid());
+
+       kvp_recv_buffer_len = NLMSG_HDRLEN + sizeof(struct cn_msg) + 
sizeof(struct hv_kvp_msg);
+       kvp_send_buffer = calloc(1, kvp_recv_buffer_len);
+       kvp_recv_buffer = calloc(1, kvp_recv_buffer_len);
+       if (!(kvp_send_buffer && kvp_recv_buffer)) {
+               syslog(LOG_ERR, "Failed to allocate netlink buffers");
+               exit(EXIT_FAILURE);
+       }
        /*
         * Retrieve OS release information.
         */
@@ -1514,7 +1523,7 @@
                                continue;
                }
 
-               len = recvfrom(fd, kvp_recv_buffer, sizeof(kvp_recv_buffer), 0,
+               len = recvfrom(fd, kvp_recv_buffer, kvp_recv_buffer_len, 0,
                                addr_p, &addr_l);
 
                if (len < 0) {

++++++ hyper-v.tools.hv.hv_vss_daemon.c ++++++
--- /var/tmp/diff_new_pack.Ho4sx4/_old  2013-08-01 17:55:18.000000000 +0200
+++ /var/tmp/diff_new_pack.Ho4sx4/_new  2013-08-01 17:55:18.000000000 +0200
@@ -38,8 +38,6 @@
 #include <linux/netlink.h>
 #include <syslog.h>
 
-static char vss_recv_buffer[4096];
-static char vss_send_buffer[4096];
 static struct sockaddr_nl addr;
 
 #ifndef SOL_NETLINK
@@ -52,7 +50,7 @@
        int ret, fd = open(dir, O_RDONLY);
 
        if (fd < 0)
-               return -1;
+               return 1;
        ret = ioctl(fd, cmd, 0);
        syslog(LOG_INFO, "VSS: %s of %s: %s\n", fs_op, dir, strerror(errno));
        close(fd);
@@ -85,9 +83,11 @@
        if (mounts == NULL)
                return -1;
 
-       while((ent = getmntent(mounts))) {
+       while ((ent = getmntent(mounts))) {
                if (strncmp(ent->mnt_fsname, match, strlen(match)))
                        continue;
+               if (strcmp(ent->mnt_type, "iso9660") == 0)
+                       continue;
                if (strcmp(ent->mnt_dir, "/") == 0) {
                        root_seen = 1;
                        continue;
@@ -145,6 +145,9 @@
        struct cn_msg   *incoming_cn_msg;
        int     op;
        struct hv_vss_msg *vss_msg;
+       char *vss_send_buffer;
+       char *vss_recv_buffer;
+       size_t vss_recv_buffer_len;
 
        if (daemon(1, 0))
                return 1;
@@ -152,6 +155,14 @@
        openlog("Hyper-V VSS", 0, LOG_USER);
        syslog(LOG_INFO, "VSS starting; pid is:%d", getpid());
 
+       vss_recv_buffer_len = NLMSG_HDRLEN + sizeof(struct cn_msg) + 
sizeof(struct hv_vss_msg);
+       vss_send_buffer = calloc(1, vss_recv_buffer_len);
+       vss_recv_buffer = calloc(1, vss_recv_buffer_len);
+       if (!(vss_send_buffer && vss_recv_buffer)) {
+               syslog(LOG_ERR, "Failed to allocate netlink buffers");
+               exit(EXIT_FAILURE);
+       }
+
        fd = socket(AF_NETLINK, SOCK_DGRAM, NETLINK_CONNECTOR);
        if (fd < 0) {
                syslog(LOG_ERR, "netlink socket creation failed; error:%d", fd);
@@ -199,7 +210,7 @@
                pfd.revents = 0;
                poll(&pfd, 1, -1);
 
-               len = recvfrom(fd, vss_recv_buffer, sizeof(vss_recv_buffer), 0,
+               len = recvfrom(fd, vss_recv_buffer, vss_recv_buffer_len, 0,
                                addr_p, &addr_l);
 
                if (len < 0) {
@@ -210,8 +221,9 @@
                }
 
                if (addr.nl_pid) {
-                       syslog(LOG_WARNING, "Received packet from untrusted 
pid:%u",
-                                       addr.nl_pid);
+                       syslog(LOG_WARNING,
+                               "Received packet from untrusted pid:%u",
+                               addr.nl_pid);
                        continue;
                }
 

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to