diff options
| author | Christopher Clark <christopher.w.clark@gmail.com> | 2018-07-31 12:35:42 -0700 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2018-08-02 22:57:14 -0400 |
| commit | 9955e81b23eb6bb264b32c5bb02b326097a4ec02 (patch) | |
| tree | 5aa96388dcf449b2b9f5b8bce380a0e35941d42a | |
| parent | 02d2c7daeb5b3edd83b850eb5397d0b297a11c8a (diff) | |
| download | meta-virtualization-9955e81b23eb6bb264b32c5bb02b326097a4ec02.tar.gz | |
xen: upgrade to 4.10.1, and apply patches for gcc 8.1 compatibility
Adds packaging for new binary: xen-shim.
Builds the hypervisor before building the tools to workaround an upstream
parallel build bug that causes the shim to be rebuilt during install.
Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
12 files changed, 409 insertions, 38 deletions
diff --git a/recipes-extended/xen/files/shim-don-t-let-build-modify-shim.config.patch b/recipes-extended/xen/files/shim-don-t-let-build-modify-shim.config.patch new file mode 100644 index 00000000..74035283 --- /dev/null +++ b/recipes-extended/xen/files/shim-don-t-let-build-modify-shim.config.patch | |||
| @@ -0,0 +1,47 @@ | |||
| 1 | From 8717e7417cebeae162fd61ea4cbdcdd422748f08 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Juergen Gross <jgross@suse.com> | ||
| 3 | Date: Fri, 20 Apr 2018 17:47:55 +0200 | ||
| 4 | Subject: [PATCH] shim: don't let build modify shim.config | ||
| 5 | |||
| 6 | Currently building the shim will modify shim.config in case some config | ||
| 7 | option was added or modified in the hypervisor. | ||
| 8 | |||
| 9 | Avoid that by copying shim.config to an intermediate file instead. | ||
| 10 | |||
| 11 | Signed-off-by: Juergen Gross <jgross@suse.com> | ||
| 12 | Reviewed-by: Jan Beulich <jbeulich@suse.com> | ||
| 13 | Acked-by: Wei Liu <wei.liu2@citrix.com> | ||
| 14 | --- | ||
| 15 | tools/firmware/xen-dir/Makefile | 16 ++++++---------- | ||
| 16 | 1 file changed, 6 insertions(+), 10 deletions(-) | ||
| 17 | |||
| 18 | diff --git a/tools/firmware/xen-dir/Makefile b/tools/firmware/xen-dir/Makefile | ||
| 19 | index a7e69ae..84648c3 100644 | ||
| 20 | --- a/tools/firmware/xen-dir/Makefile | ||
| 21 | +++ b/tools/firmware/xen-dir/Makefile | ||
| 22 | @@ -41,16 +41,12 @@ linkfarm.stamp: $(DEP_DIRS) $(DEP_FILES) FORCE | ||
| 23 | $(D): linkfarm.stamp | ||
| 24 | $(MAKE) -C $(D)/xen distclean | ||
| 25 | |||
| 26 | -.PHONY: shim-%config | ||
| 27 | -shim-%config: $(D) FORCE | ||
| 28 | - $(MAKE) -C $(D)/xen $*config \ | ||
| 29 | - XEN_CONFIG_EXPERT=y \ | ||
| 30 | - KCONFIG_CONFIG=$(CURDIR)/shim.config | ||
| 31 | - | ||
| 32 | -xen-shim: $(D) shim-olddefconfig | ||
| 33 | - $(MAKE) -C $(D)/xen build \ | ||
| 34 | - XEN_CONFIG_EXPERT=y \ | ||
| 35 | - KCONFIG_CONFIG=$(CURDIR)/shim.config | ||
| 36 | +$(D)/xen/.config: shim.config $(D) | ||
| 37 | + cp $< $@ | ||
| 38 | + $(MAKE) -C $(@D) olddefconfig XEN_CONFIG_EXPERT=y | ||
| 39 | + | ||
| 40 | +xen-shim: $(D)/xen/.config | ||
| 41 | + $(MAKE) -C $(<D) build XEN_CONFIG_EXPERT=y | ||
| 42 | ln -sf $(D)/xen/xen $@ | ||
| 43 | ln -sf $(D)/xen/xen-syms $@-syms | ||
| 44 | |||
| 45 | -- | ||
| 46 | 2.7.4 | ||
| 47 | |||
diff --git a/recipes-extended/xen/files/tools-gdbsx-fix-Wstringop-truncation-warning.patch b/recipes-extended/xen/files/tools-gdbsx-fix-Wstringop-truncation-warning.patch new file mode 100644 index 00000000..2896d9f2 --- /dev/null +++ b/recipes-extended/xen/files/tools-gdbsx-fix-Wstringop-truncation-warning.patch | |||
| @@ -0,0 +1,41 @@ | |||
| 1 | From 7f601f7c341c80d554615556d60e3b8ed1e5ad4f Mon Sep 17 00:00:00 2001 | ||
| 2 | From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= | ||
| 3 | <marmarek@invisiblethingslab.com> | ||
| 4 | Date: Thu, 5 Apr 2018 03:50:54 +0200 | ||
| 5 | Subject: [PATCH] tools/gdbsx: fix -Wstringop-truncation warning | ||
| 6 | MIME-Version: 1.0 | ||
| 7 | Content-Type: text/plain; charset=UTF-8 | ||
| 8 | Content-Transfer-Encoding: 8bit | ||
| 9 | |||
| 10 | gcc-8 complains: | ||
| 11 | |||
| 12 | gx_main.c: In function 'prepare_stop_reply': | ||
| 13 | gx_main.c:385:9: error: 'strncpy' output truncated before terminating nul copying 6 bytes from a string of the same length [-Werror=stringop-truncation] | ||
| 14 | strncpy(buf, "watch:", 6); | ||
| 15 | ^~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| 16 | |||
| 17 | Since terminating '\0' isn't needed here at all, switch to memcpy. | ||
| 18 | |||
| 19 | Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com> | ||
| 20 | Acked-by: Wei Liu <wei.liu2@citrix.com> | ||
| 21 | Release-Acked-by: Juergen Gross <jgross@suse.com> | ||
| 22 | --- | ||
| 23 | tools/debugger/gdbsx/gx/gx_main.c | 2 +- | ||
| 24 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 25 | |||
| 26 | diff --git a/tools/debugger/gdbsx/gx/gx_main.c b/tools/debugger/gdbsx/gx/gx_main.c | ||
| 27 | index a908c45..6dfa501 100644 | ||
| 28 | --- a/tools/debugger/gdbsx/gx/gx_main.c | ||
| 29 | +++ b/tools/debugger/gdbsx/gx/gx_main.c | ||
| 30 | @@ -382,7 +382,7 @@ prepare_stop_reply(enum target_signal sig, char *buf, vcpuid_t vcpu) | ||
| 31 | |||
| 32 | /* TBD: check if we stopped because of watchpoint */ | ||
| 33 | if (watchpoint_stop()) { | ||
| 34 | - strncpy(buf, "watch:", 6); | ||
| 35 | + memcpy(buf, "watch:", 6); | ||
| 36 | buf += 6; | ||
| 37 | /* TBD: **/ | ||
| 38 | } | ||
| 39 | -- | ||
| 40 | 2.7.4 | ||
| 41 | |||
diff --git a/recipes-extended/xen/files/tools-kdd-mute-spurious-gcc-warning-part1.patch b/recipes-extended/xen/files/tools-kdd-mute-spurious-gcc-warning-part1.patch new file mode 100644 index 00000000..f94d22c5 --- /dev/null +++ b/recipes-extended/xen/files/tools-kdd-mute-spurious-gcc-warning-part1.patch | |||
| @@ -0,0 +1,47 @@ | |||
| 1 | From 437e00fea04becc91c1b6bc1c0baa636b067a5cc Mon Sep 17 00:00:00 2001 | ||
| 2 | From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= | ||
| 3 | <marmarek@invisiblethingslab.com> | ||
| 4 | Date: Thu, 5 Apr 2018 03:50:55 +0200 | ||
| 5 | Subject: [PATCH] tools/kdd: mute spurious gcc warning | ||
| 6 | MIME-Version: 1.0 | ||
| 7 | Content-Type: text/plain; charset=UTF-8 | ||
| 8 | Content-Transfer-Encoding: 8bit | ||
| 9 | |||
| 10 | gcc-8 complains: | ||
| 11 | |||
| 12 | kdd.c:698:13: error: 'memcpy' offset [-204, -717] is out of the bounds [0, 216] of object 'ctrl' with type 'kdd_ctrl' {aka 'union <anonymous>'} [-Werror=array-bounds] | ||
| 13 | memcpy(buf, ((uint8_t *)&ctrl.c32) + offset, len); | ||
| 14 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| 15 | kdd.c: In function 'kdd_select_callback': | ||
| 16 | kdd.c:642:14: note: 'ctrl' declared here | ||
| 17 | kdd_ctrl ctrl; | ||
| 18 | ^~~~ | ||
| 19 | |||
| 20 | But this is impossible - 'offset' is unsigned and correctly validated | ||
| 21 | few lines before. | ||
| 22 | |||
| 23 | Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com> | ||
| 24 | Acked-by: Wei Liu <wei.liu2@citrix.com> | ||
| 25 | Release-Acked-by: Juergen Gross <jgross@suse.com> | ||
| 26 | --- | ||
| 27 | tools/debugger/kdd/kdd.c | 3 +++ | ||
| 28 | 1 file changed, 3 insertions(+) | ||
| 29 | |||
| 30 | diff --git a/tools/debugger/kdd/kdd.c b/tools/debugger/kdd/kdd.c | ||
| 31 | index 1bd5dd5..61d769e 100644 | ||
| 32 | --- a/tools/debugger/kdd/kdd.c | ||
| 33 | +++ b/tools/debugger/kdd/kdd.c | ||
| 34 | @@ -695,7 +695,10 @@ static void kdd_handle_read_ctrl(kdd_state *s) | ||
| 35 | KDD_LOG(s, "Request outside of known control space\n"); | ||
| 36 | len = 0; | ||
| 37 | } else { | ||
| 38 | +#pragma GCC diagnostic push | ||
| 39 | +#pragma GCC diagnostic ignored "-Warray-bounds" | ||
| 40 | memcpy(buf, ((uint8_t *)&ctrl.c32) + offset, len); | ||
| 41 | +#pragma GCC diagnostic pop | ||
| 42 | } | ||
| 43 | } | ||
| 44 | |||
| 45 | -- | ||
| 46 | 2.7.4 | ||
| 47 | |||
diff --git a/recipes-extended/xen/files/tools-kdd-mute-spurious-gcc-warning-part2.patch b/recipes-extended/xen/files/tools-kdd-mute-spurious-gcc-warning-part2.patch new file mode 100644 index 00000000..afd14231 --- /dev/null +++ b/recipes-extended/xen/files/tools-kdd-mute-spurious-gcc-warning-part2.patch | |||
| @@ -0,0 +1,52 @@ | |||
| 1 | From 2de2b10b2252761baa5dd0077df384dbfcca8212 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= | ||
| 3 | <marmarek@invisiblethingslab.com> | ||
| 4 | Date: Tue, 22 May 2018 21:47:45 +0200 | ||
| 5 | Subject: [PATCH] tools/kdd: alternative way of muting spurious gcc warning | ||
| 6 | MIME-Version: 1.0 | ||
| 7 | Content-Type: text/plain; charset=UTF-8 | ||
| 8 | Content-Transfer-Encoding: 8bit | ||
| 9 | |||
| 10 | Older gcc does not support #pragma GCC diagnostics, so use alternative | ||
| 11 | approach - change variable type to uint32_t (this code handle 32-bit | ||
| 12 | requests only anyway), which apparently also avoid gcc complaining about | ||
| 13 | this (otherwise correct) code. | ||
| 14 | |||
| 15 | Fixes 437e00fea04becc91c1b6bc1c0baa636b067a5cc "tools/kdd: mute spurious | ||
| 16 | gcc warning" | ||
| 17 | |||
| 18 | Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com> | ||
| 19 | Acked-by: Wei Liu <wei.liu2@citrix.com> | ||
| 20 | Release-acked-by: Juergen Gross <jgross@suse.com> | ||
| 21 | Acked-by: Tim Deegan <tim@xen.org> | ||
| 22 | --- | ||
| 23 | tools/debugger/kdd/kdd.c | 5 +---- | ||
| 24 | 1 file changed, 1 insertion(+), 4 deletions(-) | ||
| 25 | |||
| 26 | diff --git a/tools/debugger/kdd/kdd.c b/tools/debugger/kdd/kdd.c | ||
| 27 | index 61d769e..5a019a0 100644 | ||
| 28 | --- a/tools/debugger/kdd/kdd.c | ||
| 29 | +++ b/tools/debugger/kdd/kdd.c | ||
| 30 | @@ -687,7 +687,7 @@ static void kdd_handle_read_ctrl(kdd_state *s) | ||
| 31 | } | ||
| 32 | } else { | ||
| 33 | /* 32-bit control-register space starts at 0x[2]cc, for 84 bytes */ | ||
| 34 | - uint64_t offset = addr; | ||
| 35 | + uint32_t offset = addr; | ||
| 36 | if (offset > 0x200) | ||
| 37 | offset -= 0x200; | ||
| 38 | offset -= 0xcc; | ||
| 39 | @@ -695,10 +695,7 @@ static void kdd_handle_read_ctrl(kdd_state *s) | ||
| 40 | KDD_LOG(s, "Request outside of known control space\n"); | ||
| 41 | len = 0; | ||
| 42 | } else { | ||
| 43 | -#pragma GCC diagnostic push | ||
| 44 | -#pragma GCC diagnostic ignored "-Warray-bounds" | ||
| 45 | memcpy(buf, ((uint8_t *)&ctrl.c32) + offset, len); | ||
| 46 | -#pragma GCC diagnostic pop | ||
| 47 | } | ||
| 48 | } | ||
| 49 | |||
| 50 | -- | ||
| 51 | 2.7.4 | ||
| 52 | |||
diff --git a/recipes-extended/xen/files/tools-libxc-fix-strncpy-size.patch b/recipes-extended/xen/files/tools-libxc-fix-strncpy-size.patch new file mode 100644 index 00000000..2d606cd3 --- /dev/null +++ b/recipes-extended/xen/files/tools-libxc-fix-strncpy-size.patch | |||
| @@ -0,0 +1,44 @@ | |||
| 1 | From fa7789ef18bd2e716997937af71b2e4b5b00a159 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= | ||
| 3 | <marmarek@invisiblethingslab.com> | ||
| 4 | Date: Thu, 5 Apr 2018 03:50:49 +0200 | ||
| 5 | Subject: [PATCH] tools/libxc: fix strncpy size | ||
| 6 | MIME-Version: 1.0 | ||
| 7 | Content-Type: text/plain; charset=UTF-8 | ||
| 8 | Content-Transfer-Encoding: 8bit | ||
| 9 | |||
| 10 | gcc-8 warns about possible truncation of trailing '\0'. | ||
| 11 | Final character is overridden by '\0' anyway, so don't bother to copy | ||
| 12 | it. | ||
| 13 | |||
| 14 | This fixes compile failure: | ||
| 15 | |||
| 16 | xc_pm.c: In function 'xc_set_cpufreq_gov': | ||
| 17 | xc_pm.c:308:5: error: 'strncpy' specified bound 16 equals destination size [-Werror=stringop-truncation] | ||
| 18 | strncpy(scaling_governor, govname, CPUFREQ_NAME_LEN); | ||
| 19 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| 20 | cc1: all warnings being treated as errors | ||
| 21 | |||
| 22 | Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com> | ||
| 23 | Acked-by: Wei Liu <wei.liu2@citrix.com> | ||
| 24 | Release-Acked-by: Juergen Gross <jgross@suse.com> | ||
| 25 | --- | ||
| 26 | tools/libxc/xc_pm.c | 2 +- | ||
| 27 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 28 | |||
| 29 | diff --git a/tools/libxc/xc_pm.c b/tools/libxc/xc_pm.c | ||
| 30 | index 67e2418..6f8d548 100644 | ||
| 31 | --- a/tools/libxc/xc_pm.c | ||
| 32 | +++ b/tools/libxc/xc_pm.c | ||
| 33 | @@ -305,7 +305,7 @@ int xc_set_cpufreq_gov(xc_interface *xch, int cpuid, char *govname) | ||
| 34 | sysctl.cmd = XEN_SYSCTL_pm_op; | ||
| 35 | sysctl.u.pm_op.cmd = SET_CPUFREQ_GOV; | ||
| 36 | sysctl.u.pm_op.cpuid = cpuid; | ||
| 37 | - strncpy(scaling_governor, govname, CPUFREQ_NAME_LEN); | ||
| 38 | + strncpy(scaling_governor, govname, CPUFREQ_NAME_LEN - 1); | ||
| 39 | scaling_governor[CPUFREQ_NAME_LEN - 1] = '\0'; | ||
| 40 | |||
| 41 | return xc_sysctl(xch, &sysctl); | ||
| 42 | -- | ||
| 43 | 2.7.4 | ||
| 44 | |||
diff --git a/recipes-extended/xen/files/tools-misc-fix-hypothetical-buffer-overflow.patch b/recipes-extended/xen/files/tools-misc-fix-hypothetical-buffer-overflow.patch new file mode 100644 index 00000000..a4998619 --- /dev/null +++ b/recipes-extended/xen/files/tools-misc-fix-hypothetical-buffer-overflow.patch | |||
| @@ -0,0 +1,46 @@ | |||
| 1 | From 27751d89248c8c5eef6d8b56eb8f7d2084145080 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= | ||
| 3 | <marmarek@invisiblethingslab.com> | ||
| 4 | Date: Thu, 5 Apr 2018 03:50:50 +0200 | ||
| 5 | Subject: [PATCH] tools/misc: fix hypothetical buffer overflow in xen-lowmemd | ||
| 6 | MIME-Version: 1.0 | ||
| 7 | Content-Type: text/plain; charset=UTF-8 | ||
| 8 | Content-Transfer-Encoding: 8bit | ||
| 9 | |||
| 10 | gcc-8 complains: | ||
| 11 | |||
| 12 | xen-lowmemd.c: In function 'handle_low_mem': | ||
| 13 | xen-lowmemd.c:80:55: error: '%s' directive output may be truncated writing up to 511 bytes into a region of size 489 [-Werror=format-truncation=] | ||
| 14 | snprintf(error, BUFSZ,"Failed to write target %s to xenstore", data); | ||
| 15 | ^~ ~~~~ | ||
| 16 | xen-lowmemd.c:80:9: note: 'snprintf' output between 36 and 547 bytes into a destination of size 512 | ||
| 17 | snprintf(error, BUFSZ,"Failed to write target %s to xenstore", data); | ||
| 18 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| 19 | |||
| 20 | In practice it wouldn't happen, because 'data' contains string | ||
| 21 | representation of 64-bit unsigned number (20 characters at most). | ||
| 22 | But place a limit to mute gcc warning. | ||
| 23 | |||
| 24 | Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com> | ||
| 25 | Acked-by: Wei Liu <wei.liu2@citrix.com> | ||
| 26 | Release-Acked-by: Juergen Gross <jgross@suse.com> | ||
| 27 | --- | ||
| 28 | tools/misc/xen-lowmemd.c | 2 +- | ||
| 29 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 30 | |||
| 31 | diff --git a/tools/misc/xen-lowmemd.c b/tools/misc/xen-lowmemd.c | ||
| 32 | index 865a54c..79ad34c 100644 | ||
| 33 | --- a/tools/misc/xen-lowmemd.c | ||
| 34 | +++ b/tools/misc/xen-lowmemd.c | ||
| 35 | @@ -77,7 +77,7 @@ void handle_low_mem(void) | ||
| 36 | if (!xs_write(xs_handle, XBT_NULL, | ||
| 37 | "/local/domain/0/memory/target", data, strlen(data))) | ||
| 38 | { | ||
| 39 | - snprintf(error, BUFSZ,"Failed to write target %s to xenstore", data); | ||
| 40 | + snprintf(error, BUFSZ,"Failed to write target %.24s to xenstore", data); | ||
| 41 | perror(error); | ||
| 42 | } | ||
| 43 | } | ||
| 44 | -- | ||
| 45 | 2.7.4 | ||
| 46 | |||
diff --git a/recipes-extended/xen/files/tools-xenpmd-fix-possible-0-truncation.patch b/recipes-extended/xen/files/tools-xenpmd-fix-possible-0-truncation.patch new file mode 100644 index 00000000..86a8e35f --- /dev/null +++ b/recipes-extended/xen/files/tools-xenpmd-fix-possible-0-truncation.patch | |||
| @@ -0,0 +1,74 @@ | |||
| 1 | From 938c8f53b1f80175c6f7a1399efdb984abb0cb8b Mon Sep 17 00:00:00 2001 | ||
| 2 | From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= | ||
| 3 | <marmarek@invisiblethingslab.com> | ||
| 4 | Date: Thu, 5 Apr 2018 03:50:53 +0200 | ||
| 5 | Subject: [PATCH] tools/xenpmd: fix possible '\0' truncation | ||
| 6 | MIME-Version: 1.0 | ||
| 7 | Content-Type: text/plain; charset=UTF-8 | ||
| 8 | Content-Transfer-Encoding: 8bit | ||
| 9 | |||
| 10 | gcc-8 complains: | ||
| 11 | xenpmd.c:207:9: error: 'strncpy' specified bound 32 equals destination size [-Werror=stringop-truncation] | ||
| 12 | strncpy(info->oem_info, attrib_value, 32); | ||
| 13 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| 14 | xenpmd.c:201:9: error: 'strncpy' specified bound 32 equals destination size [-Werror=stringop-truncation] | ||
| 15 | strncpy(info->battery_type, attrib_value, 32); | ||
| 16 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| 17 | xenpmd.c:195:9: error: 'strncpy' specified bound 32 equals destination size [-Werror=stringop-truncation] | ||
| 18 | strncpy(info->serial_number, attrib_value, 32); | ||
| 19 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| 20 | xenpmd.c:189:9: error: 'strncpy' specified bound 32 equals destination size [-Werror=stringop-truncation] | ||
| 21 | strncpy(info->model_number, attrib_value, 32); | ||
| 22 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| 23 | |||
| 24 | Copy 31 chars, then make sure terminating '\0' is present. Those fields | ||
| 25 | are passed to strlen and as '%s' for snprintf later. | ||
| 26 | |||
| 27 | Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com> | ||
| 28 | Acked-by: Wei Liu <wei.liu2@citrix.com> | ||
| 29 | Release-Acked-by: Juergen Gross <jgross@suse.com> | ||
| 30 | --- | ||
| 31 | tools/xenpmd/xenpmd.c | 12 ++++++++---- | ||
| 32 | 1 file changed, 8 insertions(+), 4 deletions(-) | ||
| 33 | |||
| 34 | diff --git a/tools/xenpmd/xenpmd.c b/tools/xenpmd/xenpmd.c | ||
| 35 | index 689c8fd..56412a9 100644 | ||
| 36 | --- a/tools/xenpmd/xenpmd.c | ||
| 37 | +++ b/tools/xenpmd/xenpmd.c | ||
| 38 | @@ -186,25 +186,29 @@ void set_attribute_battery_info(char *attrib_name, | ||
| 39 | |||
| 40 | if ( strstr(attrib_name, "model number") ) | ||
| 41 | { | ||
| 42 | - strncpy(info->model_number, attrib_value, 32); | ||
| 43 | + strncpy(info->model_number, attrib_value, 31); | ||
| 44 | + info->model_number[31] = '\0'; | ||
| 45 | return; | ||
| 46 | } | ||
| 47 | |||
| 48 | if ( strstr(attrib_name, "serial number") ) | ||
| 49 | { | ||
| 50 | - strncpy(info->serial_number, attrib_value, 32); | ||
| 51 | + strncpy(info->serial_number, attrib_value, 31); | ||
| 52 | + info->serial_number[31] = '\0'; | ||
| 53 | return; | ||
| 54 | } | ||
| 55 | |||
| 56 | if ( strstr(attrib_name, "battery type") ) | ||
| 57 | { | ||
| 58 | - strncpy(info->battery_type, attrib_value, 32); | ||
| 59 | + strncpy(info->battery_type, attrib_value, 31); | ||
| 60 | + info->battery_type[31] = '\0'; | ||
| 61 | return; | ||
| 62 | } | ||
| 63 | |||
| 64 | if ( strstr(attrib_name, "OEM info") ) | ||
| 65 | { | ||
| 66 | - strncpy(info->oem_info, attrib_value, 32); | ||
| 67 | + strncpy(info->oem_info, attrib_value, 31); | ||
| 68 | + info->oem_info[31] = '\0'; | ||
| 69 | return; | ||
| 70 | } | ||
| 71 | |||
| 72 | -- | ||
| 73 | 2.7.4 | ||
| 74 | |||
diff --git a/recipes-extended/xen/files/tools-xentop-vwprintw.patch b/recipes-extended/xen/files/tools-xentop-vwprintw.patch new file mode 100644 index 00000000..5d5d0116 --- /dev/null +++ b/recipes-extended/xen/files/tools-xentop-vwprintw.patch | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | tools/xentop : fix vwprintw -Werror=deprecated-declarations warning | ||
| 2 | |||
| 3 | gcc-8.1 complains: | ||
| 4 | |||
| 5 | | xentop.c: In function 'print': | ||
| 6 | | xentop.c:304:4: error: 'vwprintw' is deprecated [-Werror=deprecated-declarations] | ||
| 7 | | vwprintw(stdscr, (curses_str_t)fmt, args); | ||
| 8 | | ^~~~~~~~ | ||
| 9 | |||
| 10 | vw_printw is the non-deprecated alternative. | ||
| 11 | |||
| 12 | Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com> | ||
| 13 | diff --git a/tools/xenstat/xentop/xentop.c b/tools/xenstat/xentop/xentop.c | ||
| 14 | index 2fd2b67..c465810 100644 | ||
| 15 | --- a/tools/xenstat/xentop/xentop.c | ||
| 16 | +++ b/tools/xenstat/xentop/xentop.c | ||
| 17 | @@ -301,7 +301,7 @@ static void print(const char *fmt, ...) | ||
| 18 | if (!batch) { | ||
| 19 | if((current_row() < lines()-1)) { | ||
| 20 | va_start(args, fmt); | ||
| 21 | - vwprintw(stdscr, (curses_str_t)fmt, args); | ||
| 22 | + vw_printw(stdscr, (curses_str_t)fmt, args); | ||
| 23 | va_end(args); | ||
| 24 | } | ||
| 25 | } else { | ||
diff --git a/recipes-extended/xen/files/xsa253.patch b/recipes-extended/xen/files/xsa253.patch deleted file mode 100644 index 19e42693..00000000 --- a/recipes-extended/xen/files/xsa253.patch +++ /dev/null | |||
| @@ -1,26 +0,0 @@ | |||
| 1 | From: Andrew Cooper <andrew.cooper3@citrix.com> | ||
| 2 | Subject: x86/msr: Free msr_vcpu_policy during vcpu destruction | ||
| 3 | |||
| 4 | c/s 4187f79dc7 "x86/msr: introduce struct msr_vcpu_policy" introduced a | ||
| 5 | per-vcpu memory allocation, but failed to free it in the clean vcpu | ||
| 6 | destruction case. | ||
| 7 | |||
| 8 | This is XSA-253 | ||
| 9 | |||
| 10 | Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> | ||
| 11 | Reviewed-by: Jan Beulich <jbeulich@suse.com> | ||
| 12 | |||
| 13 | diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c | ||
| 14 | index b17468c..0ae715d 100644 | ||
| 15 | --- a/xen/arch/x86/domain.c | ||
| 16 | +++ b/xen/arch/x86/domain.c | ||
| 17 | @@ -382,6 +382,9 @@ void vcpu_destroy(struct vcpu *v) | ||
| 18 | |||
| 19 | vcpu_destroy_fpu(v); | ||
| 20 | |||
| 21 | + xfree(v->arch.msr); | ||
| 22 | + v->arch.msr = NULL; | ||
| 23 | + | ||
| 24 | if ( !is_idle_domain(v->domain) ) | ||
| 25 | vpmu_destroy(v); | ||
| 26 | |||
diff --git a/recipes-extended/xen/xen.inc b/recipes-extended/xen/xen.inc index cadbd78e..42c93b4c 100644 --- a/recipes-extended/xen/xen.inc +++ b/recipes-extended/xen/xen.inc | |||
| @@ -91,6 +91,7 @@ RRECOMMENDS_${PN}-base = " \ | |||
| 91 | ${PN}-libvhd \ | 91 | ${PN}-libvhd \ |
| 92 | ${PN}-flask \ | 92 | ${PN}-flask \ |
| 93 | ${PN}-hvmloader \ | 93 | ${PN}-hvmloader \ |
| 94 | ${PN}-shim \ | ||
| 94 | ${PN}-xenpaging \ | 95 | ${PN}-xenpaging \ |
| 95 | " | 96 | " |
| 96 | 97 | ||
| @@ -213,6 +214,7 @@ PACKAGES = "\ | |||
| 213 | ${PN}-scripts-block \ | 214 | ${PN}-scripts-block \ |
| 214 | ${PN}-scripts-common \ | 215 | ${PN}-scripts-common \ |
| 215 | ${PN}-scripts-network \ | 216 | ${PN}-scripts-network \ |
| 217 | ${PN}-shim \ | ||
| 216 | ${PN}-staticdev \ | 218 | ${PN}-staticdev \ |
| 217 | ${PN}-volatiles \ | 219 | ${PN}-volatiles \ |
| 218 | ${PN}-xcutils \ | 220 | ${PN}-xcutils \ |
| @@ -638,6 +640,11 @@ FILES_${PN}-scripts-common = " \ | |||
| 638 | ${sysconfdir}/xen/scripts/xen-script-common.sh \ | 640 | ${sysconfdir}/xen/scripts/xen-script-common.sh \ |
| 639 | " | 641 | " |
| 640 | 642 | ||
| 643 | INSANE_SKIP_${PN}-shim = "arch" | ||
| 644 | FILES_${PN}-shim = " \ | ||
| 645 | ${libdir}/xen/boot/xen-shim \ | ||
| 646 | " | ||
| 647 | |||
| 641 | FILES_${PN}-volatiles = "\ | 648 | FILES_${PN}-volatiles = "\ |
| 642 | ${sysconfdir}/default/volatiles/99_xen \ | 649 | ${sysconfdir}/default/volatiles/99_xen \ |
| 643 | ${sysconfdir}/tmpfiles.d/xen.conf \ | 650 | ${sysconfdir}/tmpfiles.d/xen.conf \ |
| @@ -930,10 +937,17 @@ do_compile() { | |||
| 930 | # workaround for build bug when CFLAGS is exported | 937 | # workaround for build bug when CFLAGS is exported |
| 931 | # https://www.mail-archive.com/xen-devel@lists.xen.org/msg67822.html | 938 | # https://www.mail-archive.com/xen-devel@lists.xen.org/msg67822.html |
| 932 | unset CFLAGS | 939 | unset CFLAGS |
| 940 | |||
| 941 | # Workaround for parallel build bug: build xen first. | ||
| 942 | # https://lists.xenproject.org/archives/html/xen-devel/2018-07/msg02551.html | ||
| 943 | oe_runmake xen | ||
| 933 | oe_runmake | 944 | oe_runmake |
| 934 | } | 945 | } |
| 935 | 946 | ||
| 936 | do_install() { | 947 | do_install() { |
| 948 | # CFLAGS is used to set PY_CFLAGS which affects the pygrub install | ||
| 949 | # so also need to unset CFLAGS here: | ||
| 950 | unset CFLAGS | ||
| 937 | oe_runmake DESTDIR="${D}" install | 951 | oe_runmake DESTDIR="${D}" install |
| 938 | 952 | ||
| 939 | # remove installed volatiles | 953 | # remove installed volatiles |
diff --git a/recipes-extended/xen/xen_4.10.0.bb b/recipes-extended/xen/xen_4.10.0.bb deleted file mode 100644 index d314b9b6..00000000 --- a/recipes-extended/xen/xen_4.10.0.bb +++ /dev/null | |||
| @@ -1,12 +0,0 @@ | |||
| 1 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
| 2 | require xen.inc | ||
| 3 | |||
| 4 | SRC_URI = " \ | ||
| 5 | https://downloads.xenproject.org/release/xen/${PV}/xen-${PV}.tar.gz \ | ||
| 6 | file://xsa253.patch \ | ||
| 7 | " | ||
| 8 | |||
| 9 | SRC_URI[md5sum] = "ab9d320d02cb40f6b40506aed1a38d58" | ||
| 10 | SRC_URI[sha256sum] = "0262a7023f8b12bcacfb0b25e69b2a63291f944f7683d54d8f33d4b2ca556844" | ||
| 11 | |||
| 12 | S = "${WORKDIR}/xen-${PV}" | ||
diff --git a/recipes-extended/xen/xen_4.10.1.bb b/recipes-extended/xen/xen_4.10.1.bb new file mode 100644 index 00000000..01c07889 --- /dev/null +++ b/recipes-extended/xen/xen_4.10.1.bb | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
| 2 | require xen.inc | ||
| 3 | |||
| 4 | SRC_URI = " \ | ||
| 5 | https://downloads.xenproject.org/release/xen/${PV}/xen-${PV}.tar.gz \ | ||
| 6 | file://tools-libxc-fix-strncpy-size.patch \ | ||
| 7 | file://tools-misc-fix-hypothetical-buffer-overflow.patch \ | ||
| 8 | file://tools-xentop-vwprintw.patch \ | ||
| 9 | file://tools-xenpmd-fix-possible-0-truncation.patch \ | ||
| 10 | file://tools-gdbsx-fix-Wstringop-truncation-warning.patch \ | ||
| 11 | file://tools-kdd-mute-spurious-gcc-warning-part1.patch \ | ||
| 12 | file://tools-kdd-mute-spurious-gcc-warning-part2.patch \ | ||
| 13 | file://shim-don-t-let-build-modify-shim.config.patch \ | ||
| 14 | " | ||
| 15 | |||
| 16 | SRC_URI[md5sum] = "d1b1d14ce76622062c9977d9c8ba772e" | ||
| 17 | SRC_URI[sha256sum] = "570d654f357d4085accdf752989c1cbc33e2075feac8fcc505d68bdb81b1a0cf" | ||
| 18 | |||
| 19 | S = "${WORKDIR}/xen-${PV}" | ||
