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

Re: [PATCH for-4.15 5/5] tools/xenstored: Silence coverity when using xs_state_* structures


  • To: Julien Grall <julien@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Thu, 25 Feb 2021 17:47:21 +0000
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; 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=p0bB5LXPhj/u6QZchLuLKzPAVBdmryQ3cjYIYo1x/6E=; b=KxossKtavnSTB0+1kPEfe3OsL2O5fZ5qyX+6fKOdIzssYccaX4L09lXmztK2TOOYjutl9oYFzfaXaVrtIyK+1bphnuh6sxBV+1IZZUMaHW9KxM3nZxGkV0nxporACJHOCdkr2U2fnaoxoTmXEO+Gp+yRPV391w5KMal0rso41TCmzEJay1MrCUt5LNzTqTlNVOk0XPP9z4A9gP8HL7HhcS996eJ4hAajh/Ir19o/T31x339gBsLpp82Il7nRJbSq8NTQwh2Rpw0NCRA/93J7wtbDvRCqkl/3yunejUkt0Ip+cBQPQe3bjdZF5HSDKkCJoxmCgnOzkYwZGIWpTD2MLg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iwm6rvTyav1Ibe578hr45EgfNe2XIEMFMSBY3+cvySZLJ5dckCrIJ2B9LYR2GmiHx2L3LGsSzcMmF4OMm/5y++BXfdvXsfgOvYe4YmXIJ7zt6hQkjAZVEwn7l/ObEEcQe/V2TY2/TN45NDRV00MqZ+0BUHAou53f0KaWQVb+BKP8VrXe/CaJW4gXCGQ4u465KVZiYqsZa8TMMxRCJGXwDPuZS+7+Iu3caymDlfw/dhckhglXIIz+/WuPyAh2g7MPX+W261I2ZabvbEDbLi4CZe2BaAioBaaYy/peFIjC6vHXkpKfVEo1tmXUmRCZbt+RH3iDr2CLe95Eikouam2EBQ==
  • Authentication-results: esa4.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: <raphning@xxxxxxxxxxxx>, <iwj@xxxxxxxxxxxxxx>, Julien Grall <jgrall@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Juergen Gross <jgross@xxxxxxxx>
  • Delivery-date: Thu, 25 Feb 2021 17:47:42 +0000
  • Ironport-sdr: RKl/JzpNylub9Xb3FH6IJYZ8tZbK8RElC4/hAt3HnljLh3YTIv7AOOIaQK0AsmbI5SbKL3Di2p umplfgHzdYtMT5yGQJHp+/qtGZmKaMuG+W6HMNDcrwgczky5PJVd23f07D3RevKCtQ7lbZXcGO FQ7CByB+UqHzTVZqy8d/twT8KLkCEx4Vus6gb9hGU3PsfZdrbFTFPZuACJtJU11+g9QiqKRZfR qWDPg8jHWP0lHOegY77oMmLC9g/sjN6UNxNOYfAiXcTpdqTPgACcbg+4nt9tAOYZ7wvjeP5JBs HuU=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 25/02/2021 17:41, Julien Grall wrote:
> From: Julien Grall <jgrall@xxxxxxxxxx>
>
> Coverity will report unitialized values for every use of xs_state_*
> structures in the save part. This can be prevented by using the [0]
> rather than [] to define variable length array.
>
> Coverity-ID: 1472398
> Coverity-ID: 1472397
> Coverity-ID: 1472396
> Coverity-ID: 1472395
> Signed-off-by: Julien Grall <jgrall@xxxxxxxxxx>
>
> ---
>
> From my understanding, the tools and the hypervisor already rely on GNU
> extensions. So the change should be fine.
>
> If not, we can use the same approach as XEN_FLEX_ARRAY_DIM.

Linux has recently purged the use of [0] because it causes sizeof() to
do unsafe things.

Flexible array members is a C99 standard - are we sure that Coverity is
doing something wrong with them?

~Andrew



 


Rackspace

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