[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8859c11b-6c6b-3780-c13a-2ae0affd7033@deltatee.com>
Date: Tue, 5 Dec 2017 10:01:22 -0700
From: Logan Gunthorpe <logang@...tatee.com>
To: Jon Mason <jdmason@...zu.us>, Serge Semin <fancer.lancer@...il.com>
Cc: Dave Jiang <dave.jiang@...el.com>,
"Hubbe, Allen" <Allen.Hubbe@....com>,
"S-k, Shyam-sundar" <Shyam-sundar.S-k@....com>,
"Yu, Xiangliang" <Xiangliang.Yu@....com>,
Gary R Hook <gary.hook@....com>, Sergey.Semin@...latforms.ru,
linux-ntb <linux-ntb@...glegroups.com>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 03/15] NTB: Fix UB/bug in ntb_mw_get_align()
On 05/12/17 09:52 AM, Jon Mason wrote:
> On Sun, Dec 3, 2017 at 2:17 PM, Serge Semin <fancer.lancer@...il.com> wrote:
>> Simple (1 << pidx) operation causes undefined behaviour when
>> pidx >= 32. It must be casted to u64 to match the actual return
>> value of ntb_link_is_up() method, so to have all the possible
>> peer indexes covered and to get rid of undefined behaviour.
>> Additionally there are special macros in "linux/bitops.h" to perform
>> the bit-set-shift operations, so it's recommended to have them used
>> for proper bit setting.
>
> This looks good to me, but also seems like a bug fix. Please comment
> on if this is not noticed.
It would be a bug on any system that has more than 32 partitions which
is run on a 32 bit machine (or 64 partitions on a 64bit machine). Such a
system is theoretical for the foreseeable future. But it would be good
to fix it now.
Logan
Powered by blists - more mailing lists