* [PATCH] net: liquidio: fix overflow in octeon_init_instr_queue()
@ 2025-09-17 15:30 Alexey Nepomnyashih
2025-09-18 14:32 ` Jakub Kicinski
2025-09-18 15:00 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Alexey Nepomnyashih @ 2025-09-17 15:30 UTC (permalink / raw)
To: Andrew Lunn
Cc: Alexey Nepomnyashih, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, netdev, linux-kernel, lvc-project,
stable
The expression `(conf->instr_type == 64) << iq_no` can overflow because
`iq_no` may be as high as 64 (`CN23XX_MAX_RINGS_PER_PF`). Casting the
operand to `u64` ensures correct 64-bit arithmetic.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Cc: stable@vger.kernel.org # v4.2+
Fixes: f21fb3ed364b ("Add support of Cavium Liquidio ethernet adapters")
Signed-off-by: Alexey Nepomnyashih <sdl@nppct.ru>
---
drivers/net/ethernet/cavium/liquidio/request_manager.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/cavium/liquidio/request_manager.c b/drivers/net/ethernet/cavium/liquidio/request_manager.c
index de8a6ce86ad7..12105ffb5dac 100644
--- a/drivers/net/ethernet/cavium/liquidio/request_manager.c
+++ b/drivers/net/ethernet/cavium/liquidio/request_manager.c
@@ -126,7 +126,7 @@ int octeon_init_instr_queue(struct octeon_device *oct,
oct->io_qmask.iq |= BIT_ULL(iq_no);
/* Set the 32B/64B mode for each input queue */
- oct->io_qmask.iq64B |= ((conf->instr_type == 64) << iq_no);
+ oct->io_qmask.iq64B |= ((u64)(conf->instr_type == 64) << iq_no);
iq->iqcmd_64B = (conf->instr_type == 64);
oct->fn_list.setup_iq_regs(oct, iq_no);
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] net: liquidio: fix overflow in octeon_init_instr_queue()
2025-09-17 15:30 [PATCH] net: liquidio: fix overflow in octeon_init_instr_queue() Alexey Nepomnyashih
@ 2025-09-18 14:32 ` Jakub Kicinski
2025-09-18 15:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Jakub Kicinski @ 2025-09-18 14:32 UTC (permalink / raw)
To: Alexey Nepomnyashih
Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Paolo Abeni, netdev,
linux-kernel, lvc-project, stable
On Wed, 17 Sep 2025 15:30:58 +0000 Alexey Nepomnyashih wrote:
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
No ads in the commit messages, please. Put the company / project in
the From line in the future. Quoting documentation:
From Line
^^^^^^^^^
The ``from`` line must be the very first line in the message body,
and has the form:
From: Patch Author <author@example.com>
The ``from`` line specifies who will be credited as the author of the
patch in the permanent changelog. If the ``from`` line is missing,
then the ``From:`` line from the email header will be used to determine
the patch author in the changelog.
The author may indicate their affiliation or the sponsor of the work
by adding the name of an organization to the ``from`` and ``SoB`` lines,
e.g.:
From: Patch Author (Company) <author@example.com>
See: https://www.kernel.org/doc/html/next/process/submitting-patches.html#the-canonical-patch-format
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] net: liquidio: fix overflow in octeon_init_instr_queue()
2025-09-17 15:30 [PATCH] net: liquidio: fix overflow in octeon_init_instr_queue() Alexey Nepomnyashih
2025-09-18 14:32 ` Jakub Kicinski
@ 2025-09-18 15:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-09-18 15:00 UTC (permalink / raw)
To: Alexey Nepomnyashih
Cc: andrew+netdev, davem, edumazet, kuba, pabeni, netdev,
linux-kernel, lvc-project, stable
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Wed, 17 Sep 2025 15:30:58 +0000 you wrote:
> The expression `(conf->instr_type == 64) << iq_no` can overflow because
> `iq_no` may be as high as 64 (`CN23XX_MAX_RINGS_PER_PF`). Casting the
> operand to `u64` ensures correct 64-bit arithmetic.
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
>
> Cc: stable@vger.kernel.org # v4.2+
> Fixes: f21fb3ed364b ("Add support of Cavium Liquidio ethernet adapters")
> Signed-off-by: Alexey Nepomnyashih <sdl@nppct.ru>
>
> [...]
Here is the summary with links:
- net: liquidio: fix overflow in octeon_init_instr_queue()
https://git.kernel.org/netdev/net/c/cca7b1cfd7b8
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-09-18 15:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-17 15:30 [PATCH] net: liquidio: fix overflow in octeon_init_instr_queue() Alexey Nepomnyashih
2025-09-18 14:32 ` Jakub Kicinski
2025-09-18 15:00 ` patchwork-bot+netdevbpf
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).