[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Build problems in kdd.c with xen-4.14.0-rc4


  • To: paul@xxxxxxx
  • From: Michael Young <m.a.young@xxxxxxxxxxxx>
  • Date: Fri, 3 Jul 2020 10:48:57 +0100 (BST)
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=durham.ac.uk; dmarc=pass action=none header.from=durham.ac.uk; dkim=pass header.d=durham.ac.uk; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aAW/Crn4QUVtArQFAkNzARmHWlCle50TRjQ41/NK3Tk=; b=OUZgek7CeB61ulyKTT/4w9UXj8rWE9yC2jrxfpPtPSSICuktuT9mzN3uSbI4U79RBuiPTl1CidPuGzZ5Hffnq6BHD9lqb2z6Ti03dTkXApL7yfgJ9Cu7eOqtkknQ4yiCxcx6M25vYCPMlaD+/avarfRo4wcQt62A+BCuNppopQosF0DQXSUk5o+ATmAdp4ldU3A5tjzWGVAObNnFeC/nVHM+tdz6NKVEGxPF52/4B0q/deNli1CjwCYGFHQpBd4H2IwuDP4giPEPBS+jG/tKgHjuzpkIlBF2iR0TYTpWWvAa5w2s5E45ZdUhB9gomIMeq0gVbAbW6aFv0/V3NvaKQA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k5P7Qy0IogidzzN85fhC8FatoqN/w8TznaE4y6KRM0OixtM9Ipk8MpnJOqnvHdJJ1HzO6OBeo+vBESd3n2saiR9NpM1i6brJGgfIk1Vrrvn5TOm653PhXVlpmVHL9LcKZ4NwS65wGBovZtcbEih7RHD6z/O3PCXvXE7n3r39y3r2DM9QxoO6FKbvi3lu+BDa9q/dz9T6wirgN8yVmcibIgSIjJ+27V4ffL8R+pOLhs1TPg37TWOBUZdKhX2POAtIRNiBd0iJkkxcYe1lHaVk7HHqa9651Z3pXDQqAs1gNpUlxY0cGJ7z84yeM3386guKyXUOAAiOpd1817OjQRS6bw==
  • Authentication-results: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=durham.ac.uk;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, 'Tim Deegan' <tim@xxxxxxx>
  • Delivery-date: Fri, 03 Jul 2020 09:49:13 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Fri, 3 Jul 2020, Paul Durrant wrote:

-----Original Message-----
From: Xen-devel <xen-devel-bounces@xxxxxxxxxxxxxxxxxxxx> On Behalf Of Michael 
Young
Sent: 30 June 2020 23:22
To: xen-devel@xxxxxxxxxxxxxxxxxxxx
Cc: Tim Deegan <tim@xxxxxxx>
Subject: Build problems in kdd.c with xen-4.14.0-rc4

I get the following errors when trying to build xen-4.14.0-rc4

kdd.c: In function 'kdd_tx':
kdd.c:754:15: error: array subscript 16 is above array bounds of 'uint8_t[16]' 
{aka 'unsigned
char[16]'} [-Werror=array-bounds]
   754 |         s->txb[len++] = 0xaa;
       |         ~~~~~~^~~~~~~
kdd.c:82:17: note: while referencing 'txb'
    82 |         uint8_t txb[sizeof (kdd_hdr)];           /* Marshalling area 
for tx */
       |                 ^~~
kdd.c: In function 'kdd_break':
kdd.c:819:19: error: array subscript 16 is above array bounds of 'uint8_t[16]' 
{aka 'unsigned
char[16]'} [-Werror=array-bounds]
   819 |             s->txb[sizeof (kdd_hdr) + i] = i;
       |             ~~~~~~^~~~~~~~~~~~~~~~~~~~~~
kdd.c:82:17: note: while referencing 'txb'
    82 |         uint8_t txb[sizeof (kdd_hdr)];           /* Marshalling area 
for tx */
       |                 ^~~
In file included from /usr/include/stdio.h:867,
                  from kdd.c:36:
In function 'vsnprintf',
     inlined from 'kdd_send_string' at kdd.c:791:11:
/usr/include/bits/stdio2.h:80:10: error: '__builtin___vsnprintf_chk' specified 
bound 65519 exceeds
destination size 0 [-Werror=stringop-overflow=]
    80 |   return __builtin___vsnprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    81 |         __bos (__s), __fmt, __ap);
       |         ~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[4]: *** 
[/builddir/build/BUILD/xen-4.14.0-rc4/tools/debugger/kdd/../../../tools/Rules.mk:216:
kdd.o] Error 1

The first two array-bounds errors seem to be a result of the

kdd: stop using [0] arrays to access packet contents

patch at
http://xenbits.xenproject.org/gitweb/?p=xen.git;a=commit;h=3471cafbdda35eacf04670881dd2aee2558b4f08

which reduced the size of txb from
sizeof (kdd_hdr) + 65536
to
sizeof (kdd_hdr)
which means the code now tries to write beyond the end of txb in both
cases.


Sorry not to get back to you sooner. Which compiler are you using?

 Paul

This was with gcc-10.1.1-1.fc32.x86_64
Full build logs are (at the moment) at https://download.copr.fedorainfracloud.org/results/myoung/xentest/fedora-32-x86_64/01515056-xen/

        Michael Young



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.