From: "Xia, Chenbo" <chenbo.xia@intel.com>
To: "Jiang, Cheng1" <cheng1.jiang@intel.com>,
"maxime.coquelin@redhat.com" <maxime.coquelin@redhat.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] vhost: fix unintended sign extension in async split ring
Date: Wed, 12 May 2021 08:40:55 +0000 [thread overview]
Message-ID: <MN2PR11MB40630573FCD646954FC520C79C529@MN2PR11MB4063.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20210512023041.30507-1-cheng1.jiang@intel.com>
> -----Original Message-----
> From: Jiang, Cheng1 <cheng1.jiang@intel.com>
> Sent: Wednesday, May 12, 2021 10:31 AM
> To: maxime.coquelin@redhat.com; Xia, Chenbo <chenbo.xia@intel.com>
> Cc: dev@dpdk.org; Jiang, Cheng1 <cheng1.jiang@intel.com>
> Subject: [PATCH] vhost: fix unintended sign extension in async split ring
>
> Change the variable type in store_dma_desc_info_split() to fix
> suspicious implicit sign extension.
>
> Coverity issue: 370604, 370607, 370609
> Fixes: 3d6cb86b0de5 (vhost: refactor async split ring functions)
Miss "" here. Will add them when applying.
>
> Signed-off-by: Cheng Jiang <cheng1.jiang@intel.com>
> ---
> lib/vhost/virtio_net.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c
> index 8e36f4c340..9137a9923b 100644
> --- a/lib/vhost/virtio_net.c
> +++ b/lib/vhost/virtio_net.c
> @@ -1474,7 +1474,7 @@ static __rte_always_inline void
> store_dma_desc_info_split(struct vring_used_elem *s_ring, struct
> vring_used_elem *d_ring,
> uint16_t ring_size, uint16_t s_idx, uint16_t d_idx, uint16_t count)
> {
> - uint16_t elem_size = sizeof(struct vring_used_elem);
> + size_t elem_size = sizeof(struct vring_used_elem);
>
> if (d_idx + count <= ring_size) {
> rte_memcpy(d_ring + d_idx, s_ring + s_idx, count * elem_size);
> --
> 2.29.2
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
next prev parent reply other threads:[~2021-05-12 8:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-12 2:30 Cheng Jiang
2021-05-12 8:40 ` Xia, Chenbo [this message]
2021-05-12 8:42 ` Xia, Chenbo
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=MN2PR11MB40630573FCD646954FC520C79C529@MN2PR11MB4063.namprd11.prod.outlook.com \
--to=chenbo.xia@intel.com \
--cc=cheng1.jiang@intel.com \
--cc=dev@dpdk.org \
--cc=maxime.coquelin@redhat.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).