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

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


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Michael Young <m.a.young@xxxxxxxxxxxx>
  • Date: Tue, 30 Jun 2020 23:21:36 +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=3bZaYZ3iWlRtW7dKIEC/KR6HBTcOrwUs3Zqf1StHpjY=; b=lX35n+NW8q8QsPx8zGUJe4awpC5i1p6vbr/9Xnqd3F+CUXdKlDqJCd5yioR9lLsP2Qdf9NjuYUra8A9nqYn61KnRU9qrrPuEjDn4YcivohIhGLe/uHokcBVfryHufhW2jC2K0Mi8h68YBTZfO+MhGb54teQFy6UHRFcZuLP5uyFoZVfS88S13rXtYqFnEDaMQ0PwPUEKik9nxlcJ4iz1ANpbb0YrEi/FqI7ASeQCobDzg5qIJoGB7QCru2C6do9q+tjSdqQC9McQ640LqX0ZXuQ5TNm9NVK8Wav9pyzFx8lS1Bu4vn+wvULbTLc1JrPWr0bJ8fgYH7H6APcfIsloXg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QlVADUyp02L4liYBJT+4Wfh54VZXXIefrz5iOo2QzrAfTWVbc4i6DHrXq6ohNFIJD8N9StyBaf4ZODmk/nLh/ggSGE9SXimqBFzag5Z7018PsGBF5PbEt5OGYVbqnWYRwOJ4xM09ot/polQiZYy2AS6Zoavhwp//pELMcaY+CZsbzKZCrFO05L/9EE9OPhFsErthisR1J+nxuDDOHKG3gym+RWjuEV7si92sxMZU11oogZRGfgChCGK1adwJ15H1l6MVgnXpt2KL3TTCj5w5NjCpPWORFalvudmcULVxRakE8WC1/QuUH5tOfjCMAJsuAocKGCCgQ0z+PqH4pPYjhw==
  • Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=durham.ac.uk;
  • Cc: Tim Deegan <tim@xxxxxxx>
  • Delivery-date: Tue, 30 Jun 2020 22:21:53 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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.

        Michael Young



 


Rackspace

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