DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] kni: fix possible buffer overflow
@ 2019-07-11 12:35 Ferruh Yigit
  2019-07-11 15:33 ` Stephen Hemminger
  0 siblings, 1 reply; 5+ messages in thread
From: Ferruh Yigit @ 2019-07-11 12:35 UTC (permalink / raw)
  To: dev; +Cc: Yangchao Zhou

'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.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 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 ad8365877..84341ac92 100644
--- a/kernel/linux/kni/kni_net.c
+++ b/kernel/linux/kni/kni_net.c
@@ -435,7 +435,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.21.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-07-19 18:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-11 12:35 [dpdk-dev] [PATCH] kni: fix possible buffer overflow Ferruh Yigit
2019-07-11 15:33 ` Stephen Hemminger
2019-07-18 21:24   ` Thomas Monjalon
2019-07-18 21:35     ` Thomas Monjalon
2019-07-19 18:34       ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).