From: Thomas Monjalon <thomas@monjalon.net>
To: Alexey Simakov <bigalex934@gmail.com>
Cc: Chaoyong He <chaoyong.he@corigine.com>,
Alejandro Lucero <alejandro.lucero@netronome.com>,
dev@dpdk.org, stable@dpdk.org
Subject: Re: [PATCH] net/nfp: fix UB in BAR size shift operations
Date: Fri, 10 Jul 2026 16:38:46 +0200 [thread overview]
Message-ID: <i8TrHM9iTYmeFC_7-DKzYQ@monjalon.net> (raw)
In-Reply-To: <20260707140112.140833-1-bigalex934@gmail.com>
07/07/2026 16:01, Alexey Simakov:
> The literal '1' is a signed 32-bit int. Shifting it by bar->bitsize
> is undefined behavior when bitsize >= 31, and sign-extends when
> bitsize == 31 (producing a wrong upper-bound check). BAR aperture
> sizes from hardware can exceed this range.
>
> Fix by using RTE_BIT64() which produces a 64-bit unsigned value,
> matching the type of the operands (uint64_t base, uint64_t offset).
>
> Fixes: c7e9729da6b5 ("net/nfp: support CPP")
> Fixes: 1fbe51cd9c3a ("net/nfp: extend usage of BAR from 8 to 24")
> Cc: stable@dpdk.org
>
> Signed-off-by: Alexey Simakov <bigalex934@gmail.com>
Applied, thanks.
prev parent reply other threads:[~2026-07-10 14:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-07 14:01 [PATCH] net/nfp: fix UB in BAR size shift operations Alexey Simakov
2026-07-10 14:38 ` 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=i8TrHM9iTYmeFC_7-DKzYQ@monjalon.net \
--to=thomas@monjalon.net \
--cc=alejandro.lucero@netronome.com \
--cc=bigalex934@gmail.com \
--cc=chaoyong.he@corigine.com \
--cc=dev@dpdk.org \
--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