OSDN Git Service

e1000: fix tx re-entrancy problem
authorJon Maloy <jmaloy@redhat.com>
Thu, 21 Oct 2021 16:10:47 +0000 (12:10 -0400)
committerJason Wang <jasowang@redhat.com>
Fri, 5 Nov 2021 03:31:42 +0000 (11:31 +0800)
commit25ddb946e6301f42cff3094ea1c25fb78813e7e9
treeebd531cf0f6edf64bd486504cf8991bd0af7ffc2
parent18e356a53a2926a15343b914db64324d63748f25
e1000: fix tx re-entrancy problem

The fact that the MMIO handler is not re-entrant causes an infinite
loop under certain conditions:

Guest write to TDT ->  Loopback -> RX (DMA to TDT) -> TX

We now eliminate the effect of this problem locally in e1000, by adding
a boolean in struct E1000State indicating when the TX side is busy. This
will cause any entering new call to return early instead of interfering
with the ongoing work, and eliminates any risk of looping.

This is intended to address CVE-2021-20257.

Signed-off-by: Jon Maloy <jmaloy@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
hw/net/e1000.c