Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753146AbdLERI2 (ORCPT ); Tue, 5 Dec 2017 12:08:28 -0500 Received: from mail-ua0-f182.google.com ([209.85.217.182]:39663 "EHLO mail-ua0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752212AbdLERIZ (ORCPT ); Tue, 5 Dec 2017 12:08:25 -0500 X-Google-Smtp-Source: AGs4zMZvClmGGwfU8cwk3ABTaiXXRRq/LfgwqipI99XcK/gqG63tRsyl9QmwXTSjaFpE0ETaEFkhFFEybVACrm1PTeI= MIME-Version: 1.0 In-Reply-To: <8859c11b-6c6b-3780-c13a-2ae0affd7033@deltatee.com> References: <20171203191736.3399-1-fancer.lancer@gmail.com> <20171203191736.3399-4-fancer.lancer@gmail.com> <8859c11b-6c6b-3780-c13a-2ae0affd7033@deltatee.com> From: Jon Mason Date: Tue, 5 Dec 2017 12:08:23 -0500 Message-ID: Subject: Re: [PATCH v2 03/15] NTB: Fix UB/bug in ntb_mw_get_align() To: Logan Gunthorpe Cc: Serge Semin , Dave Jiang , "Hubbe, Allen" , "S-k, Shyam-sundar" , "Yu, Xiangliang" , Gary R Hook , Sergey.Semin@t-platforms.ru, linux-ntb , linux-kernel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1555 Lines: 40 On Tue, Dec 5, 2017 at 12:01 PM, Logan Gunthorpe wrote: > > > On 05/12/17 09:52 AM, Jon Mason wrote: >> >> On Sun, Dec 3, 2017 at 2:17 PM, Serge Semin >> 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. Seems like a non-issue then. Disregard. > > Logan > > -- > You received this message because you are subscribed to the Google Groups > "linux-ntb" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to linux-ntb+unsubscribe@googlegroups.com. > To post to this group, send email to linux-ntb@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/linux-ntb/8859c11b-6c6b-3780-c13a-2ae0affd7033%40deltatee.com. > For more options, visit https://groups.google.com/d/optout.