From patchwork Fri Nov 16 16:57:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Matt Weber X-Patchwork-Id: 999090 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rockwellcollins.com Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42xPYc1BTSz9sBn for ; Sat, 17 Nov 2018 03:57:55 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id C63E088579; Fri, 16 Nov 2018 16:57:53 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JEb9DgfuXy+Q; Fri, 16 Nov 2018 16:57:53 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 31D0C8861D; Fri, 16 Nov 2018 16:57:53 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 7DEE71BF30F for ; Fri, 16 Nov 2018 16:57:47 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 7A7078861D for ; Fri, 16 Nov 2018 16:57:47 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pvMsp0em-spw for ; Fri, 16 Nov 2018 16:57:43 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from da1vs02.rockwellcollins.com (da1vs02.rockwellcollins.com [205.175.227.29]) by hemlock.osuosl.org (Postfix) with ESMTPS id E791888579 for ; Fri, 16 Nov 2018 16:57:42 +0000 (UTC) Received: from ofwda1n02.rockwellcollins.com (HELO crulimr02.rockwellcollins.com) ([205.175.227.14]) by da1vs02.rockwellcollins.com with ESMTP; 16 Nov 2018 10:57:42 -0600 X-Received: from largo.rockwellcollins.com (unknown [192.168.140.76]) by crulimr02.rockwellcollins.com (Postfix) with ESMTP id 1F8B7600DD; Fri, 16 Nov 2018 10:57:42 -0600 (CST) From: Matt Weber To: buildroot@buildroot.org Date: Fri, 16 Nov 2018 10:57:39 -0600 Message-Id: <1542387461-26373-1-git-send-email-matthew.weber@rockwellcollins.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2 1/3] package/xen: tools/libxc fix strncpy size X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" gcc-8 errs on possible truncation of trailing '\0' Resolves: http://autobuild.buildroot.net/results/6e0d8e962e861a32f5bf2e5031ef51c25768f1f6/ Upstream Commit: https://xenbits.xen.org/gitweb/?p=xen.git;a=commit;h=fa7789ef18bd2e716997937af71b2e4b5b00a159 Signed-off-by: Matthew Weber --- v1 -> v2 - Re-generated patch on upstream clone of 4.10.2 and included SOF --- .../xen/0003-tools-libxc-fix-strncpy-size.patch | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 package/xen/0003-tools-libxc-fix-strncpy-size.patch diff --git a/package/xen/0003-tools-libxc-fix-strncpy-size.patch b/package/xen/0003-tools-libxc-fix-strncpy-size.patch new file mode 100644 index 0000000..4b40b29 --- /dev/null +++ b/package/xen/0003-tools-libxc-fix-strncpy-size.patch @@ -0,0 +1,48 @@ +From 9302803dc77365187a3c544f71e7c7faf5518b31 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= + +Date: Thu, 5 Apr 2018 03:50:49 +0200 +Subject: [PATCH] tools/libxc: fix strncpy size +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +gcc-8 warns about possible truncation of trailing '\0'. +Final character is overridden by '\0' anyway, so don't bother to copy +it. + +This fixes compile failure: + + xc_pm.c: In function 'xc_set_cpufreq_gov': + xc_pm.c:308:5: error: 'strncpy' specified bound 16 equals destination size [-Werror=stringop-truncation] + strncpy(scaling_governor, govname, CPUFREQ_NAME_LEN); + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + cc1: all warnings being treated as errors + +Upstream: +https://xenbits.xen.org/gitweb/?p=xen.git;a=commit;h=fa7789ef18bd2e716997937af71b2e4b5b00a159 + +Signed-off-by: Marek Marczykowski-Górecki +Acked-by: Wei Liu +Release-Acked-by: Juergen Gross +Signed-off-by: Matt Weber +--- + tools/libxc/xc_pm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tools/libxc/xc_pm.c b/tools/libxc/xc_pm.c +index ae917bc..0fc4704 100644 +--- a/tools/libxc/xc_pm.c ++++ b/tools/libxc/xc_pm.c +@@ -305,7 +305,7 @@ int xc_set_cpufreq_gov(xc_interface *xch, int cpuid, char *govname) + sysctl.cmd = XEN_SYSCTL_pm_op; + sysctl.u.pm_op.cmd = SET_CPUFREQ_GOV; + sysctl.u.pm_op.cpuid = cpuid; +- strncpy(scaling_governor, govname, CPUFREQ_NAME_LEN); ++ strncpy(scaling_governor, govname, CPUFREQ_NAME_LEN - 1); + scaling_governor[CPUFREQ_NAME_LEN - 1] = '\0'; + + return xc_sysctl(xch, &sysctl); +-- +1.9.1 + From patchwork Fri Nov 16 16:57:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Weber X-Patchwork-Id: 999088 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rockwellcollins.com Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42xPYY4381z9s47 for ; Sat, 17 Nov 2018 03:57:53 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 2DF7427087; Fri, 16 Nov 2018 16:57:50 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KeaEMRXAnJ+p; Fri, 16 Nov 2018 16:57:48 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 76089260AF; Fri, 16 Nov 2018 16:57:48 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 82D621C29AD for ; Fri, 16 Nov 2018 16:57:45 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 7F67A25C74 for ; Fri, 16 Nov 2018 16:57:45 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bnju+ebfVGzH for ; Fri, 16 Nov 2018 16:57:43 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from da1vs04.rockwellcollins.com (da1vs04.rockwellcollins.com [205.175.227.52]) by silver.osuosl.org (Postfix) with ESMTPS id C3D5B260AF for ; Fri, 16 Nov 2018 16:57:43 +0000 (UTC) Received: from ofwda1n02.rockwellcollins.com (HELO crulimr02.rockwellcollins.com) ([205.175.227.14]) by da1vs04.rockwellcollins.com with ESMTP; 16 Nov 2018 10:57:43 -0600 X-Received: from largo.rockwellcollins.com (unknown [192.168.140.76]) by crulimr02.rockwellcollins.com (Postfix) with ESMTP id F1162600DD; Fri, 16 Nov 2018 10:57:42 -0600 (CST) From: Matt Weber To: buildroot@buildroot.org Date: Fri, 16 Nov 2018 10:57:40 -0600 Message-Id: <1542387461-26373-2-git-send-email-matthew.weber@rockwellcollins.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1542387461-26373-1-git-send-email-matthew.weber@rockwellcollins.com> References: <1542387461-26373-1-git-send-email-matthew.weber@rockwellcollins.com> Subject: [Buildroot] [PATCH v2 2/3] package/xen: libxl/arm: Fix build on arm64 X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Add zero-padding to #defined ACPI table strings that are copied. Provides sufficient characters to satisfy the length required to fully populate the destination and prevent array-bounds warnings. Add BUILD_BUG_ON sizeof checks for compile-time length checking. Origin: http://git.yoctoproject.org/cgit/cgit.cgi/meta-virtualization/plain/recipes-extended/xen/files/xen-4.11-arm-acpi-fix-string-lengths.patch Upstream post: https://lists.xenproject.org/archives/html/xen-devel/2018-11/msg01726.html Signed-off-by: Matthew Weber --- Bug found while fixing: http://autobuild.buildroot.net/results/6e0d8e962e861a32f5bf2e5031ef51c25768f1f6/ v1 -> v2 - Re-generated patch on upstream clone of 4.10.2 and included SOF --- package/xen/0005-arm-acpi-fix-string-lengths.patch | 72 ++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 package/xen/0005-arm-acpi-fix-string-lengths.patch diff --git a/package/xen/0005-arm-acpi-fix-string-lengths.patch b/package/xen/0005-arm-acpi-fix-string-lengths.patch new file mode 100644 index 0000000..6a1e0a8 --- /dev/null +++ b/package/xen/0005-arm-acpi-fix-string-lengths.patch @@ -0,0 +1,72 @@ +From 09fd70da9418bb94e7f13a817e99a5a66ec117eb Mon Sep 17 00:00:00 2001 +From: Christopher Clark +Date: Thu, 16 Aug 2018 13:04:52 -0700 +Subject: [PATCH] libxl/arm: Fix build on arm64 + acpi w/ gcc 8.2 + +[modified for Xen 4.11 to add required: #include ] + +Add zero-padding to #defined ACPI table strings that are copied. +Provides sufficient characters to satisfy the length required to +fully populate the destination and prevent array-bounds warnings. +Add BUILD_BUG_ON sizeof checks for compile-time length checking. + +Origin: +http://git.yoctoproject.org/cgit/cgit.cgi/meta-virtualization/plain/recipes-extended/xen/files/xen-4.11-arm-acpi-fix-string-lengths.patch + +Signed-off-by: Christopher Clark +Reviewed-by: Stefano Stabellini +Acked-by: Wei Liu +Signed-off-by: Matt Weber +--- + tools/libxl/libxl_arm_acpi.c | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +diff --git a/tools/libxl/libxl_arm_acpi.c b/tools/libxl/libxl_arm_acpi.c +index 636f724..8924396 100644 +--- a/tools/libxl/libxl_arm_acpi.c ++++ b/tools/libxl/libxl_arm_acpi.c +@@ -29,6 +29,7 @@ typedef int64_t s64; + + #include + #include ++#include + + #ifndef BITS_PER_LONG + #ifdef _LP64 +@@ -48,9 +49,9 @@ extern const unsigned char dsdt_anycpu_arm[]; + _hidden + extern const int dsdt_anycpu_arm_len; + +-#define ACPI_OEM_ID "Xen" +-#define ACPI_OEM_TABLE_ID "ARM" +-#define ACPI_ASL_COMPILER_ID "XL" ++#define ACPI_OEM_ID "Xen\0\0" ++#define ACPI_OEM_TABLE_ID "ARM\0\0\0\0" ++#define ACPI_ASL_COMPILER_ID "XL\0" + + enum { + RSDP, +@@ -190,6 +191,7 @@ static void make_acpi_rsdp(libxl__gc *gc, struct xc_dom_image *dom, + struct acpi_table_rsdp *rsdp = (void *)dom->acpi_modules[0].data + offset; + + memcpy(rsdp->signature, "RSD PTR ", sizeof(rsdp->signature)); ++ BUILD_BUG_ON(sizeof(ACPI_OEM_ID) != sizeof(rsdp->oem_id)); + memcpy(rsdp->oem_id, ACPI_OEM_ID, sizeof(rsdp->oem_id)); + rsdp->length = acpitables[RSDP].size; + rsdp->revision = 0x02; +@@ -205,9 +207,12 @@ static void make_acpi_header(struct acpi_table_header *h, const char *sig, + memcpy(h->signature, sig, 4); + h->length = len; + h->revision = rev; ++ BUILD_BUG_ON(sizeof(ACPI_OEM_ID) != sizeof(h->oem_id)); + memcpy(h->oem_id, ACPI_OEM_ID, sizeof(h->oem_id)); ++ BUILD_BUG_ON(sizeof(ACPI_OEM_TABLE_ID) != sizeof(h->oem_table_id)); + memcpy(h->oem_table_id, ACPI_OEM_TABLE_ID, sizeof(h->oem_table_id)); + h->oem_revision = 0; ++ BUILD_BUG_ON(sizeof(ACPI_ASL_COMPILER_ID) != sizeof(h->asl_compiler_id)); + memcpy(h->asl_compiler_id, ACPI_ASL_COMPILER_ID, + sizeof(h->asl_compiler_id)); + h->asl_compiler_revision = 0; +-- +1.9.1 +