From 60d7debe922b14dcda96766fabbe7ad3f012800c Mon Sep 17 00:00:00 2001 From: Ferruh Yigit Date: Thu, 11 Jul 2019 13:35:07 +0100 Subject: [PATCH] kni: fix segmented mbuf data overflow 'kni_net_rx_lo_fifo()' can get segmented buffers, using 'pkt_len' for that case will be wrong and some values can cause buffer overflow in destination mbuf data. Fixes: d89a58dfe90b ("kni: support chained mbufs") Cc: stable@dpdk.org Signed-off-by: Ferruh Yigit Acked-by: Stephen Hemminger --- kernel/linux/kni/kni_net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/linux/kni/kni_net.c b/kernel/linux/kni/kni_net.c index a736407e66..7bd3a9f1ea 100644 --- a/kernel/linux/kni/kni_net.c +++ b/kernel/linux/kni/kni_net.c @@ -438,7 +438,7 @@ kni_net_rx_lo_fifo(struct kni_dev *kni) /* Copy mbufs */ for (i = 0; i < num; i++) { kva = pa2kva(kni->pa[i]); - len = kva->pkt_len; + len = kva->data_len; data_kva = kva2data_kva(kva); kni->va[i] = pa2va(kni->pa[i], kva); -- 2.20.1