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

Re: [XEN PATCH] xen: address MISRA C:2012 Rule 4.1


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 20 Jul 2023 17:25:33 +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=o72YJS/1sdXQthRVTF0KP5aExV/SVHvJBGL3szoa2r0=; b=eAluaNGVIW0iM/iIxTWHAUwFwII4DUyNWPzfq3IHonCgcnXflEk8N8WMT3HWGHUqi4u66waoRGjvgqez7lVsW03P9/mTnkjGDfCh7O8tl74pG3JTB73xzeXZ08XK520KeuBUkViIom2Xm+YRsz1y1QzgAgV5FfuWZ27vvtJvMYquZ2MvplsMdvnNp5TD23iHzLdimBcI3MGXt1sQlzmiFRDm/5y8nppxgHbh/xuLEowy5mKA8vDmEIHgBVMA4M+fPjwaGPFRXwEqceNN1CJKb4eNOsMhgLUC1THOoPSqP6kmWndX1DOUCqBSsMSVlcd0QiI0YPuAHNtsNtB2kEzdSw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jSX56l2HT+GVQb50RrKTZ8qUFbllW/k8f7Ze3xaC+rlXlxySRGzigB5ComUf4iwP/B2yPMyTvbN1azN2C34ffEk76ul5S2qrYDz1ZSRqCkNMK6IWJ+uQ6GjJlSr4NQAu5j8a9DitU2NeuMZEJsgAkJLYLsqNGuzy/pr/5cht45rJHPk8EvTggx2lFZS/aU/HyrH2ildG11t/v3npn9W1pBUmfGKWLdr/e85uzwg/VOaklSCBVVmG1MkVfSFGjunCEstdK3ywyvdPY82PUbQxBFKHCqX2NwN4AdesmlwGH8bY1gyOvKtSr5Lc8coTCwiYk2bymF9dJZjFeGilcBkbEQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, michal.orzel@xxxxxxx, xenia.ragiadakou@xxxxxxx, ayan.kumar.halder@xxxxxxx, consulting@xxxxxxxxxxx, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>
  • Delivery-date: Thu, 20 Jul 2023 15:26:08 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 20.07.2023 02:23, Stefano Stabellini wrote:
> On Wed, 19 Jul 2023, Nicola Vetrini wrote:
>> MISRA C:2012 Rule 4.1 has the following headline:
>> "Octal and hexadecimal escape sequences shall be terminated."
>>
>> The string literals modified by this patch contain octal or
>> hexadecimal escape sequences that are neither terminated by the
>> end of the literal, nor by the beginning of another escape sequence.
>>
>> Therefore, such unterminated sequences have been split into a
>> separate literal as a way to comply with the rule and preserve the
>> semantics of the code.
>>
>> No functional changes.
>>
>> Signed-off-by: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
> 
> Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>

In order to get this off the plate
Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
albeit I'm not overly happy with ...

>> --- a/xen/arch/x86/hvm/hvm.c
>> +++ b/xen/arch/x86/hvm/hvm.c
>> @@ -3853,7 +3853,7 @@ void hvm_ud_intercept(struct cpu_user_regs *regs)
>>                                          cs, &addr) &&
>>               (hvm_copy_from_guest_linear(sig, addr, sizeof(sig),
>>                                           walk, NULL) == HVMTRANS_okay) &&
>> -             (memcmp(sig, "\xf\xbxen", sizeof(sig)) == 0) )
>> +             (memcmp(sig, "\xf\xb" "xen", sizeof(sig)) == 0) )

... this. Imo it should never have been a string literal here. But
I'm also not really up to making yet another alternative patch.

Jan



 


Rackspace

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