xen ftbfs in disco

Bug #1823441 reported by Matthias Klose on 2019-04-06
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
xen (Ubuntu)
Status tracked in Eoan
Cosmic
High
Unassigned
Disco
High
Unassigned
Eoan
High
Stefan Bader

Bug Description

[Impact]
Warning message causes FTBFS when configured to treat warnings as errors.

[Test Case]
$ apt-get source xen
(...)
$ cd xen*
$ sudo apt-get build-dep xen
(...)
$ ./configure
(...)
$ make
(...)
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:10: note: ‘__builtin___snprintf_chk’ output between 36 and 547 bytes into a destination of size 512
     return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __bos (__s), __fmt, __va_arg_pack ());
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[4]: *** [/home/ubuntu/xen-4.9.2/tools/misc/../../tools/Rules.mk:220: xen-lowmemd.o] Error 1
make[4]: Leaving directory '/home/ubuntu/xen-4.9.2/tools/misc'
$ echo $?
2

[Regression Potential]
Changes string formatting of an error message, which should be
transparent to users, but things to watch for would relate to xen's
error message logs.

[Fix]
A simple tweak to snprintf() formatting from upstream would prevent
the theoretical buffer overflow being warned about. This needs applied
to disco and eoan; bionic and earlier are not affected.

[Discussion]

[Original Report]
https://launchpadlibrarian.net/417924491/buildlog_ubuntu-disco-amd64.xen_4.9.2-0ubuntu2_BUILDING.txt.gz

gcc -m64 -DBUILD_ID -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wdeclaration-after-statement -Wno-unused-but-set-variable -Wno-unused-local-typedefs -O2 -fomit-frame-pointer -D__XEN_INTERFACE_VERSION__=__XEN_LATEST_INTERFACE_VERSION__ -MMD -MF .xen-lowmemd.o.d -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Werror -include /<<PKGBUILDDIR>>/debian/build/build-utils_amd64/tools/misc/../../tools/config.h -I/<<PKGBUILDDIR>>/debian/build/build-utils_amd64/tools/misc/../../tools/libs/evtchn/include -I/<<PKGBUILDDIR>>/debian/build/build-utils_amd64/tools/misc/../../tools/include -I/<<PKGBUILDDIR>>/debian/build/build-utils_amd64/tools/misc/../../tools/libxc/include -I/<<PKGBUILDDIR>>/debian/build/build-utils_amd64/tools/misc/../../tools/libs/toollog/include -I/<<PKGBUILDDIR>>/debian/build/build-utils_amd64/tools/misc/../../tools/include -I/<<PKGBUILDDIR>>/debian/build/build-utils_amd64/tools/misc/../../tools/libs/foreignmemory/include -I/<<PKGBUILDDIR>>/debian/build/build-utils_amd64/tools/misc/../../tools/include -I/<<PKGBUILDDIR>>/debian/build/build-utils_amd64/tools/misc/../../tools/libs/devicemodel/include -I/<<PKGBUILDDIR>>/debian/build/build-utils_amd64/tools/misc/../../tools/include -I/<<PKGBUILDDIR>>/debian/build/build-utils_amd64/tools/misc/../../tools/include -D__XEN_TOOLS__ -I/<<PKGBUILDDIR>>/debian/build/build-utils_amd64/tools/misc/../../tools/include -I/<<PKGBUILDDIR>>/debian/build/build-utils_amd64/tools/misc/../../tools/xenstore/include -I/<<PKGBUILDDIR>>/debian/build/build-utils_amd64/tools/misc/../../tools/include -c -o xen-lowmemd.o xen-lowmemd.c
xen-lowmemd.c: In function ‘handle_low_mem’:
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=]
         snprintf(error, BUFSZ,"Failed to write target %s to xenstore", data);
                                                       ^~ ~~~~
In file included from /usr/include/stdio.h:867,
                 from xen-lowmemd.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:10: note: ‘__builtin___snprintf_chk’ output between 36 and 547 bytes into a destination of size 512
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __bos (__s), __fmt, __va_arg_pack ());
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[5]: *** [/<<PKGBUILDDIR>>/debian/build/build-utils_amd64/tools/misc/../../tools/Rules.mk:220: xen-lowmemd.o] Error 1
make[5]: Leaving directory '/<<PKGBUILDDIR>>/debian/build/build-utils_amd64/tools/misc'
make[4]: *** [/<<PKGBUILDDIR>>/debian/build/build-utils_amd64/tools/../tools/Rules.mk:244: subdir-all-misc] Error 2
make[4]: Leaving directory '/<<PKGBUILDDIR>>/debian/build/build-utils_amd64/tools'
make[3]: *** [/<<PKGBUILDDIR>>/debian/build/build-utils_amd64/tools/../tools/Rules.mk:239: subdirs-all] Error 2
make[3]: Leaving directory '/<<PKGBUILDDIR>>/debian/build/build-utils_amd64/tools'
make[2]: *** [debian/rules.real:111: debian/stamps/build-utils_amd64] Error 2
make[2]: Leaving directory '/<<PKGBUILDDIR>>'
make[1]: *** [debian/rules.gen:66: build-arch_amd64_real] Error 2
make[1]: Leaving directory '/<<PKGBUILDDIR>>'

Matthias Klose (doko) on 2019-04-06
Changed in xen (Ubuntu):
importance: Undecided → High
tags: added: ftbfs rls-dd-incoming
Changed in xen (Ubuntu Cosmic):
status: New → Triaged
Changed in xen (Ubuntu):
status: New → Triaged
Changed in xen (Ubuntu Cosmic):
importance: Undecided → High
Matthias Klose (doko) wrote :

also ftbfs in eoan

tags: added: rls-ee-incoming
Bryce Harrington (bryce) on 2019-06-19
Changed in xen (Ubuntu Disco):
status: New → Triaged
importance: Undecided → High
Bryce Harrington (bryce) wrote :

Looks like this is fixed upstream with commit 27751d89248c8c5eef6d8b56eb8f7d2084145080.

Upstream patch is attached; this would need applied to cosmic, disco, and eoan.

tags: added: patch
Bryce Harrington (bryce) on 2019-06-19
tags: added: server-next
removed: patch
tags: added: patch
Bryce Harrington (bryce) wrote :

Dropping cosmic task since cosmic reached end of support this month.

Changed in xen (Ubuntu Cosmic):
status: Triaged → Won't Fix
Bryce Harrington (bryce) on 2019-07-18
description: updated
Changed in xen (Ubuntu Eoan):
assignee: nobody → Bryce Harrington (bryce)
Changed in xen (Ubuntu Disco):
assignee: nobody → Bryce Harrington (bryce)
Bryce Harrington (bryce) wrote :

Branches with the packaging changes:
    ~bryce/ubuntu/+source/xen:xen-sru-1823441-disco
    ~bryce/ubuntu/+source/xen:xen-sru-1823441-eoan

PPA with proposed fix for Disco and Eoan:

     https://launchpad.net/~bryce/+archive/ubuntu/xen-sru-1823441
     ppa:bryce/xen-sru-1823441

Bryce Harrington (bryce) wrote :

Looks like it built locally for me with this patch when I had gcc8 installed, but in the ppa it's defaulting to gcc9 for some reason, and fails to build.

Bryce Harrington (bryce) on 2019-08-16
Changed in xen (Ubuntu Eoan):
assignee: Bryce Harrington (bryce) → nobody
Changed in xen (Ubuntu Disco):
assignee: Bryce Harrington (bryce) → nobody

I'm also getting other building errors such as:

dsdt_anycpu.c:7495:28: error: ‘dsdt_anycpu’ undeclared here (not in a function); did you mean ‘dsdt_anycpu_len’?
 int dsdt_anycpu_len=sizeof(dsdt_anycpu);
                            ^~~~~~~~~~~
                            dsdt_anycpu_len

 int dsdt_15cpu_len=sizeof(dsdt_15cpu);
                           ^~~~~~~~~~
                           dsdt_15cpu_len
make[8]: *** [/home/inaddy/work/sources/oldubuntu/disco/xen-4.9.2/tools/firmware/hvmloader/../../../tools/Rules.mk:220: dsdt_15cpu.o] Error 1

../../libacpi/build.c:392:49: error: ‘ssdt_s3’ undeclared (first use in this function); did you mean ‘ssdt’?
         ssdt = ctxt->mem_ops.alloc(ctxt, sizeof(ssdt_s3), 16);
                                                 ^~~~~~~
                                                 ssdt

Maybe we should fix them all using this LP bug ?

o/

Changed in xen (Ubuntu Eoan):
assignee: nobody → Stefan Bader (smb)
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers