public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Mike Marciniszyn <mike.marciniszyn@intel.com>,
	Dennis Dalessandro <dennis.dalessandro@intel.com>,
	Doug Ledford <dledford@redhat.com>,
	Sean Hefty <sean.hefty@intel.com>,
	Hal Rosenstock <hal.rosenstock@gmail.com>,
	Ira Weiny <ira.weiny@intel.com>,
	Jubin John <jubin.john@intel.com>,
	Jianxin Xiong <jianxin.xiong@intel.com>,
	linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] IB/hfi1: use size_t for passing array length
Date: Wed, 15 Feb 2017 07:24:51 +0200	[thread overview]
Message-ID: <20170215052451.GL6989@mtr-leonro.local> (raw)
In-Reply-To: <20170214212358.2730288-1-arnd@arndb.de>

[-- Attachment #1: Type: text/plain, Size: 1002 bytes --]

On Tue, Feb 14, 2017 at 10:23:07PM +0100, Arnd Bergmann wrote:
> gcc-7 produces a mysterious warning about the size argument being potentially out
> of range:
>
> drivers/infiniband/hw/hfi1/verbs.c: In function 'init_cntr_names':
> drivers/infiniband/hw/hfi1/verbs.c:1644:2: error: 'memcpy': specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Werror=stringop-overflow=]
>
> This seems to refer to a the case where an 64-bit size_t gets truncated
> into a negative 'int' and subsequently turned into a high 64-bit number
> again.
>
> The fix is clearly to use size_t here, which matches the type that gets
> used for this value elsewhere.
>
> Fixes: b7481944b06e ("IB/hfi1: Show statistics counters under IB stats interface")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/infiniband/hw/hfi1/verbs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>

Thanks,
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2017-02-15  5:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-14 21:23 [PATCH] IB/hfi1: use size_t for passing array length Arnd Bergmann
2017-02-15  5:24 ` Leon Romanovsky [this message]
     [not found] ` <20170214212358.2730288-1-arnd-r2nGTMty4D4@public.gmane.org>
2017-02-19 13:56   ` Doug Ledford

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=20170215052451.GL6989@mtr-leonro.local \
    --to=leon@kernel.org \
    --cc=arnd@arndb.de \
    --cc=dennis.dalessandro@intel.com \
    --cc=dledford@redhat.com \
    --cc=hal.rosenstock@gmail.com \
    --cc=ira.weiny@intel.com \
    --cc=jianxin.xiong@intel.com \
    --cc=jubin.john@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=mike.marciniszyn@intel.com \
    --cc=sean.hefty@intel.com \
    /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