]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commit
rtl8139: validate rx ring before receiving packets
authorJason Wang <jasowang@redhat.com>
Thu, 17 May 2012 05:25:43 +0000 (13:25 +0800)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Fri, 29 Jun 2012 15:22:30 +0000 (10:22 -0500)
commitb7093f294c330c4db789c077dac9d8611e4f8ee0
tree0a662b329a8944fe8017d340806fc4b1b57ab984
parentcd63a77e990f68a699ba220c8006386bd4379f81
rtl8139: validate rx ring before receiving packets

Commit ff71f2e8cacefae99179993204172bc65e4303df prevent the possible
crash during initialization of linux driver by checking the operating
mode.This seems too strict as:

- the real card could still work in mode other than normal
- some buggy driver who does not set correct opmode after eeprom
 access

So, considering rx ring address were reset to zero (which could be
safely trated as an address not intened to DMA to), in order to
both letting old guest work and preventing the unexpected DMA to
guest, we can forbid packet receiving when rx ring address is zero.

Tested-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit fcce6fd25f3e233f9da9ef01230a668ab35bd343)

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/rtl8139.c