[Bug 1090355] New: GCC 8: qemu build fails
http://bugzilla.opensuse.org/show_bug.cgi?id=1090355 Bug ID: 1090355 Summary: GCC 8: qemu build fails Classification: openSUSE Product: openSUSE Tumbleweed Version: Current Hardware: Other OS: Other Status: NEW Severity: Normal Priority: P5 - None Component: Basesystem Assignee: bnc-team-screening@forge.provo.novell.com Reporter: martin.liska@suse.com QA Contact: qa-bugs@suse.de Found By: --- Blocker: --- [ 1107s] In function 'process_section', [ 1107s] inlined from 'elf2pe.isra.4' at util/elf2efi.c:909:25: [ 1107s] util/elf2efi.c:494:2: error: 'strncpy' specified bound 8 equals destination size [-Werror=stringop-truncation] [ 1107s] strncpy ( ( char * ) new->hdr.Name, name, sizeof ( new->hdr.Name ) ); [ 1107s] ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Seen here: https://build.opensuse.org/package/live_build_log/openSUSE:Factory:Staging:G... -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1090355 Martin Liška <martin.liska@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |1084649 -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1090355 http://bugzilla.opensuse.org/show_bug.cgi?id=1090355#c1 Martin Liška <martin.liska@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |IN_PROGRESS CC| |agraf@suse.com, | |brogers@suse.com --- Comment #1 from Martin Liška <martin.liska@suse.com> --- Adding maintainers of the package. Can you please push following patch to mainline: --- a/roms/ipxe/src/util/elf2efi.c 2018-02-14 22:54:42.000000000 +0100 +++ b/roms/ipxe/src/util/elf2efi.c 2018-04-20 12:39:57.942219247 +0200 @@ -491,7 +491,7 @@ memset ( new, 0, sizeof ( *new ) + section_filesz ); /* Fill in section header details */ - strncpy ( ( char * ) new->hdr.Name, name, sizeof ( new->hdr.Name ) ); + strncpy ( ( char * ) new->hdr.Name, name, sizeof ( new->hdr.Name ) - 1 ); new->hdr.Misc.VirtualSize = section_memsz; new->hdr.VirtualAddress = shdr->sh_addr; new->hdr.SizeOfRawData = section_filesz; It's valid warning. Thanks. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1090355 http://bugzilla.opensuse.org/show_bug.cgi?id=1090355#c2 Bruce Rogers <brogers@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|bnc-team-screening@forge.pr |brogers@suse.com |ovo.novell.com | --- Comment #2 from Bruce Rogers <brogers@suse.com> --- For full safety we should also ensure the final element of the destination buffer be set to NUL. I'll add that as well in patch submitted to ipxe upstream. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1090355 http://bugzilla.opensuse.org/show_bug.cgi?id=1090355#c3 --- Comment #3 from Bruce Rogers <brogers@suse.com> --- (In reply to Bruce Rogers from comment #2)
For full safety we should also ensure the final element of the destination buffer be set to NUL. I'll add that as well in patch submitted to ipxe upstream.
And now that I examine the surrounding code, I see that the buffer is pre-zeroed anyways, so no need for this extra step to be added. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1090355 http://bugzilla.opensuse.org/show_bug.cgi?id=1090355#c6 --- Comment #6 from Bruce Rogers <brogers@suse.com> --- Created attachment 768451 --> http://bugzilla.opensuse.org/attachment.cgi?id=768451&action=edit Patch I've settled on to address this while waiting for upstream to decide It's not clear what direction upstream will want to take to address this GCC 8 strncpy issue, but I've decided on this patch for our needs. We'll no doubt adopt the upstream approach once they decide what works best for their project. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1090355 http://bugzilla.opensuse.org/show_bug.cgi?id=1090355#c7 Bruce Rogers <brogers@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|IN_PROGRESS |RESOLVED Resolution|--- |FIXED --- Comment #7 from Bruce Rogers <brogers@suse.com> --- Marking fixed. I've included the fix in an openSUSE Factory submission. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1090355 http://bugzilla.opensuse.org/show_bug.cgi?id=1090355#c10 --- Comment #10 from OBSbugzilla Bot <bwiedemann+obsbugzillabot@suse.com> --- This is an autogenerated message for OBS integration: This bug (1090355) was mentioned in https://build.opensuse.org/request/show/922963 Backports:SLE-15-SP3 / ipxe -- You are receiving this mail because: You are on the CC list for the bug.
participants (2)
-
bugzilla_noreply@novell.com
-
bugzilla_noreply@suse.com