pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/sysutils/xenstoretools Fix build. Not sure if this mak...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/407720139237
branches:  trunk
changeset: 356321:407720139237
user:      wiz <wiz%pkgsrc.org@localhost>
date:      Thu Dec 29 23:12:23 2016 +0000

description:
Fix build. Not sure if this makes sense, since it's for the removed xen 4.1.

diffstat:

 sysutils/xenstoretools/Makefile                                               |   13 +-
 sysutils/xenstoretools/patches/patch-.._.._ipxe_src_arch_i386_include_librm.h |   16 +
 sysutils/xenstoretools/patches/patch-.._.._ipxe_src_core_settings.c           |   34 +
 sysutils/xenstoretools/patches/patch-.._.._ipxe_src_net_tls.c                 |   69 +++
 sysutils/xenstoretools/patches/patch-.._Config.mk                             |   22 +
 sysutils/xenstoretools/patches/patch-CVE-2014-1950                            |   14 +
 sysutils/xenstoretools/patches/patch-CVE-2015-2752                            |   83 +++
 sysutils/xenstoretools/patches/patch-CVE-2015-2756                            |  142 ++++++
 sysutils/xenstoretools/patches/patch-CVE-2015-8550                            |  134 ++++++
 sysutils/xenstoretools/patches/patch-CVE-2015-8554                            |   21 +
 sysutils/xenstoretools/patches/patch-XSA-197                                  |   69 +++
 sysutils/xenstoretools/patches/patch-XSA-198                                  |   58 ++
 sysutils/xenstoretools/patches/patch-XSA-199                                  |   90 ++++
 sysutils/xenstoretools/patches/patch-aa                                       |   12 +
 sysutils/xenstoretools/patches/patch-ab                                       |   16 +
 sysutils/xenstoretools/patches/patch-ac                                       |   13 +
 sysutils/xenstoretools/patches/patch-ad                                       |   13 +
 sysutils/xenstoretools/patches/patch-ae                                       |   14 +
 sysutils/xenstoretools/patches/patch-af                                       |   26 +
 sysutils/xenstoretools/patches/patch-ag                                       |   23 +
 sysutils/xenstoretools/patches/patch-ah                                       |   40 +
 sysutils/xenstoretools/patches/patch-ai                                       |   18 +
 sysutils/xenstoretools/patches/patch-aj                                       |   16 +
 sysutils/xenstoretools/patches/patch-ak                                       |   16 +
 sysutils/xenstoretools/patches/patch-al                                       |   12 +
 sysutils/xenstoretools/patches/patch-am                                       |   13 +
 sysutils/xenstoretools/patches/patch-ba                                       |   56 ++
 sysutils/xenstoretools/patches/patch-bb                                       |  213 ++++++++++
 sysutils/xenstoretools/patches/patch-bc                                       |  110 +++++
 sysutils/xenstoretools/patches/patch-ca                                       |   47 ++
 sysutils/xenstoretools/patches/patch-cb                                       |   36 +
 sysutils/xenstoretools/patches/patch-cc                                       |   40 +
 sysutils/xenstoretools/patches/patch-cd                                       |   13 +
 sysutils/xenstoretools/patches/patch-ce                                       |   24 +
 sysutils/xenstoretools/patches/patch-cf                                       |   17 +
 sysutils/xenstoretools/patches/patch-cg                                       |   22 +
 sysutils/xenstoretools/patches/patch-ch                                       |   16 +
 sysutils/xenstoretools/patches/patch-config_StdGNU.mk                         |   15 +
 sysutils/xenstoretools/patches/patch-da                                       |   42 +
 sysutils/xenstoretools/patches/patch-db                                       |   85 +++
 sysutils/xenstoretools/patches/patch-dc                                       |   34 +
 sysutils/xenstoretools/patches/patch-dd                                       |   11 +
 sysutils/xenstoretools/patches/patch-de                                       |   11 +
 sysutils/xenstoretools/patches/patch-df                                       |   37 +
 sysutils/xenstoretools/patches/patch-firmware_hvmloader_Makefile              |   13 +
 sysutils/xenstoretools/patches/patch-ioemu-qemu-xen_hw_pass-through.c         |   13 +
 sysutils/xenstoretools/patches/patch-ioemu-qemu-xen_hw_pass-through.h         |   18 +
 sysutils/xenstoretools/patches/patch-ioemu-qemu-xen_hw_piix4acpi.c            |   17 +
 sysutils/xenstoretools/patches/patch-ioemu-qemu-xen_hw_pt-graphics.c          |   13 +
 sysutils/xenstoretools/patches/patch-ioemu-qemu-xen_hw_pt-msi.c               |   15 +
 sysutils/xenstoretools/patches/patch-ioemu-qemu-xen_hw_pt-msi.h               |   12 +
 sysutils/xenstoretools/patches/patch-ioemu-qemu-xen_xen-hooks.mak             |   34 +
 sysutils/xenstoretools/patches/patch-libfsimage_ufs_ufs.h                     |   13 +
 sysutils/xenstoretools/patches/patch-libxl_libxl_create.c                     |   40 +
 sysutils/xenstoretools/patches/patch-libxl_libxl_internal.h                   |   16 +
 sysutils/xenstoretools/patches/patch-libxl_xl__cmdimpl.c                      |   13 +
 sysutils/xenstoretools/patches/patch-ocaml_Makefile.rules                     |   13 +
 sysutils/xenstoretools/patches/patch-ocaml_common.make                        |   13 +
 sysutils/xenstoretools/patches/patch-ocaml_libs_xb_xs__ring__stubs.c          |   26 +
 sysutils/xenstoretools/patches/patch-ocaml_xenstored_define.ml                |   20 +
 sysutils/xenstoretools/patches/patch-ocaml_xenstored_utils.ml                 |   13 +
 sysutils/xenstoretools/patches/patch-qemu-phy-devices                         |   97 ++++
 sysutils/xenstoretools/patches/patch-xenstat_libxenstat_Makefile              |   30 +
 sysutils/xenstoretools/patches/patch-xenstat_xentop_Makefile                  |   15 +
 sysutils/xenstoretools/patches/patch-xenstore_Makefile                        |   29 +
 65 files changed, 2291 insertions(+), 8 deletions(-)

diffs (truncated from 2570 to 300 lines):

diff -r 785890495f41 -r 407720139237 sysutils/xenstoretools/Makefile
--- a/sysutils/xenstoretools/Makefile   Thu Dec 29 23:07:17 2016 +0000
+++ b/sysutils/xenstoretools/Makefile   Thu Dec 29 23:12:23 2016 +0000
@@ -1,8 +1,4 @@
-# $NetBSD: Makefile,v 1.5 2016/07/09 13:07:20 rillig Exp $
-#
-
-# VERSION is set in xentool41/version.mk
-.include               "../../sysutils/xentools41/version.mk"
+# $NetBSD: Makefile,v 1.6 2016/12/29 23:12:23 wiz Exp $
 
 DISTNAME=      xen-${VERSION}
 PKGNAME=       xenstoretools-${VERSION}
@@ -17,10 +13,11 @@
 MAINTAINER=            sborrill%NetBSD.org@localhost
 HOMEPAGE=              http://xen.org/
 COMMENT=               Xenstore Tools for Xen 4.1.x
+LICENSE=               gnu-gpl-v2
 
-LICENSE=               gnu-gpl-v2
-DISTINFO_FILE=         ${.CURDIR}/../xentools41/distinfo
-PATCHDIR=              ${.CURDIR}/../xentools41/patches
+VERSION=               4.1.6.1
+VERSION_IPXE=          1.0.0
+
 BUILD_DIRS=            xenstore
 BUILD_TARGET=          clients
 INSTALL_TARGET=                installclients
diff -r 785890495f41 -r 407720139237 sysutils/xenstoretools/patches/patch-.._.._ipxe_src_arch_i386_include_librm.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/xenstoretools/patches/patch-.._.._ipxe_src_arch_i386_include_librm.h     Thu Dec 29 23:12:23 2016 +0000
@@ -0,0 +1,16 @@
+$NetBSD: patch-.._.._ipxe_src_arch_i386_include_librm.h,v 1.1 2016/12/29 23:12:23 wiz Exp $
+
+--- ../../ipxe/src/arch/i386/include/librm.h.orig      2010-02-02 16:12:44.000000000 +0000
++++ ../../ipxe/src/arch/i386/include/librm.h
+@@ -122,8 +122,9 @@ extern char *text16;
+       _data16_ ## variable __asm__ ( #variable )
+ 
+ #define __bss16_array( variable, array )                              \
+-      __attribute__ (( section ( ".bss16" ) ))                        \
+-      _data16_ ## variable array __asm__ ( #variable )
++      _data16_ ## variable array \
++      __asm__ ( #variable ) \
++      __attribute__ (( section ( ".bss16" ) ))
+ 
+ #define __text16( variable )                                          \
+       __attribute__ (( section ( ".text16.data" ) ))                  \
diff -r 785890495f41 -r 407720139237 sysutils/xenstoretools/patches/patch-.._.._ipxe_src_core_settings.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/xenstoretools/patches/patch-.._.._ipxe_src_core_settings.c       Thu Dec 29 23:12:23 2016 +0000
@@ -0,0 +1,34 @@
+$NetBSD: patch-.._.._ipxe_src_core_settings.c,v 1.1 2016/12/29 23:12:23 wiz Exp $
+
+--- ../../ipxe/src/core/settings.c.orig        2013-03-25 18:48:57.000000000 +0000
++++ ../../ipxe/src/core/settings.c
+@@ -263,10 +263,12 @@ static struct settings * find_child_sett
+  */
+ static struct settings * autovivify_child_settings ( struct settings *parent,
+                                                    const char *name ) {
++      size_t nlen = strlen ( name ) + 1 /* NUL */;
+       struct {
+               struct generic_settings generic;
+-              char name[ strlen ( name ) + 1 /* NUL */ ];
++              char name[];
+       } *new_child;
++      size_t tlen = sizeof(*new_child) + nlen;
+       struct settings *settings;
+ 
+       /* Return existing settings, if existent */
+@@ -274,13 +276,13 @@ static struct settings * autovivify_chil
+               return settings;
+ 
+       /* Create new generic settings block */
+-      new_child = zalloc ( sizeof ( *new_child ) );
++      new_child = zalloc ( tlen );
+       if ( ! new_child ) {
+               DBGC ( parent, "Settings %p could not create child %s\n",
+                      parent, name );
+               return NULL;
+       }
+-      memcpy ( new_child->name, name, sizeof ( new_child->name ) );
++      memcpy ( new_child->name, name, nlen );
+       generic_settings_init ( &new_child->generic, NULL, new_child->name );
+       settings = &new_child->generic.settings;
+       register_settings ( settings, parent );
diff -r 785890495f41 -r 407720139237 sysutils/xenstoretools/patches/patch-.._.._ipxe_src_net_tls.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/xenstoretools/patches/patch-.._.._ipxe_src_net_tls.c     Thu Dec 29 23:12:23 2016 +0000
@@ -0,0 +1,69 @@
+$NetBSD: patch-.._.._ipxe_src_net_tls.c,v 1.1 2016/12/29 23:12:23 wiz Exp $
+
+--- ../../ipxe/src/net/tls.c.orig      2013-03-25 18:53:57.000000000 +0000
++++ ../../ipxe/src/net/tls.c
+@@ -650,18 +650,22 @@ static int tls_send_client_key_exchange 
+       RSA_CTX *rsa_ctx;
+       RSA_pub_key_new ( &rsa_ctx, tls->rsa.modulus, tls->rsa.modulus_len,
+                         tls->rsa.exponent, tls->rsa.exponent_len );
++      size_t elen = rsa_ctx->num_octets;
+       struct {
+               uint32_t type_length;
+               uint16_t encrypted_pre_master_secret_len;
+-              uint8_t encrypted_pre_master_secret[rsa_ctx->num_octets];
+-      } __attribute__ (( packed )) key_xchg;
+-
+-      memset ( &key_xchg, 0, sizeof ( key_xchg ) );
+-      key_xchg.type_length = ( cpu_to_le32 ( TLS_CLIENT_KEY_EXCHANGE ) |
+-                               htonl ( sizeof ( key_xchg ) -
+-                                       sizeof ( key_xchg.type_length ) ) );
+-      key_xchg.encrypted_pre_master_secret_len
+-              = htons ( sizeof ( key_xchg.encrypted_pre_master_secret ) );
++              uint8_t encrypted_pre_master_secret[];
++      } __attribute__ (( packed )) *key_xchg;
++      size_t klen = sizeof(*key_xchg) + elen;
++
++      key_xchg = alloca(klen);
++
++      memset ( key_xchg, 0, klen );
++      key_xchg->type_length = ( cpu_to_le32 ( TLS_CLIENT_KEY_EXCHANGE ) |
++                               htonl ( klen -
++                                       sizeof ( key_xchg->type_length ) ) );
++      key_xchg->encrypted_pre_master_secret_len
++              = htons ( elen );
+ 
+       /* FIXME: Hack alert */
+       DBGC ( tls, "RSA encrypting plaintext, modulus, exponent:\n" );
+@@ -671,14 +675,13 @@ static int tls_send_client_key_exchange 
+       DBGC_HD ( tls, tls->rsa.exponent, tls->rsa.exponent_len );
+       RSA_encrypt ( rsa_ctx, ( const uint8_t * ) &tls->pre_master_secret,
+                     sizeof ( tls->pre_master_secret ),
+-                    key_xchg.encrypted_pre_master_secret, 0 );
++                    key_xchg->encrypted_pre_master_secret, 0 );
+       DBGC ( tls, "RSA encrypt done.  Ciphertext:\n" );
+-      DBGC_HD ( tls, &key_xchg.encrypted_pre_master_secret,
+-                sizeof ( key_xchg.encrypted_pre_master_secret ) );
++      DBGC_HD ( tls, &key_xchg->encrypted_pre_master_secret, elen );
+       RSA_free ( rsa_ctx );
+ 
+ 
+-      return tls_send_handshake ( tls, &key_xchg, sizeof ( key_xchg ) );
++      return tls_send_handshake ( tls, key_xchg, klen );
+ }
+ 
+ /**
+@@ -802,12 +805,12 @@ static int tls_new_server_hello ( struct
+               uint8_t session_id_len;
+               char next[0];
+       } __attribute__ (( packed )) *hello_a = data;
++      size_t slen = hello_a->session_id_len;
+       struct {
+-              uint8_t session_id[hello_a->session_id_len];
+               uint16_t cipher_suite;
+               uint8_t compression_method;
+               char next[0];
+-      } __attribute__ (( packed )) *hello_b = ( void * ) &hello_a->next;
++      } __attribute__ (( packed )) *hello_b = ( void * ) ((uint8_t *)&hello_a->next + slen);
+       void *end = hello_b->next;
+       int rc;
+ 
diff -r 785890495f41 -r 407720139237 sysutils/xenstoretools/patches/patch-.._Config.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/xenstoretools/patches/patch-.._Config.mk Thu Dec 29 23:12:23 2016 +0000
@@ -0,0 +1,22 @@
+$NetBSD: patch-.._Config.mk,v 1.1 2016/12/29 23:12:23 wiz Exp $
+
+--- ../Config.mk.orig  2013-03-25 09:51:57.000000000 +0000
++++ ../Config.mk
+@@ -15,7 +15,7 @@ SHELL     ?= /bin/sh
+ # Tools to run on system hosting the build
+ HOSTCC      = gcc
+ HOSTCFLAGS  = -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer
+-HOSTCFLAGS += -fno-strict-aliasing
++HOSTCFLAGS += -fno-strict-aliasing ${EXTRA_HOSTCFLAGS}
+ 
+ DISTDIR     ?= $(XEN_ROOT)/dist
+ DESTDIR     ?= /
+@@ -141,6 +141,8 @@ CFLAGS += -Wall -Wstrict-prototypes
+ # result of any casted expression causes a warning.
+ CFLAGS += -Wno-unused-value
+ 
++CFLAGS += ${EXTRA_CFLAGS}
++
+ $(call cc-option-add,HOSTCFLAGS,HOSTCC,-Wdeclaration-after-statement)
+ $(call cc-option-add,CFLAGS,CC,-Wdeclaration-after-statement)
+ $(call cc-option-add,CFLAGS,CC,-Wno-unused-but-set-variable)
diff -r 785890495f41 -r 407720139237 sysutils/xenstoretools/patches/patch-CVE-2014-1950
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/xenstoretools/patches/patch-CVE-2014-1950        Thu Dec 29 23:12:23 2016 +0000
@@ -0,0 +1,14 @@
+$NetBSD: patch-CVE-2014-1950,v 1.1 2016/12/29 23:12:23 wiz Exp $
+
+http://lists.xenproject.org/archives/html/xen-announce/2014-02/msg00006.html
+
+--- libxc/xc_cpupool.c.orig    2014-02-12 16:27:31.000000000 +0000
++++ libxc/xc_cpupool.c 2014-02-12 16:28:11.000000000 +0000
+@@ -104,6 +104,7 @@ xc_cpupoolinfo_t *xc_cpupool_getinfo(xc_
+     info->cpumap = xc_cpumap_alloc(xch);
+     if (!info->cpumap) {
+         free(info);
++        info = NULL;
+         goto out;
+     }
+     info->cpupool_id = sysctl.u.cpupool_op.cpupool_id;
diff -r 785890495f41 -r 407720139237 sysutils/xenstoretools/patches/patch-CVE-2015-2752
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/xenstoretools/patches/patch-CVE-2015-2752        Thu Dec 29 23:12:23 2016 +0000
@@ -0,0 +1,83 @@
+$NetBSD: patch-CVE-2015-2752,v 1.1 2016/12/29 23:12:23 wiz Exp $
+
+Patch for CVE-2015-2752 aka XSA-125 from
+http://xenbits.xenproject.org/xsa/xsa125-4.2.patch
+
+--- libxc/xc_domain.c.orig     2013-09-10 06:42:18.000000000 +0000
++++ libxc/xc_domain.c
+@@ -1322,6 +1322,13 @@ int xc_domain_bind_pt_isa_irq(
+                                   PT_IRQ_TYPE_ISA, 0, 0, 0, machine_irq));
+ }
+ 
++#ifndef min
++#define min(X, Y) ({                             \
++            const typeof (X) _x = (X);           \
++            const typeof (Y) _y = (Y);           \
++            (void) (&_x == &_y);                 \
++            (_x < _y) ? _x : _y; })
++#endif
+ int xc_domain_memory_mapping(
+     xc_interface *xch,
+     uint32_t domid,
+@@ -1331,17 +1338,55 @@ int xc_domain_memory_mapping(
+     uint32_t add_mapping)
+ {
+     DECLARE_DOMCTL;
++    int ret = 0, err;
++    unsigned long done = 0, nr, max_batch_sz;
++
++    if ( !nr_mfns )
++        return 0;
+ 
+     domctl.cmd = XEN_DOMCTL_memory_mapping;
+     domctl.domain = domid;
+-    domctl.u.memory_mapping.first_gfn = first_gfn;
+-    domctl.u.memory_mapping.first_mfn = first_mfn;
+-    domctl.u.memory_mapping.nr_mfns = nr_mfns;
+     domctl.u.memory_mapping.add_mapping = add_mapping;
++    max_batch_sz = nr_mfns;
++    do
++    {
++        nr = min(nr_mfns - done, max_batch_sz);
++        domctl.u.memory_mapping.nr_mfns = nr;
++        domctl.u.memory_mapping.first_gfn = first_gfn + done;
++        domctl.u.memory_mapping.first_mfn = first_mfn + done;
++        err = do_domctl(xch, &domctl);
++        if ( err && errno == E2BIG )
++        {
++            if ( max_batch_sz <= 1 )
++                break;
++            max_batch_sz >>= 1;
++            continue;
++        }
++        /* Save the first error... */
++        if ( !ret )
++            ret = err;
++        /* .. and ignore the rest of them when removing. */
++        if ( err && add_mapping != DPCI_REMOVE_MAPPING )
++            break;
++
++        done += nr;
++    } while ( done < nr_mfns );
++
++    /*
++     * Undo what we have done unless unmapping, by unmapping the entire region.
++     * Errors here are ignored.
++     */
++    if ( ret && add_mapping != DPCI_REMOVE_MAPPING )
++        xc_domain_memory_mapping(xch, domid, first_gfn, first_mfn, nr_mfns,
++                                 DPCI_REMOVE_MAPPING);
++
++    /* We might get E2BIG so many times that we never advance. */
++    if ( !done && !ret )
++        ret = -1;
+ 
+-    return do_domctl(xch, &domctl);
++    return ret;
+ }
+-
++#undef min
+ int xc_domain_ioport_mapping(
+     xc_interface *xch,
+     uint32_t domid,
+
diff -r 785890495f41 -r 407720139237 sysutils/xenstoretools/patches/patch-CVE-2015-2756
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/xenstoretools/patches/patch-CVE-2015-2756        Thu Dec 29 23:12:23 2016 +0000
@@ -0,0 +1,142 @@
+$NetBSD: patch-CVE-2015-2756,v 1.1 2016/12/29 23:12:23 wiz Exp $
+
+patch for CVE-2015-2756 aka XSA-126 from
+http://xenbits.xenproject.org/xsa/xsa126-qemut.patch
+
+--- ioemu-qemu-xen/hw/pass-through.c.orig      2013-07-17 10:59:40.000000000 +0000



Home | Main Index | Thread Index | Old Index