zxdh_bar_irq_recv() allocates a buffer for the payload of every<br />message it takes off the BAR channel and frees it on two of its three<br />exits. The third exit, taken when the header is marked asynchronous<br />and not an ack, returns with the buffer still allocated. Those two<br />header bits are written by the VF itself, so a guest can pin about<br />2176 bytes of the process-wide rte_malloc heap per message, with no<br />per-VF accounting, until the heap is full: the PF then stops<br />answering mailbox requests from every VF and its own table updates<br />fail until the process is restarted.<br /> <br />Route that path through the existing exit label so the buffer is<br />freed like on the other two paths. The return value is unchanged<br />(ZXDH_BAR_MSG_OK is 0) and synchronous and acked messages are<br />untouched.<br /> <br />Fixes: 3630ac8bd81f ("net/zxdh: configure interrupt")<br />Cc: stable@dpdk.org<br /> <br />Signed-off-by: Junlong Wang <wang.junlong1@zte.com.cn> <br />---<br /> drivers/net/zxdh/zxdh_msg.c | 5 +----<br /> 1 file changed, 1 insertion(+), 4 deletions(-)<br /> <br />diff --git a/drivers/net/zxdh/zxdh_msg.c b/drivers/net/zxdh/zxdh_msg.c<br />index 6aafefe289..c7a3281987 100644<br />--- a/drivers/net/zxdh/zxdh_msg.c<br />+++ b/drivers/net/zxdh/zxdh_msg.c<br />@@ -1023,11 +1023,8 @@ zxdh_bar_irq_recv(uint8_t src, uint8_t dst, uint64_t virt_addr, void *dev)<br />         goto exit;<br />     }<br />     zxdh_bar_chan_msg_valid_set(recv_addr, ZXDH_BAR_MSG_CHAN_USABLE);<br />-    if (msg_header.ack == ZXDH_BAR_CHAN_MSG_ACK) {<br />+    if (msg_header.ack == ZXDH_BAR_CHAN_MSG_ACK)<br />         zxdh_bar_msg_ack_async_msg_proc(&msg_header, recved_msg);<br />-        goto exit;<br />-    }<br />-    return 0;<br />  <br /> exit:<br />     rte_free(recved_msg);<br />--  <br />2.27.0<br />