From: Yuanhan Liu <yuanhan.liu@linux.intel.com>
To: Rich Lane <rich.lane@bigswitch.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] vhost: avoid buffer overflow in update_secure_len
Date: Wed, 18 Nov 2015 13:32:51 +0800 [thread overview]
Message-ID: <20151118053251.GY2326@yliu-dev.sh.intel.com> (raw)
In-Reply-To: <CAGSMBPNfKZidDsGpsmYCzW+38uUxwJRn4TB6s-spWt62T0ASag@mail.gmail.com>
On Tue, Nov 17, 2015 at 09:26:57PM -0800, Rich Lane wrote:
> On Tue, Nov 17, 2015 at 6:56 PM, Yuanhan Liu <yuanhan.liu@linux.intel.com>
> wrote:
>
> @@ -519,6 +526,8 @@ virtio_dev_merge_rx(struct virtio_net *dev, uint16_t
> queue_id,
> goto merge_rx_exit;
> } else {
> update_secure_len(vq, res_cur_idx,
> &secure_len, &vec_idx);
> + if (secure_len == 0)
> + goto merge_rx_exit;
> res_cur_idx++;
> }
> } while (pkt_len > secure_len);
>
>
> I think this needs to check whether secure_len was modified. secure_len is
> read-write and could have a nonzero value going into the call. It could be
> cleaner to give update_secure_len a return value saying whether it was able to
> reserve any buffers.
Good suggestion.
--yliu
>
> Otherwise looks good, thanks!
next prev parent reply other threads:[~2015-11-18 5:31 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-12 8:02 Rich Lane
2015-11-12 9:23 ` Yuanhan Liu
2015-11-12 21:46 ` Rich Lane
2015-11-17 13:23 ` Yuanhan Liu
2015-11-17 16:39 ` Rich Lane
2015-11-18 2:56 ` Yuanhan Liu
2015-11-18 5:23 ` Wang, Zhihong
2015-11-18 5:26 ` Rich Lane
2015-11-18 5:32 ` Yuanhan Liu [this message]
2015-11-18 6:13 ` Xie, Huawei
2015-11-18 6:25 ` Yuanhan Liu
2015-11-18 8:13 ` Xie, Huawei
2015-11-18 15:53 ` Stephen Hemminger
2015-11-18 16:00 ` Xie, Huawei
2015-11-18 7:53 ` Xie, Huawei
2015-11-18 8:48 ` Yuanhan Liu
2015-11-18 11:15 ` Xie, Huawei
2015-11-19 5:51 ` Yuanhan Liu
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=20151118053251.GY2326@yliu-dev.sh.intel.com \
--to=yuanhan.liu@linux.intel.com \
--cc=dev@dpdk.org \
--cc=rich.lane@bigswitch.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).