From: Sunil Kumar Kori <skori@marvell.com>
To: Oleksandr Nahnybida <oleksandrn@interfacemasters.com>,
Jerin Jacob <jerinj@marvell.com>,
Tyler Retzlaff <roretzla@linux.microsoft.com>,
David Marchand <david.marchand@redhat.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, "stable@dpdk.org" <stable@dpdk.org>
Subject: RE: [EXTERNAL] [PATCH v2] trace: fix out of bounds write in __rte_trace_mem_get
Date: Tue, 29 Apr 2025 10:52:28 +0000 [thread overview]
Message-ID: <CO6PR18MB38604A74D8305EA331193DF9B4802@CO6PR18MB3860.namprd18.prod.outlook.com> (raw)
In-Reply-To: <20250424170818.23970-1-oleksandrn@interfacemasters.com>
> Offset should be aligned first before checking if there is free space for another
> write.
>
> Bugzilla ID: 1665
> Fixes: 032a7e5499a0 ("trace: implement provider payload")
>
> Signed-off-by: Oleksandr Nahnybida <oleksandrn@interfacemasters.com>
> ---
> Specified correct "Fixes" commit.
>
> lib/eal/include/rte_trace_point.h | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/lib/eal/include/rte_trace_point.h
> b/lib/eal/include/rte_trace_point.h
> index 8a317d31d2..343e0271b3 100644
> --- a/lib/eal/include/rte_trace_point.h
> +++ b/lib/eal/include/rte_trace_point.h
> @@ -328,7 +328,7 @@ __rte_trace_mem_get(uint64_t in)
> return NULL;
> }
> /* Check the wrap around case */
> - uint32_t offset = trace->offset;
> + uint32_t offset = RTE_ALIGN_CEIL(trace->offset,
> +__RTE_TRACE_EVENT_HEADER_SZ);
> if (unlikely((offset + sz) >= trace->len)) {
> /* Disable the trace event if it in DISCARD mode */
> if (unlikely(in & __RTE_TRACE_FIELD_ENABLE_DISCARD))
> @@ -336,8 +336,6 @@ __rte_trace_mem_get(uint64_t in)
>
> offset = 0;
> }
> - /* Align to event header size */
> - offset = RTE_ALIGN_CEIL(offset, __RTE_TRACE_EVENT_HEADER_SZ);
> void *mem = RTE_PTR_ADD(&trace->mem[0], offset);
> offset += sz;
> trace->offset = offset;
> --
> 2.49.0
Acked-by: Sunil Kumar Kori <skori@marvell.com>
prev parent reply other threads:[~2025-04-29 10:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-02 9:33 [PATCH] " Oleksandr Nahnybida
2025-04-03 9:18 ` [EXTERNAL] " Sunil Kumar Kori
2025-04-03 9:25 ` David Marchand
2025-04-24 17:08 ` [PATCH v2] " Oleksandr Nahnybida
2025-04-29 10:52 ` Sunil Kumar Kori [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=CO6PR18MB38604A74D8305EA331193DF9B4802@CO6PR18MB3860.namprd18.prod.outlook.com \
--to=skori@marvell.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=jerinj@marvell.com \
--cc=oleksandrn@interfacemasters.com \
--cc=roretzla@linux.microsoft.com \
--cc=stable@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).