From: Stephen Hemminger <stephen@networkplumber.org>
To: "Ouyang, Changchun" <changchun.ouyang@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH 2/3] virtio: fix Coverity unsigned warnings
Date: Mon, 31 Aug 2015 09:44:56 -0700 [thread overview]
Message-ID: <20150831094456.739b2f65@urahara> (raw)
In-Reply-To: <F52918179C57134FAEC9EA62FA2F962511CEC6A8@shsmsx102.ccr.corp.intel.com>
On Mon, 31 Aug 2015 01:38:44 +0000
"Ouyang, Changchun" <changchun.ouyang@intel.com> wrote:
> Hi Stephen,
>
> > -----Original Message-----
> > From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> > Sent: Saturday, August 29, 2015 12:24 AM
> > To: Xie, Huawei; Ouyang, Changchun
> > Cc: dev@dpdk.org; Stephen Hemminger
> > Subject: [PATCH 2/3] virtio: fix Coverity unsigned warnings
> >
> > There are some places in virtio driver where uint16_t or int are used where it
> > would be safer to use unsigned.
>
> Why will it be safer?
Integer to unsigned conversion risks bugs about sign extension and wrap around.
There is a whole class of security related bug possiblities caused by just this
kind of thing. In this case the code is hidden behind layers which make
it unlikely to be exploitable, but as a general policy it is best not to use
signed types unless absolutely necessary.
That is why tools like Coverity are so picky about this.
next prev parent reply other threads:[~2015-08-31 16:44 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-28 16:23 [dpdk-dev] [PATCH 0/3] virtio: patches for 2.1+ Stephen Hemminger
2015-08-28 16:23 ` [dpdk-dev] [PATCH 1/3] virtio: don't report link state feature unless available Stephen Hemminger
2015-08-31 2:54 ` Ouyang, Changchun
2015-08-28 16:23 ` [dpdk-dev] [PATCH 2/3] virtio: fix Coverity unsigned warnings Stephen Hemminger
2015-08-31 1:38 ` Ouyang, Changchun
2015-08-31 16:44 ` Stephen Hemminger [this message]
2015-08-28 16:23 ` [dpdk-dev] [PATCH 3/3] virtio: fix possible NULL dereference Stephen Hemminger
2015-08-31 1:07 ` Ouyang, Changchun
2015-10-21 14:18 ` [dpdk-dev] [PATCH 0/3] virtio: patches for 2.1+ Thomas Monjalon
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=20150831094456.739b2f65@urahara \
--to=stephen@networkplumber.org \
--cc=changchun.ouyang@intel.com \
--cc=dev@dpdk.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 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).