mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: jgg@ziepe.ca, Qasim Ijaz <qasdev00@gmail.com>
Cc: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org,
	 stable@vger.kernel.org
Subject: Re: [PATCH] RDMA/mlx5: Prevent UB from shifting negative signed value
Date: Thu, 06 Mar 2025 03:23:03 -0500	[thread overview]
Message-ID: <174124938333.256459.13549544178260242325.b4-ty@kernel.org> (raw)
In-Reply-To: <20250304140246.205919-1-qasdev00@gmail.com>


On Tue, 04 Mar 2025 14:02:46 +0000, Qasim Ijaz wrote:
> In function create_ib_ah() the following line attempts
> to left shift the return value of mlx5r_ib_rate() by 4
> and store it in the stat_rate_sl member of av:
> 
> 		ah->av.stat_rate_sl = (mlx5r_ib_rate(dev, rdma_ah_get_static_rate(ah_attr)) << 4);
> 
> However the code overlooks the fact that mlx5r_ib_rate()
> may return -EINVAL if the rate passed to it is less than
> IB_RATE_2_5_GBPS or greater than IB_RATE_800_GBPS.
> 
> [...]

Applied, thanks!

[1/1] RDMA/mlx5: Prevent UB from shifting negative signed value
      https://git.kernel.org/rdma/rdma/c/556f93b90c1872

Best regards,
-- 
Leon Romanovsky <leon@kernel.org>


      parent reply	other threads:[~2025-03-06  8:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-04 14:02 Qasim Ijaz
2025-03-04 15:57 ` Patrisious Haddad
2025-03-06  8:23 ` Leon Romanovsky [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=174124938333.256459.13549544178260242325.b4-ty@kernel.org \
    --to=leon@kernel.org \
    --cc=jgg@ziepe.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=qasdev00@gmail.com \
    --cc=stable@vger.kernel.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

all inboxes | Powered by JetHome®