app-emulation/qemu: Bugfix: Fix patch file
authorMatthias Maier <tamiko@gentoo.org>
Wed, 26 Jul 2017 19:06:15 +0000 (14:06 -0500)
committerMatthias Maier <tamiko@gentoo.org>
Wed, 26 Jul 2017 19:37:32 +0000 (14:37 -0500)
Package-Manager: Portage-2.3.6, Repoman-2.3.3

app-emulation/qemu/files/qemu-2.9.0-CVE-2017-7539.patch

index 3af16977b93bf864b1d8f9fd5e5985ac8a814e70..ee77a59373e18e36c74547f659629bf17cbdbb96 100644 (file)
@@ -375,25 +375,25 @@ index 924a1fe..a1f106b 100644
  
      magic = cpu_to_be64(NBD_REP_MAGIC);
 -    if (nbd_negotiate_write(ioc, &magic, sizeof(magic)) != sizeof(magic)) {
-+    if (nbd_write(ioc, &magic, sizeof(magic), NULL) < 0) {
++    if (write_sync(ioc, &magic, sizeof(magic), NULL) < 0) {
          LOG("write failed (rep magic)");
          return -EINVAL;
      }
      opt = cpu_to_be32(opt);
 -    if (nbd_negotiate_write(ioc, &opt, sizeof(opt)) != sizeof(opt)) {
-+    if (nbd_write(ioc, &opt, sizeof(opt), NULL) < 0) {
++    if (write_sync(ioc, &opt, sizeof(opt), NULL) < 0) {
          LOG("write failed (rep opt)");
          return -EINVAL;
      }
      type = cpu_to_be32(type);
 -    if (nbd_negotiate_write(ioc, &type, sizeof(type)) != sizeof(type)) {
-+    if (nbd_write(ioc, &type, sizeof(type), NULL) < 0) {
++    if (write_sync(ioc, &type, sizeof(type), NULL) < 0) {
          LOG("write failed (rep type)");
          return -EINVAL;
      }
      len = cpu_to_be32(len);
 -    if (nbd_negotiate_write(ioc, &len, sizeof(len)) != sizeof(len)) {
-+    if (nbd_write(ioc, &len, sizeof(len), NULL) < 0) {
++    if (write_sync(ioc, &len, sizeof(len), NULL) < 0) {
          LOG("write failed (rep data length)");
          return -EINVAL;
      }
@@ -402,7 +402,7 @@ index 924a1fe..a1f106b 100644
          goto out;
      }
 -    if (nbd_negotiate_write(ioc, msg, len) != len) {
-+    if (nbd_write(ioc, msg, len, NULL) < 0) {
++    if (write_sync(ioc, msg, len, NULL) < 0) {
          LOG("write failed (error message)");
          ret = -EIO;
      } else {
@@ -411,17 +411,17 @@ index 924a1fe..a1f106b 100644
  
      len = cpu_to_be32(name_len);
 -    if (nbd_negotiate_write(ioc, &len, sizeof(len)) != sizeof(len)) {
-+    if (nbd_write(ioc, &len, sizeof(len), NULL) < 0) {
++    if (write_sync(ioc, &len, sizeof(len), NULL) < 0) {
          LOG("write failed (name length)");
          return -EINVAL;
      }
 -    if (nbd_negotiate_write(ioc, name, name_len) != name_len) {
-+    if (nbd_write(ioc, name, name_len, NULL) < 0) {
++    if (write_sync(ioc, name, name_len, NULL) < 0) {
          LOG("write failed (name buffer)");
          return -EINVAL;
      }
 -    if (nbd_negotiate_write(ioc, desc, desc_len) != desc_len) {
-+    if (nbd_write(ioc, desc, desc_len, NULL) < 0) {
++    if (write_sync(ioc, desc, desc_len, NULL) < 0) {
          LOG("write failed (description buffer)");
          return -EINVAL;
      }
@@ -524,13 +524,13 @@ index 924a1fe..a1f106b 100644
              goto fail;
          }
 -        if (nbd_negotiate_write(client->ioc, buf, sizeof(buf)) != sizeof(buf)) {
-+        if (nbd_write(client->ioc, buf, sizeof(buf), NULL) < 0) {
++        if (write_sync(client->ioc, buf, sizeof(buf), NULL) < 0) {
              LOG("write failed");
              goto fail;
          }
      } else {
 -        if (nbd_negotiate_write(client->ioc, buf, 18) != 18) {
-+        if (nbd_write(client->ioc, buf, 18, NULL) < 0) {
++        if (write_sync(client->ioc, buf, 18, NULL) < 0) {
              LOG("write failed");
              goto fail;
          }
@@ -539,7 +539,7 @@ index 924a1fe..a1f106b 100644
          stw_be_p(buf + 26, client->exp->nbdflags | myflags);
          len = client->no_zeroes ? 10 : sizeof(buf) - 18;
 -        if (nbd_negotiate_write(client->ioc, buf + 18, len) != len) {
-+        if (nbd_write(client->ioc, buf + 18, len, NULL) < 0) {
++        if (write_sync(client->ioc, buf + 18, len, NULL) < 0) {
              LOG("write failed");
              goto fail;
          }