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

Re: xen-analysis ECLAIR support


  • To: Michal Orzel <michal.orzel@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 25 Aug 2023 10:28:23 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=LhU3D4cBeKzTMHJRkhxsFZi1AH/9cCcdV7wLjCUi+yE=; b=mBvroUnl1DMDPWDsNbeag0Iq3pXopVtqQyqaiMunCiNoHC4TW8j5+PLOyF4zaSsxLdNff2oBhxl9j6mZXLtE3upXZdbkM31HrJhfbZveUkDy2NwAkb99n+VwrKS7Hi2+m/TAiveCZRxE2S7cKI72fdQmIRRlvwvD13IMuFmNs76vuWCll6wChAArVyeHkxGyCv1PWoaZq1jaV13I6nPJ9wbJh8FZrHe2iznyKJXOJ4ElhKBbFChAzOBHWBO9GMSh7iIcA0FOMKr/s1XR59KShucCNx0KNZBlYbaryHQfU3+NcMjspB5GAXe8bcG2D1AXOq9+Bakl+vRSrtsfhUUdCQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dSuun+BhA21AtfUzdd/G9WHdpTseyYka45rudcquI/kLz18sygtTsHJpHmiWvPxNFnSiEeUfVIndOBDnzqWOXiNx65rP4QYuCDH5qK5ORsDGeP0pzUlCpnqFzLHNUKrWOkxrHeGwiknxXl4V/4h+cNmZn/eBdYkftArBVKUxu3i9Zd7S4ieGuERUSyMIMn99POvxzdVITyQk4p2yEVK5KzYCkULhNmMGcChnUwY29wWy8y6QRozCeIhFnP9Mc43esxxspuDsCtDJ80PMbaWR1wbgAUmLIE26IukZf29FwKg8JjM8NbA5DFYjVfU2oi2AUzaJGnpePRLu6CDC+sYKBw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: nicola.vetrini@xxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, bertrand.marquis@xxxxxxx, luca.fancellu@xxxxxxx, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • Delivery-date: Fri, 25 Aug 2023 08:28:38 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 25.08.2023 10:18, Michal Orzel 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");

Or (perhaps more neatly):

    /* SAF-1-safe */
    if (magic[0] != 037 || (magic[1] != 0213 && magic[1] != 0236)) {
        error("bad gzip magic numbers");

Jan



 


Rackspace

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