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

Re: [XEN PATCH 05/13] automation/eclair: add deviation for usercopy.c


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Simone Ballarin <simone.ballarin@xxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 31 Aug 2023 11:24:10 +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=CQ0PLe+WtKPy3GfzvVjreGQH1XpqazgsXE3D5NO1w0o=; b=oe4ZRp67ZnE/Eh+e8pAII3EnNS2YJS1cLrrSwNI9EYQCakqpcZRaf4MhxO/trrSEoSkpgPOv5/yX3pby9+jJSS7eTJUTMQT9q8fc63fw3Egbytf9i7IkXAzD+nvULl5sV20q6jrecdplocuMY5BZQOz8LZXYKUBXYVBzVDmWV4nlryjWvzbMO7e1/GATP8gaUFJ00MelaRJjGqdnLUa1LNsmkJtwSyR18G2zTx5bwPCX5S9hIO6kMCLDLazDr1dk9+RUGhpmKix+WaGY3ywBMwF7Vo/U9SFfvLPDhdl+O9RnydntM+rTbwgGWoxTbY2Wb36qUIaXQ8nPY+4rzrIS5w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jRHLl6yc329zWu6VWroqRbOqWdzffccRqGAJ+bPCMRt7v3DuOAnA9KZs4CUqIrFvbnfw2eZkTaleYbt9RRYKa551VgGhJ49YokQyRYBzy9v57OZ6DNCg1jI9d5cc3Blz6ddmV1dxxdL+bgFkblxu1sNY24O3HEDofw/9H6sfse3+TkKpdO5sDzdHPYqyAzZ9EmC958eJkBZGm14ukcYikP5rxuaCOO2e3I/MAynz1QDZ8/Ey0yozp1+d+YFsSlcsqji5qn1KP4S+viDJoLqmc7W8TvVXxS+md9omQpf7HU4oybUY9mkFTq1X3ZN5390clIgY2dCX+YqtbakcKmddwg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, consulting@xxxxxxxxxxx, Doug Goldstein <cardoe@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Wei Liu <wl@xxxxxxx>, nicola.vetrini@xxxxxxxxxxx, Bertrand.Marquis@xxxxxxx, Luca.Fancellu@xxxxxxx, michal.orzel@xxxxxxx
  • Delivery-date: Thu, 31 Aug 2023 09:24:34 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 31.08.2023 03:56, Stefano Stabellini wrote:
> On Wed, 30 Aug 2023, Simone Ballarin wrote:
>> On 29/08/23 00:27, Stefano Stabellini wrote:
>>> On Mon, 28 Aug 2023, Simone Ballarin wrote:
>>> --- a/xen/arch/x86/usercopy.c
>>> +++ b/xen/arch/x86/usercopy.c
>>> @@ -1,3 +1,4 @@
>>> +/* SAF-1-safe */
>>>   /*
>>>    * User address space access functions.
>>>    *
>>>  > Otherwise, maybe we should extend safe.json to also have an extra field
>>> with a list of paths. For instance see "files" below >
>>> {
>>>      "version": "1.0",
>>>      "content": [
>>>          {
>>>              "id": "SAF-0-safe",
>>>              "analyser": {
>>>                  "eclair": "MC3R1.R8.6",
>>>                  "coverity": "misra_c_2012_rule_8_6_violation"
>>>              },
>>>              "name": "Rule 8.6: linker script defined symbols",
>>>              "text": "It is safe to declare this symbol because it is
>>> defined in the linker script."
>>>          },
>>>          {
>>>              "id": "SAF-1-safe",
>>>              "analyser": {
>>>                  "eclair": "MC3R1.D4.10"
>>>              },
>>>              "name": "Dir 4.10: files that include themselves",
>>>              "text": "Files purposely written to include themselves are not
>>> supposed to comply with D4.10.",
>>>              "files": ["xen/arch/x86/usercopy.c"]
>>>          },
>>>          {
>>>              "id": "SAF-2-safe",
>>>              "analyser": {},
>>>              "name": "Sentinel",
>>>              "text": "Next ID to be used"
>>>          }
>>>      ]
>>> }
>>>
>> In general, I prefer the first option for such ad hoc deviation (the comment
>> at the beginning of the file): this way, anyone who touches the file will
>> immediately see the comment and think as its changes will affect the 
>> deviation
>> (is it still safe? is it still necessary?).
>>
>> To help the developer more, I think it is better to also add the "name" in 
>> the
>> comment, this is my proposal:
>>
>> /* SAF-4-safe Dir 4.10: files that include themselves*/
> 
> Yes, this is fine, it was always intended to be possible to add the
> name of the deviation or a short comment in the in-code comment

But then either the directive number wants omitting, or the Misra version
needs to also be stated.

Jan



 


Rackspace

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