public inbox for dev@dpdk.org
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: "Morten Brørup" <mb@smartsharesystems.com>
Cc: dev@dpdk.org, Marat Khalili <marat.khalili@huawei.com>,
	Stephen Hemminger <stephen@networkplumber.org>,
	Christophe Fontaine <cfontain@redhat.com>,
	Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>,
	Wathsala Vithanage <wathsala.vithanage@arm.com>,
	stable@dpdk.org
Subject: Re: [PATCH v2] mbuf: fix read packet data
Date: Wed, 25 Mar 2026 23:33:32 +0100	[thread overview]
Message-ID: <4378235.OBFZWjSADL@thomas> (raw)
In-Reply-To: <20260319124329.729034-1-mb@smartsharesystems.com>

19/03/2026 13:43, Morten Brørup:
> The sum of offset + length, both 32 bit unsigned integers, could wrap
> around, causing comparisons to give the wrong result.
> This was fixed by using 64 bit instead of 32 bit for calculating the sum.
> 
> Note:
> When the branch is not taken for the initial "if ((uint64_t)off + len >
> rte_pktmbuf_pkt_len(m))" comparison, the sum is known to not exceed the
> maximum possible value of rte_pktmbuf_pkt_len(m), UINT32_MAX, and
> following sum calculations can proceed using 32 bit.
> 
> Also, fixed a related bug in an mbuf test case:
> It expected reading a length of UINT_MAX from a non-zero offset to not
> fail.
> And due to the offset+length wraparound bug, the read operation did not
> fail.
> This test case was updated to expect the read operation to fail.
> 
> Fixes: b84110e7baa2 ("mbuf: add function to read packet data")
> Fixes: 7b295dceea07 ("test/mbuf: add unit test cases")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Morten Brørup <mb@smartsharesystems.com>

Acked-by: Konstantin Ananyev <konstantin.ananyev@huawei.com>
Acked-by: Marat Khalili <marat.khalili@huawei.com>
Tested-by: Marat Khalili <marat.khalili@huawei.com>

Applied, thanks.




      parent reply	other threads:[~2026-03-25 22:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-19  8:40 [PATCH] mbuf: fix read packet data Morten Brørup
2026-03-19  9:36 ` Marat Khalili
2026-03-19 12:43 ` [PATCH v2] " Morten Brørup
2026-03-19 13:15   ` Konstantin Ananyev
2026-03-19 13:55     ` Morten Brørup
2026-03-19 14:21   ` Marat Khalili
2026-03-19 14:31     ` Morten Brørup
2026-03-25 22:33   ` Thomas Monjalon [this message]

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=4378235.OBFZWjSADL@thomas \
    --to=thomas@monjalon.net \
    --cc=cfontain@redhat.com \
    --cc=dev@dpdk.org \
    --cc=konstantin.v.ananyev@yandex.ru \
    --cc=marat.khalili@huawei.com \
    --cc=mb@smartsharesystems.com \
    --cc=stable@dpdk.org \
    --cc=stephen@networkplumber.org \
    --cc=wathsala.vithanage@arm.com \
    /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