[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Violations of mandatory MISRA C:2012 Rule 19.1 in X86_64 build
- To: Roberto Bagnara <roberto.bagnara@xxxxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Wed, 12 Jul 2023 14:49:51 +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=A9lCbn3DqAMl1RM2QPrZTbiQRfaWGrcLMBTpPLT9Qjc=; b=FnIT6132SVgNltVOKsK9pj4RaiQoprz1Dx4j3h3xy43E5C61WNwz9xkNPoCNC4zpshShoqzZdtK/xr1BcWgDqVx8i39AoX8okyTW43XIUMTY4sAXHGcLMvJ8dzb5cezZ1lfIv/0b4qBPK6Tz9l51A9zlIgiKe+uh+fFtFJmWSkf8QyTDV8R20QPFsVrJZEutxcFPWkKjGCxdJJuHRXjcTcKIx+/U8ZwPchKKCsZ+upyrknyvycCuZDZKHcQpnRlP+jEf25ieH1YvjjpwJLMAIdR+ATyXBuLkOJeYiX3Xr0anvw2f3xQO6uEA3rL7rppeFdf4O9zkE4kV1pWhDgkGBg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JwzK1DOq+IN1bQPeZ0BwmYbkonuEaih7dmCCjBlCnie/cU3be8+yUIR6RovQQ4YjQaoZlV8Vt22GEg80TnJihKxUeb2WNqXnh1h0ssmhA0mEUfoxnAHyHBCOgyM+i8kLNrxPHFpAYA/SQmqrHHCRduLHeRJFyFSfkBZVR5LS1IAPw/TkaOduw8Z82tROrxdGSbl+ZX+zykVE+w43SMVD8H6q2gXbm/o8mGzXT3xILdh5tQgWy/0Gtv0iSHsCv+W3A8DrmtGbjwof2algnYoN/w7funD9YfumN9Hxk6lsw/BQvf5jgvXkcqAvDclJj8C9jUyMDSVJgj06kv0JmydBug==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
- Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx
- Delivery-date: Wed, 12 Jul 2023 12:50:05 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 11.07.2023 18:40, Roberto Bagnara wrote:
> Mandatory Rule 19.1 (An object shall not be assigned or copied to an
> overlapping object) is directly targeted at two undefined behaviors,
> one of which is the subject of 6.5.16.1p3, namely:
>
> If the value being stored in an object is read from another object
> that overlaps in any way the storage of the first object, then the
> overlap shall be exact and the two objects shall have qualified or
> unqualified versions of a compatible type; otherwise, the behavior
> is undefined.
>
> You can see a number of definite violations in the X86_64 build
> at this link:
>
>
> https://saas.eclairit.com:3787/fs/var/local/eclair/XEN.ecdf/ECLAIR_normal/origin/staging/X86_64-Set1/149/PROJECT.ecd;/by_service/MC3R1.R19.1.html
Hmm, gives me "Unauthorized".
> As the rule is mandatory, it cannot be deviated.
Which is odd, and that's in turn because the C spec is overly strict
imo. Considering the one example we looked at yesterday, I have a hard
time seeing what UB there would be on little-endian hardware. Both
fields (rip and eip) don't overlap exactly, but their low halves (which
is all we care about here) do. With this I cannot come up with a way in
which the compiler could screw us up, even if it wanted to.
Jan
|