Page MenuHomeFreeBSD

D7316.1796064621.diff
No OneTemporary

Authored By
Unknown
Size
832 B
Referenced Files
None
Subscribers
None

D7316.1796064621.diff

Index: head/sys/dev/hyperv/vmbus/hv_ring_buffer.c
===================================================================
--- head/sys/dev/hyperv/vmbus/hv_ring_buffer.c
+++ head/sys/dev/hyperv/vmbus/hv_ring_buffer.c
@@ -339,8 +339,12 @@
mtx_lock_spin(&rbr->rxbr_lock);
+ /*
+ * The requested data and the 64bits channel packet
+ * offset should be there at least.
+ */
bytesAvailToRead = vmbus_rxbr_avail(rbr);
- if (bytesAvailToRead < dlen) {
+ if (bytesAvailToRead < dlen + sizeof(uint64_t)) {
mtx_unlock_spin(&rbr->rxbr_lock);
return (EAGAIN);
}
@@ -366,7 +370,7 @@
mtx_lock_spin(&rbr->rxbr_lock);
bytes_avail_to_read = vmbus_rxbr_avail(rbr);
- if (bytes_avail_to_read < dlen) {
+ if (bytes_avail_to_read < dlen + offset + sizeof(prev_indices)) {
mtx_unlock_spin(&rbr->rxbr_lock);
return (EAGAIN);
}

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 30, 6:50 PM (16 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
42110359
Default Alt Text
D7316.1796064621.diff (832 B)

Event Timeline