Skip to content

Commit

Permalink
kni: fix segmented mbuf data overflow
Browse files Browse the repository at this point in the history
[ upstream commit 60d7deb ]

'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: d89a58d ("kni: support chained mbufs")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
  • Loading branch information
Ferruh Yigit authored and kevintraynor committed Aug 28, 2019
1 parent 78807f9 commit 8f00090
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/linux/kni/kni_net.c
Expand Up @@ -440,7 +440,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);

Expand Down

0 comments on commit 8f00090

Please sign in to comment.