lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aUtLwLfNVGEH6lEI@fedora>
Date: Wed, 24 Dec 2025 10:11:12 +0800
From: Honggang LI <honggangli@....com>
To: Michael Gur <michaelgur@...dia.com>
Cc: jinpu.wang@...os.com, danil.kipnis@...ud.ionos.com, jgg@...pe.ca,
	leon@...nel.org, linux-rdma@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] RDMA/rtrs: client: Fix clt_path::max_pages_per_mr
 calculation

On Tue, Dec 23, 2025 at 04:08:19PM +0200, Michael Gur wrote:
> Subject: Re: [PATCH] RDMA/rtrs: client: Fix clt_path::max_pages_per_mr
>  calculation
> From: Michael Gur <michaelgur@...dia.com>
> Date: Tue, 23 Dec 2025 16:08:19 +0200
> 
> 
> On 12/23/2025 5:43 AM, Honggang LI wrote:
> > If the low two bytes of ib_dev::attrs::max_mr_size are zeros, the `min3`
> > function will set clt_path::max_pages_per_mr to zero.
> 
> Can't see how if the low two bytes of max_mr_size are zero it would cause
> the local variable max_pages_per_mr to zero.
> The more probable cause is that max_mr_size bits in the range
> [mr_page_shift+31:mr_page_shift] are zero. Since that's what's left after
> division and cast to u32.

Yes, you are right. The irdma support max_mr_size is 0x200000000000.
[mr_page_shift+31:mr_page_shift], a.k.a [43,12] are zeros.

> This means you are working on a device supporting more pages_per_mr than can
> fit in a u32.
> 
> > -		min3(clt_path->max_pages_per_mr, (u32)max_pages_per_mr,
> > +		min(min_not_zero(clt_path->max_pages_per_mr, (u32)max_pages_per_mr),
> 
> This still fixes the issue, but for readability, if max_pages_per_mr is
> larger than U32_MAX, I'd set it to be U32_MAX.

I will set it to U32_MAX as you suggested.

thanks


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ