Thread (3 messages) 3 messages, 3 authors, 2025-05-29

Re: [PATCH v2 net] net/mlx4_en: Prevent potential integer overflow calculating Hz

From: patchwork-bot+netdevbpf@kernel.org
Date: 2025-05-29 10:49:54
Also in: kernel-janitors, linux-rdma, lkml

Hello:

This patch was applied to netdev/net.git (main)
by Paolo Abeni [off-list ref]:

On Wed, 28 May 2025 11:11:09 +0300 you wrote:
The "freq" variable is in terms of MHz and "max_val_cycles" is in terms
of Hz.  The fact that "max_val_cycles" is a u64 suggests that support
for high frequency is intended but the "freq_khz * 1000" would overflow
the u32 type if we went above 4GHz.  Use unsigned long long type for the
mutliplication to prevent that.

Fixes: 31c128b66e5b ("net/mlx4_en: Choose time-stamping shift value according to HW frequency")
Signed-off-by: Dan Carpenter <redacted>

[...]
Here is the summary with links:
  - [v2,net] net/mlx4_en: Prevent potential integer overflow calculating Hz
    https://git.kernel.org/netdev/net/c/54d34165b4f7

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help