From c577568738c9b2abf9e39ab4a0a553e6e1626949 Mon Sep 17 00:00:00 2001 From: Michael Young Date: Mar 01 2017 20:38:20 +0000 Subject: actually include one of the XSA-209 patches mingw64-binutils no longer needed for building efi for x86_64 on fc26+ canonicalize is now a maths function in ISO C so rename use in xenstore (#1422460) --- diff --git a/xen.canonicalize.patch b/xen.canonicalize.patch new file mode 100644 index 0000000..19ddd7d --- /dev/null +++ b/xen.canonicalize.patch @@ -0,0 +1,163 @@ +--- xen-4.8.0/tools/xenstore/xenstored_watch.c.orig 2016-12-05 12:03:27.000000000 +0000 ++++ xen-4.8.0/tools/xenstore/xenstored_watch.c 2017-02-26 21:48:37.990376356 +0000 +@@ -141,7 +141,7 @@ + /* check if valid event */ + } else { + relative = !strstarts(vec[0], "/"); +- vec[0] = canonicalize(conn, vec[0]); ++ vec[0] = xenstore_canonicalize(conn, vec[0]); + if (!is_valid_nodename(vec[0])) { + send_error(conn, EINVAL); + return; +@@ -192,7 +192,7 @@ + return; + } + +- node = canonicalize(conn, vec[0]); ++ node = xenstore_canonicalize(conn, vec[0]); + list_for_each_entry(watch, &conn->watches, list) { + if (streq(watch->node, node) && streq(watch->token, vec[1])) { + list_del(&watch->list); +--- xen-4.8.0/tools/xenstore/xenstored_core.c.orig 2016-12-05 12:03:27.000000000 +0000 ++++ xen-4.8.0/tools/xenstore/xenstored_core.c 2017-02-26 21:49:35.834496009 +0000 +@@ -771,7 +771,7 @@ + return strings; + } + +-char *canonicalize(struct connection *conn, const char *node) ++char *xenstore_canonicalize(struct connection *conn, const char *node) + { + const char *prefix; + +@@ -797,7 +797,7 @@ + struct node *node; + const char *name = onearg(in); + +- name = canonicalize(conn, name); ++ name = xenstore_canonicalize(conn, name); + node = get_node(conn, in, name, XS_PERM_READ); + if (!node) { + send_error(conn, errno); +@@ -812,7 +812,7 @@ + struct node *node; + const char *name = onearg(in); + +- name = canonicalize(conn, name); ++ name = xenstore_canonicalize(conn, name); + node = get_node(conn, in, name, XS_PERM_READ); + if (!node) { + send_error(conn, errno); +@@ -949,7 +949,7 @@ + offset = strlen(vec[0]) + 1; + datalen = in->used - offset; + +- name = canonicalize(conn, vec[0]); ++ name = xenstore_canonicalize(conn, vec[0]); + node = get_node(conn, in, name, XS_PERM_WRITE); + if (!node) { + /* No permissions, invalid input? */ +@@ -987,7 +987,7 @@ + return; + } + +- name = canonicalize(conn, name); ++ name = xenstore_canonicalize(conn, name); + node = get_node(conn, in, name, XS_PERM_WRITE); + + /* If it already exists, fine. */ +@@ -1105,7 +1105,7 @@ + struct node *node; + const char *name = onearg(in); + +- name = canonicalize(conn, name); ++ name = xenstore_canonicalize(conn, name); + node = get_node(conn, in, name, XS_PERM_WRITE); + if (!node) { + /* Didn't exist already? Fine, if parent exists. */ +@@ -1142,7 +1142,7 @@ + char *strings; + unsigned int len; + +- name = canonicalize(conn, name); ++ name = xenstore_canonicalize(conn, name); + node = get_node(conn, in, name, XS_PERM_READ); + if (!node) { + send_error(conn, errno); +@@ -1170,7 +1170,7 @@ + } + + /* First arg is node name. */ +- name = canonicalize(conn, in->buffer); ++ name = xenstore_canonicalize(conn, in->buffer); + permstr = in->buffer + strlen(in->buffer) + 1; + num--; + +--- xen-4.8.0/tools/xenstore/xenstored_core.h.orig 2016-12-05 12:03:27.000000000 +0000 ++++ xen-4.8.0/tools/xenstore/xenstored_core.h 2017-02-26 21:50:04.480545722 +0000 +@@ -142,7 +142,7 @@ + void send_error(struct connection *conn, int error); + + /* Canonicalize this path if possible. */ +-char *canonicalize(struct connection *conn, const char *node); ++char *xenstore_canonicalize(struct connection *conn, const char *node); + + /* Check if node is an event node. */ + bool check_event_node(const char *node); +--- xen-4.8.0/tools/console/testsuite/console-dom0.c.orig 2016-12-05 12:03:27.000000000 +0000 ++++ xen-4.8.0/tools/console/testsuite/console-dom0.c 2017-02-26 21:52:24.554678631 +0000 +@@ -18,7 +18,7 @@ + } + } + +-static void canonicalize(char *buffer) ++static void xenstore_canonicalize(char *buffer) + { + char *reader, *writer; + +@@ -51,7 +51,7 @@ + tcsetattr(STDOUT_FILENO, TCSAFLUSH, &term); + + while ((line = fgets(buffer, sizeof(buffer), stdin))) { +- canonicalize(line); ++ xenstore_canonicalize(line); + + if (strcmp(line, "!!!XEN Test Begin!!!\n") == 0) { + break; +@@ -76,7 +76,7 @@ + return 1; + } + +- canonicalize(line); ++ xenstore_canonicalize(line); + if (strcmp(line, "Seed Okay.\n") != 0) { + fprintf(stderr, "Incorrect seed acknowledgement.\n"); + fprintf(stderr, "[%s]", line); +@@ -104,7 +104,7 @@ + return 1; + } + +- canonicalize(line); ++ xenstore_canonicalize(line); + fprintf(stderr, "%s", line); + } while (strcmp(line, "Okay.\n") != 0); + +--- xen-4.8.0/tools/console/testsuite/console-domU.c.orig 2016-12-05 12:03:27.000000000 +0000 ++++ xen-4.8.0/tools/console/testsuite/console-domU.c 2017-02-26 21:52:50.320622804 +0000 +@@ -6,7 +6,7 @@ + #include + #include + +-static void canonicalize(char *buffer) ++static void xenstore_canonicalize(char *buffer) + { + char *reader, *writer; + +@@ -45,7 +45,7 @@ + return 1; + } + +- canonicalize(line); ++ xenstore_canonicalize(line); + seed = strtoul(line, 0, 0); + + printf("Seed Okay.\n"); fflush(stdout); diff --git a/xen.fedora.efi.build.patch b/xen.fedora.efi.build.patch index 290065a..747faa7 100644 --- a/xen.fedora.efi.build.patch +++ b/xen.fedora.efi.build.patch @@ -1,6 +1,14 @@ ---- xen-4.7.0/xen/arch/x86/Makefile.orig 2015-11-17 11:58:03.000000000 +0000 -+++ xen-4.7.0/xen/arch/x86/Makefile 2015-12-02 20:37:06.659988893 +0000 -@@ -132,20 +132,20 @@ +--- xen-4.8.0/xen/arch/x86/Makefile.orig 2016-12-05 12:03:27.000000000 +0000 ++++ xen-4.8.0/xen/arch/x86/Makefile 2017-02-28 00:02:27.989589825 +0000 +@@ -73,6 +73,7 @@ + efi-y := $(shell if [ ! -r $(BASEDIR)/include/xen/compile.h -o \ + -O $(BASEDIR)/include/xen/compile.h ]; then \ + echo '$(TARGET).efi'; fi) ++LD_EFI ?= $(LD) + + ifneq ($(build_id_linker),) + notes_phdrs = --notes +@@ -173,20 +174,20 @@ $(TARGET).efi: prelink-efi.o $(note_file) efi.lds efi/relocs-dummy.o $(BASEDIR)/common/symbols-dummy.o efi/mkreloc $(foreach base, $(VIRT_BASE) $(ALT_BASE), \ @@ -24,9 +32,15 @@ $(@D)/.$(@F).1r.o $(@D)/.$(@F).1s.o $(note_file) -o $@ if $(guard) false; then rm -f $@; echo 'EFI support disabled'; \ else $(NM) -pa --format=sysv $(@D)/$(@F) \ ---- xen-4.7.0/xen/arch/x86/efi/Makefile.orig 2016-01-17 15:19:00.906417625 +0000 -+++ xen-4.7.0/xen/arch/x86/efi/Makefile 2016-01-17 15:21:21.135489438 +0000 -@@ -6,7 +6,7 @@ +--- xen-4.8.0/xen/arch/x86/efi/Makefile.orig 2016-12-05 12:03:27.000000000 +0000 ++++ xen-4.8.0/xen/arch/x86/efi/Makefile 2017-02-28 00:02:44.704192006 +0000 +@@ -1,4 +1,5 @@ + CFLAGS += -fshort-wchar ++LD_EFI ?= $(LD) + + obj-y += stub.o + +@@ -6,7 +7,7 @@ efi := y$(shell rm -f disabled) efi := $(if $(efi),$(shell $(CC) $(filter-out $(CFLAGS-y) .%.d,$(CFLAGS)) -c check.c 2>disabled && echo y)) @@ -35,14 +49,13 @@ efi := $(if $(efi),$(shell rm disabled)y,$(shell $(call create,boot.init.o); $(call create,runtime.o))) extra-$(efi) += boot.init.o relocs-dummy.o runtime.o compat.o buildid.o ---- xen-4.7.0/xen/Makefile.orig 2016-01-17 15:19:00.907417661 +0000 -+++ xen-4.7.0/xen/Makefile 2016-01-17 15:25:22.916243997 +0000 -@@ -19,6 +19,8 @@ +--- xen-4.8.0/xen/Makefile.orig 2016-12-05 12:03:27.000000000 +0000 ++++ xen-4.8.0/xen/Makefile 2017-02-28 00:02:54.080529810 +0000 +@@ -20,6 +20,7 @@ MAKEFLAGS += -rR EFI_MOUNTPOINT ?= $(BOOT_DIR)/efi +EFI_VENDOR=fedora -+LD_EFI ?= $(LD) ARCH=$(XEN_TARGET_ARCH) SRCARCH=$(shell echo $(ARCH) | sed -e 's/x86.*/x86/' -e s'/arm\(32\|64\)/arm/g') diff --git a/xen.spec b/xen.spec index d8a8ffd..fc2f647 100644 --- a/xen.spec +++ b/xen.spec @@ -29,6 +29,15 @@ %ifnarch x86_64 aarch64 %define build_efi 0 %endif +%if %build_efi && "%dist" < ".fc26" +%ifarch x86_64 +%define efiming 1 +%else +%define efiming 0 +%endif +%else +%define efiming 0 +%endif %if "%dist" >= ".fc20" %define with_systemd_presets 1 %else @@ -41,7 +50,7 @@ Summary: Xen is a virtual machine monitor Name: xen Version: 4.8.0 -Release: 6%{?dist} +Release: 7%{?dist} Group: Development/Libraries License: GPLv2+ and LGPLv2+ and BSD URL: http://xen.org/ @@ -120,6 +129,7 @@ Patch60: xsa209-qemut.patch Patch61: xsa209-qemuu-0001-display-cirrus-ignore-source-pitch-value-as-needed-i.patch Patch62: xsa209-qemuu-0002-cirrus-add-blit_is_unsafe-call-to-cirrus_bitblt_cput.patch Patch63: xsa210.patch +Patch64: xen.canonicalize.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root @@ -181,11 +191,9 @@ ExclusiveArch: %{ix86} x86_64 armv7hl aarch64 BuildRequires: ocaml, ocaml-findlib %endif # efi image needs an ld that has -mi386pep option -%if %build_efi -%ifarch x86_64 +%if %efiming BuildRequires: mingw64-binutils %endif -%endif %if %with_systemd_presets Requires(post): systemd Requires(preun): systemd @@ -326,6 +334,7 @@ manage Xen virtual machines. %patch58 -p1 %patch59 -p1 %patch63 -p1 +%patch64 -p1 # qemu-xen-traditional patches pushd tools/qemu-xen-traditional @@ -362,6 +371,7 @@ pushd tools/qemu-xen %patch55 -p1 %patch57 -p1 %patch61 -p1 +%patch62 -p1 popd # stubdom sources @@ -374,10 +384,10 @@ cp -v %{SOURCE21} xen/.config %if !%build_ocaml %define ocaml_flags OCAML_TOOLS=n %endif -%if %build_efi -%ifarch x86_64 +%if %efiming %define efi_flags LD_EFI=/usr/x86_64-w64-mingw32/bin/ld %endif +%if %build_efi mkdir -p dist/install/boot/efi/efi/fedora %endif %if %(test -f /usr/share/seabios/bios-256k.bin && echo 1|| echo 0) @@ -863,6 +873,12 @@ rm -rf %{buildroot} %endif %changelog +* Wed Mar 01 2017 Michael Young - 4.8.0-7 +- actually include one of the XSA-209 patches +- mingw64-binutils no longer needed for building efi for x86_64 on fc26+ +- canonicalize is now a maths function in ISO C so rename use in xenstore + (#1422460) + * Sat Feb 25 2017 Michael Young - 4.8.0-6 - update patches for XSA-209 - arm: memory corruption when freeing p2m pages [XSA-210] (#1426327)