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

Re: xen-analysis ECLAIR support


  • To: Michal Orzel <michal.orzel@xxxxxxx>
  • From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • Date: Mon, 4 Sep 2023 12:13:53 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Fa64oUxSBs8PZfZbcvMA1ZD2ib4mo9J4tT1DgDYUNA0=; b=OkNXVwzDOG4mGUurjviPnq6djDolFSobiIXllLq7XSUTlCBM6MM9/yBfdHCqfZ77rBRguxYsGUFI/Br4KA4i7u7SmdCHM2qQLR9KixhB4wsZzH7mXovlpfXOeuPmyzzWz2gAePW1MrWb9knFRat+NttN5oa0S7YT0VKPF7lHsFAuuBx4qw0o62y8Ypxb8UojnRKXZadfIe0x3cx0itzJXhQXogw1FnGHM7nAb47gy8krr0spkxquNC2407bTbfZsi1GIYZpycF24ZpZKzWlOtxwxAe0Dkola15+3ZJUv5w7VTvGVkt0Z1MgB+3VW2No7qR+YO9mZ3ys400U13oAHhg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XOtGxpeCq6Lr8Of+sDfb+SNzjcslttV3NGalNiBOwQXWwDnirYgH4z+L/IQOLZ4lx2fimlL4WSTj4JgxuXIQe523jVUteKQwHOt1gceQDdCBhKC3WlDmgY7GxZb1SRCaQpPGlro+DdMXQ6XRFjcQfBo4LZK7dFnBPuP1O6DUp1kdi3sPWsCzIe4nbLtKVmHuLhdirsWEwUmmRaWrlO8zbfg3hPzlP9e7UbR2BABRCY2aNIrgJixMntrkIXJF9mUCKuZq9jjdhhPhBBkzamCrnJDYXBbFC0F1zfFnfHK7Ci85uL1TKn43HXVZdmZAP1x+ROjCSVu3MCWvrdpJ8ETUrA==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, "nicola.vetrini@xxxxxxxxxxx" <nicola.vetrini@xxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Delivery-date: Mon, 04 Sep 2023 12:17:08 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHZ1tnZvpm8hZMDREGKKcjBarux3K/6q84AgA/4+wA=
  • Thread-topic: xen-analysis ECLAIR support


> On 25 Aug 2023, at 09:18, Michal Orzel <michal.orzel@xxxxxxx> wrote:
> 
> Hi Stefano,
> 
> On 25/08/2023 00:24, Stefano Stabellini wrote:
>> 
>> 
>> Hi Luca,
>> 
>> We are looking into adding ECLAIR support for xen-analysis so that we
>> can use the SAF-n-safe tags also with ECLAIR.
>> 
>> One question that came up is about multi-line statements. For instance,
>> in a case like the following:
>> 
>> diff --git a/xen/common/inflate.c b/xen/common/inflate.c
>> index 8fa4b96d12..8bdc9208da 100644
>> --- a/xen/common/inflate.c
>> +++ b/xen/common/inflate.c
>> @@ -1201,6 +1201,7 @@ static int __init gunzip(void)
>>     magic[1] = NEXTBYTE();
>>     method   = NEXTBYTE();
>> 
>> +    /* SAF-1-safe */
>>     if (magic[0] != 037 ||
>>         ((magic[1] != 0213) && (magic[1] != 0236))) {
>>         error("bad gzip magic numbers");
>> 
>> 
>> Would SAF-1-safe cover both 037, and also 0213 and 0213?
>> Or would it cover only 037?
>> 
>> We haven't use SAFE-n-safe extensively through the codebase yet but
>> my understanding is that SAFE-n-safe would cover the entire statement of
>> the following line, even if it is multi-line. Is that also your
>> understanding? Does it work like that with cppcheck?
> Looking at the docs and the actual script, only the single line below SAF 
> comment is excluded.
> So in your case you would require:
> 
> /* SAF-1-safe */
> if (magic[0] != 037 ||
>    /* SAF-1-safe */
>    ((magic[1] != 0213) && (magic[1] != 0236))) {
>    error("bad gzip magic numbers");

Yes correct

> 
> I guess this was done so that it is clear that someone took all the parts of 
> the statements into account
> and all of them fall into the same justification (which might not be the 
> case).
> 
> BTW. I don't think we have also covered the case where there is more than one 
> violation in a single line
> that we want to deviate (e.g. sth like /* SAF-1-safe, SAF-2-safe */

You are right, but it should work adding multiple comments in this way:

/* SAF-1-safe */
/* SAF-2-safe */
<code where violation 1 and 2 are in the same line>

> 
> ~Michal




 


Rackspace

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