[dpdk-dev] [PATCH] net/virtio: do not gso when no header is present

Yuanhan Liu yuanhan.liu at linux.intel.com
Mon Jan 30 13:42:41 CET 2017


On Tue, Jan 24, 2017 at 09:36:03PM +0100, Emmanuel Roullit wrote:
> Found with clang static analysis:
> lib/librte_vhost/virtio_net.c:723:17: warning:
> Access to field 'data_off' results in a dereference of a null pointer
> (loaded from variable 'tcp_hdr')
>         m->l4_len = (tcp_hdr->data_off & 0xf0) >> 2;
>                      ^~~~~~~~~~~~~~~~~

This is a good fix, thanks. But there are few minor nits. Firstly,
prefix is wrong: it should be "vhost" but not "net/virtio".

> Fixes: 2a51b1091cb5 ("vhost: support indirect descriptor in non-mergeable Rx")

That's not the original commit introduced such issue, d0cf91303d73
("vhost: add Tx offload capabilities") is.

I actually saw you have made this kind of mistakes (referencing the
wrong culprit commit) few times. I'm wondering how did you get that.

Besides those, I think it's a good candidate for a stable release:
thinking that a malicious guest might forge some invalid virtio net
headers, which would make this potential NULL dereference become real.

So, Cc: stable at dpdk.org,

And Applied to dpdk-next-virtio.

	--yliu


More information about the dev mailing list