Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107523480
D36269.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D36269.diff
View Options
diff --git a/usr.sbin/bhyve/pci_e82545.c b/usr.sbin/bhyve/pci_e82545.c
--- a/usr.sbin/bhyve/pci_e82545.c
+++ b/usr.sbin/bhyve/pci_e82545.c
@@ -1466,9 +1466,12 @@
uint16_t head, rhead, tail, size;
int lim, tdwb, sent;
- head = sc->esc_TDH;
- tail = sc->esc_TDT;
size = sc->esc_TDLEN / 16;
+ if (size == 0)
+ return;
+
+ head = sc->esc_TDH % size;
+ tail = sc->esc_TDT % size;
DPRINTF("tx_run: head %x, rhead %x, tail %x",
sc->esc_TDH, sc->esc_TDHr, sc->esc_TDT);
@@ -1734,12 +1737,17 @@
e82545_tx_update_tdba(sc);
break;
case E1000_TDH(0):
- //assert(!sc->esc_tx_enabled);
- /* XXX should only ever be zero ? Range check ? */
+ if (sc->esc_tx_enabled) {
+ WPRINTF("ignoring write to TDH while transmit enabled");
+ break;
+ }
+ if (value != 0) {
+ WPRINTF("ignoring non-zero value written to TDH");
+ break;
+ }
sc->esc_TDHr = sc->esc_TDH = value;
break;
case E1000_TDT(0):
- /* XXX range check ? */
sc->esc_TDT = value;
if (sc->esc_tx_enabled)
e82545_tx_start(sc);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jan 16, 10:10 AM (20 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15823818
Default Alt Text
D36269.diff (1 KB)
Attached To
Mode
D36269: bhyve e1000: Sanitize transmit ring indices.
Attached
Detach File
Event Timeline
Log In to Comment