Thread (4 messages) flat view 4 messages, 3 authors, 2021-03-01

Re: [PATCH mellanox-tree] net/mlx5: prevent an integer underflow in mlx5_perout_configure()

From: Leon Romanovsky <leon@kernel.org>
Date: 2021-02-21 06:12:40
Also in: kernel-janitors, linux-rdma

On Fri, Feb 19, 2021 at 12:57:52PM +0300, Dan Carpenter wrote:
The value of "sec" comes from the user.  Negative values will lead to
shift wrapping inside the perout_conf_real_time() function and triggger
a UBSan warning.

Add a check and return -EINVAL to prevent that from happening.

Fixes: 432119de33d9 ("net/mlx5: Add cyc2time HW translation mode support")
Signed-off-by: Dan Carpenter <redacted>
---
Saeed, I think this goes through your git tree and you will send a pull
request to the networking?

From static analysis.  Not tested.

 drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Thanks,
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help