rtl8139: avoid nested ifs in IP header parsing (CVE-2015-5165)
commit39b8e7dcaf04cbdb926b478f825b160d852752b5
authorStefan Hajnoczi <stefanha@redhat.com>
Wed, 15 Jul 2015 16:13:32 +0000 (15 17:13 +0100)
committerStefan Hajnoczi <stefanha@redhat.com>
Mon, 3 Aug 2015 12:06:59 +0000 (3 13:06 +0100)
tree61ad89a8348d673fb3dfdd1df0652ef728cbbcfd
parentcb48f67ad8c7b33c617d4f8144a27706e69fd688
rtl8139: avoid nested ifs in IP header parsing (CVE-2015-5165)

Transmit offload needs to parse packet headers.  If header fields have
unexpected values the offload processing is skipped.

The code currently uses nested ifs because there is relatively little
input validation.  The next patches will add missing input validation
and a goto label is more appropriate to avoid deep if statement nesting.

Reported-by: 朱东海(启路) <donghai.zdh@alibaba-inc.com>
Reviewed-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
hw/net/rtl8139.c