From: Ferruh Yigit Date: Thu, 11 Jul 2019 12:35:07 +0000 (+0100) Subject: kni: fix segmented mbuf data overflow X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=60d7debe922b14dcda96766fabbe7ad3f012800c;p=dpdk.git 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 --- 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);