From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: xen-devel@lists.xenproject.org,
"Andrew Cooper" <andrew.cooper3@citrix.com>,
"Julien Grall" <julien@xen.org>,
"Stefano Stabellini" <sstabellini@kernel.org>,
"Anthony PERARD" <anthony.perard@vates.tech>,
"Michal Orzel" <michal.orzel@amd.com>,
"Roger Pau Monné" <roger.pau@citrix.com>,
"Teddy Astie" <teddy.astie@vates.tech>
Subject: Re: [PATCH] radix-tree: don't left-shift negative values
Date: Thu, 13 Feb 2025 16:32:21 +0100 [thread overview]
Message-ID: <e34113912d9886a876fd5f3bd094abb2@bugseng.com> (raw)
In-Reply-To: <2118904d-3a33-47f3-af68-7303bc17186c@suse.com>
On 2025-02-13 16:01, Jan Beulich wrote:
> On 13.02.2025 15:52, Nicola Vetrini wrote:
>> On 2025-02-13 15:22, Jan Beulich wrote:
>>> Any (signed) integer is okay to pass into radix_tree_int_to_ptr(),
>>> yet
>>> left shifting negative values is UB. Use an unsigned intermediate
>>> type,
>>> reducing the impact to implementation defined behavior (for the
>>> unsigned->signed conversion).
>>>
>>> Also please Misra C:2012 rule 7.3 by dropping the lower case numeric
>>> 'l'
>>> tag.
>>>
>>> No difference in generated code, at least on x86.
>>>
>>> Fixes: b004883e29bb ("Simplify and build-fix (for some gcc versions)
>>> radix_tree_int_to_ptr()")
>>> Reported-by: Teddy Astie <teddy.astie@vates.tech>
>>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>>> ---
>>> Bugseng: Why was the 7.3 violation not spotted by Eclair? According
>>> to
>>> tagging.ecl the codebase is clean for this rule, aiui.
>>>
>>
>> radix-tree.{c,h} is out of scope:
>>
>> automation/eclair_analysis/ECLAIR/out_of_scope.ecl:32:-file_tag+={out_of_scope,"^xen/include/xen/radix-tree\\.h$"}
>> docs/misra/exclude-list.json:153: "rel_path":
>> "common/radix-tree.c",
>
> Is there a record of why they are excluded? Is it further explainable
> why exclude-list.json mentions only the .c file and out_of_scope.ecl
> mentions only the .h one? Shouldn't different parts be in sync?
>
exclude-list.json is used to generate a configuration file for ECLAIR
just before the analysis starts, so effectively both are excluded. It's
a good point however to have only one file to handle exclusions, and use
that file to generate the exclusion list dynamically, but then someone
might want to exclude certain files only in some analyses and not
others, which is not a good fit for exclude-list.json as it is now.
@Stefano, thoughts?
Thanks,
Nicola
>> We are in the process of setting up a wider analysis (i.e. with a
>> different exclusion set) with a broader configuration that may catch
>> these issues.
>
> Good.
>
> Jan
--
Nicola Vetrini, B.Sc.
Software Engineer
BUGSENG (https://bugseng.com)
LinkedIn: https://www.linkedin.com/in/nicola-vetrini-a42471253
next prev parent reply other threads:[~2025-02-13 15:32 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-13 14:22 [PATCH] radix-tree: don't left-shift negative values Jan Beulich
2025-02-13 14:52 ` Nicola Vetrini
2025-02-13 15:00 ` Andrew Cooper
2025-02-13 15:01 ` Jan Beulich
2025-02-13 15:32 ` Nicola Vetrini [this message]
2025-02-13 15:42 ` Nicola Vetrini
2025-02-13 16:39 ` Luca Fancellu
2025-02-13 19:26 ` Stefano Stabellini
2025-02-13 19:39 ` Andrew Cooper
2025-02-13 21:46 ` Stefano Stabellini
2025-02-14 7:44 ` Jan Beulich
2025-02-14 7:41 ` Jan Beulich
2025-02-13 14:53 ` Andrew Cooper
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e34113912d9886a876fd5f3bd094abb2@bugseng.com \
--to=nicola.vetrini@bugseng.com \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@vates.tech \
--cc=jbeulich@suse.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--cc=teddy.astie@vates.tech \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.