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

Re: [PATCH] xsm: misra rule 8.4 fix


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Wed, 7 Dec 2022 13:33:25 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); 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=nBWhfeSt4SfbMufp38iIBdJ6FQhv/mSDx8J7idlk9LI=; b=YuP/G86HUMS8w9n05yZgMjNytvxmBN+00dptAkqRJ60BQhMcLk7w2KNLelQoDXXV0J1IHSFQagFNdmSnyfpAfWV7sgXaQHGTWtUgHWPQJh2RsPbGRXn7uymr0hLy9dMix1wyPxbaqWy9Motakzfw+pgV9qtTcoHyCUbQH7Z/LO/6PoDZ46oHzW3YLBAVJvuMIdX+gzrHlh7o744rynan/0XSWqQFiRk2BwFeyZJOTsx62fgjjirzcPbF+9chL1ZXqSu38ynxmv1phVq+nlk0s8/0mDvhAx1Xhf3SnXXV97sArlkqHKqW9pybBkEZipSqmSC/OX35n8f+Lv+3PdEpwQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fsoH+8mQ1rvqWyMkWt1B/SgOPqiJALruk+WTN9LS67vU5gYN0MASAfu2thzd+BT0QFZt1Blt9wj4fazOBRn+/nR4GKcGTvplW+R/rtxqZKoZCUQDZKbAAA/K7/UecAh6pEwmV8jiIEpugelxCTS/ksht+WssSBIlwuyLoeHIkUnPusPJMM+GS8+V3XkcqqjYe6s3etjzCPW+kbnAI2QaADNSZb14koejslUtz0I6ycxbYooV1kIzORjyy1usxLGfwFYQYnz2W+cO/N7MfWH63Jen8H7W8mld/xNX8CTK5ztcHYWOY656znPhFnhyQNefS4EtpXoPvaZneQSlUVVOeg==
  • Cc: <dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 07 Dec 2022 12:33:43 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Stefano,

On 07/12/2022 03:12, Stefano Stabellini wrote:
> 
> 
> Fix two MISRA Issues Rule 8.4 ("A compatible declaration shall be
> visible when an object or function with external linkage is defined")
> found by cppcheck affecting xen/xsm/flask/ss/services.c.
> 
> Fix the first issue by making policydb_loaded_version static and the
> second issue by declaring ss_initialized in a proper header.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxx>

cppcheck also reports findings for rule 8.4 with regards to the following 
functions:
- security_get_bools
- security_set_bools
- security_get_bool_value
- security_get_bool_name

The prototypes for them are stored in xen/xsm/flask/include/conditional.h,
but services.c only does:
#include "conditional.h"

This include refers to xen/xsm/flask/ss/conditional.h and not to 
xen/xsm/flask/include/conditional.h.
This means that we should also explicitly do:
#include <conditional.h>

This way we will fix all the findings in this file for the rule 8.4.

~Michal



 


Rackspace

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