[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [qemu-xen-traditional master] rtl8139: check IP Total Length field
commit 7b42ec15206ce1038fde15398d79e3dba516cd98 Author: Stefan Hajnoczi <stefanha@xxxxxxxxxx> AuthorDate: Wed Jul 15 18:17:02 2015 +0100 Commit: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> CommitDate: Tue May 10 19:11:50 2016 +0100 rtl8139: check IP Total Length field The IP Total Length field includes the IP header and data. Make sure it is valid and does not exceed the Ethernet payload size. Signed-off-by: Stefan Hajnoczi <stefanha@xxxxxxxxxx> [Backport to qemu-xen-tradition] Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> --- hw/rtl8139.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hw/rtl8139.c b/hw/rtl8139.c index b71ea62..d49d6fa 100644 --- a/hw/rtl8139.c +++ b/hw/rtl8139.c @@ -2144,7 +2144,12 @@ static int rtl8139_cplus_transmit_one(RTL8139State *s) } ip_protocol = ip->ip_p; - ip_data_len = be16_to_cpu(ip->ip_len) - hlen; + + ip_data_len = be16_to_cpu(ip->ip_len); + if (ip_data_len < hlen || ip_data_len > eth_payload_len) { + goto skip_offload; + } + ip_data_len -= hlen; if (txdw0 & CP_TX_IPCS) { -- generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#master _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |