SHA256
1
0
forked from pool/qemu

Accepting request 703257 from home:bfrogers:branches:Virtualization

Yet another gcc9 related code fix

OBS-URL: https://build.opensuse.org/request/show/703257
OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=471
This commit is contained in:
Bruce Rogers 2019-05-15 20:19:48 +00:00 committed by Git OBS Bridge
parent 38bf12506e
commit 76f55f1d2c
7 changed files with 84 additions and 0 deletions

View File

@ -0,0 +1,57 @@
From: Bruce Rogers <brogers@suse.com>
Date: Wed, 15 May 2019 13:32:01 -0600
Subject: hw/intc/exynos4210_gic: provide more room when formatting alias names
sprintf related parameter validation complains about the size of the
buffer being written to in exynos4210_gic_realize(). Provide a bit more
space to avoid the following warning:
/home/abuild/rpmbuild/BUILD/qemu-4.0.0/hw/intc/exynos4210_gic.c: In function 'exynos4210_gic_realize':
/home/abuild/rpmbuild/BUILD/qemu-4.0.0/hw/intc/exynos4210_gic.c:316:36: error: '%x' directive writing between 1 and 7 bytes into a region of size between 4 and 28 [-Werror=format-overflow=]
316 | sprintf(cpu_alias_name, "%s%x", cpu_prefix, i);
| ^~
/home/abuild/rpmbuild/BUILD/qemu-4.0.0/hw/intc/exynos4210_gic.c:316:33: note: directive argument in the range [0, 29020050]
316 | sprintf(cpu_alias_name, "%s%x", cpu_prefix, i);
| ^~~~~~
In file included from /usr/include/stdio.h:867,
from /home/abuild/rpmbuild/BUILD/qemu-4.0.0/include/qemu/osdep.h:99,
from /home/abuild/rpmbuild/BUILD/qemu-4.0.0/hw/intc/exynos4210_gic.c:23:
/usr/include/bits/stdio2.h:36:10: note: '__builtin___sprintf_chk' output between 2 and 32 bytes into a destination of size 28
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/abuild/rpmbuild/BUILD/qemu-4.0.0/hw/intc/exynos4210_gic.c:326:37: error: '%x' directive writing between 1 and 7 bytes into a region of size between 3 and 28 [-Werror=format-overflow=]
326 | sprintf(dist_alias_name, "%s%x", dist_prefix, i);
| ^~
/home/abuild/rpmbuild/BUILD/qemu-4.0.0/hw/intc/exynos4210_gic.c:326:34: note: directive argument in the range [0, 29020050]
326 | sprintf(dist_alias_name, "%s%x", dist_prefix, i);
| ^~~~~~
In file included from /usr/include/stdio.h:867,
from /home/abuild/rpmbuild/BUILD/qemu-4.0.0/include/qemu/osdep.h:99,
from /home/abuild/rpmbuild/BUILD/qemu-4.0.0/hw/intc/exynos4210_gic.c:23:
/usr/include/bits/stdio2.h:36:10: note: '__builtin___sprintf_chk' output between 2 and 33 bytes into a destination of size 28
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Bruce Rogers <brogers@suse.com>
---
hw/intc/exynos4210_gic.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/intc/exynos4210_gic.c b/hw/intc/exynos4210_gic.c
index 69f9c18d73..4770950c94 100644
--- a/hw/intc/exynos4210_gic.c
+++ b/hw/intc/exynos4210_gic.c
@@ -288,8 +288,8 @@ static void exynos4210_gic_realize(DeviceState *dev, Error **errp)
SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
const char cpu_prefix[] = "exynos4210-gic-alias_cpu";
const char dist_prefix[] = "exynos4210-gic-alias_dist";
- char cpu_alias_name[sizeof(cpu_prefix) + 3];
- char dist_alias_name[sizeof(cpu_prefix) + 3];
+ char cpu_alias_name[sizeof(cpu_prefix) + 7];
+ char dist_alias_name[sizeof(cpu_prefix) + 8];
SysBusDevice *gicbusdev;
uint32_t i;

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Wed May 15 19:36:50 UTC 2019 - Bruce Rogers <brogers@suse.com>
- Patch queue updated from git://github.com/openSUSE/qemu.git opensuse-4.0
* Patches added:
0044-hw-intc-exynos4210_gic-provide-more.patch
-------------------------------------------------------------------
Tue May 14 21:01:06 UTC 2019 - Bruce Rogers <brogers@suse.com>

View File

@ -77,6 +77,7 @@ Patch0040: 0040-linux-user-elfload-Fix-GCC-9-build-.patch
Patch0041: 0041-qxl-avoid-unaligned-pointer-reads-w.patch
Patch0042: 0042-libvhost-user-fix-Waddress-of-packe.patch
Patch0043: 0043-target-i386-define-md-clear-bit.patch
Patch0044: 0044-hw-intc-exynos4210_gic-provide-more.patch
# Please do not add QEMU patches manually here.
# Run update_git.sh to regenerate this queue.
ExcludeArch: s390
@ -150,6 +151,7 @@ syscall layer occurs on the native hardware and operating system.
%patch0041 -p1
%patch0042 -p1
%patch0043 -p1
%patch0044 -p1
%build
%define _lto_cflags %{nil}

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Wed May 15 19:36:49 UTC 2019 - Bruce Rogers <brogers@suse.com>
- Yet another gcc9 related code fix (bsc#1121464)
0044-hw-intc-exynos4210_gic-provide-more.patch
- Patch queue updated from git://github.com/openSUSE/qemu.git opensuse-4.0
-------------------------------------------------------------------
Tue May 14 21:01:05 UTC 2019 - Bruce Rogers <brogers@suse.com>

View File

@ -187,6 +187,7 @@ Patch0040: 0040-linux-user-elfload-Fix-GCC-9-build-.patch
Patch0041: 0041-qxl-avoid-unaligned-pointer-reads-w.patch
Patch0042: 0042-libvhost-user-fix-Waddress-of-packe.patch
Patch0043: 0043-target-i386-define-md-clear-bit.patch
Patch0044: 0044-hw-intc-exynos4210_gic-provide-more.patch
# Please do not add QEMU patches manually here.
# Run update_git.sh to regenerate this queue.
@ -997,6 +998,7 @@ This package provides a service file for starting and stopping KSM.
%patch0041 -p1
%patch0042 -p1
%patch0043 -p1
%patch0044 -p1
pushd roms/seabios
%patch1100 -p1

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Wed May 15 19:36:49 UTC 2019 - Bruce Rogers <brogers@suse.com>
- Yet another gcc9 related code fix (bsc#1121464)
0044-hw-intc-exynos4210_gic-provide-more.patch
- Patch queue updated from git://github.com/openSUSE/qemu.git opensuse-4.0
-------------------------------------------------------------------
Tue May 14 21:01:05 UTC 2019 - Bruce Rogers <brogers@suse.com>

View File

@ -187,6 +187,7 @@ Patch0040: 0040-linux-user-elfload-Fix-GCC-9-build-.patch
Patch0041: 0041-qxl-avoid-unaligned-pointer-reads-w.patch
Patch0042: 0042-libvhost-user-fix-Waddress-of-packe.patch
Patch0043: 0043-target-i386-define-md-clear-bit.patch
Patch0044: 0044-hw-intc-exynos4210_gic-provide-more.patch
# Please do not add QEMU patches manually here.
# Run update_git.sh to regenerate this queue.
@ -997,6 +998,7 @@ This package provides a service file for starting and stopping KSM.
%patch0041 -p1
%patch0042 -p1
%patch0043 -p1
%patch0044 -p1
pushd roms/seabios
%patch1100 -p1