DPDK usage discussions
 help / color / mirror / Atom feed
From: "Purnima, Kompella V" <Kompella.Purnima@commscope.com>
To: "users@dpdk.org" <users@dpdk.org>
Subject: IP reassembly can cause memory corruption?
Date: Wed, 8 Dec 2021 20:49:15 +0000	[thread overview]
Message-ID: <DM6PR14MB35974A0905D0E64FAC99E8219C6F9@DM6PR14MB3597.namprd14.prod.outlook.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 728 bytes --]

HI

I am using DPDK 19.11 version. Following are my findings

struct rte_ip_frag_death_row {
       uint32_t cnt;          /**< number of mbufs currently on death row */
       struct rte_mbuf *row[IP_FRAG_DEATH_ROW_MBUF_LEN];
       /**< mbufs to be freed */
};

#define      IP_FRAG_MBUF2DR(dr, mb)   ((dr)->row[(dr)->cnt++] = (mb))



When calling IP_FRAG_MBUF2DR, there is no check for cnt < IP_FRAG_DEATH_ROW_MBUF_LEN.
So whenever (cnt >= IP_FRAG_DEATH_ROW_MBUF_LEN) happens IP_FRAG_MBUF2DR will corrupt memory due to array-bound overflow.

Late arrival or non-arrival of all fragments of packets - any of these common scenarios can cause the corruption!!

Is this a known issue?

Thanks
Purnima



[-- Attachment #2: Type: text/html, Size: 7607 bytes --]

                 reply	other threads:[~2021-12-08 20:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DM6PR14MB35974A0905D0E64FAC99E8219C6F9@DM6PR14MB3597.namprd14.prod.outlook.com \
    --to=kompella.purnima@commscope.com \
    --cc=users@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).