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: <1431378580.2407.528.camel@redhat.com>
Date:	Mon, 11 May 2015 17:09:40 -0400
From:	Doug Ledford <dledford@...hat.com>
To:	Nicholas Mc Guire <hofrat@...dl.org>
Cc:	Hoang-Nam Nguyen <hnguyen@...ibm.com>,
	Christoph Raisch <raisch@...ibm.com>,
	Sean Hefty <sean.hefty@...el.com>,
	Hal Rosenstock <hal.rosenstock@...il.com>,
	Dan Carpenter <dan.carpenter@...cle.com>,
	linux-rdma@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] IB/ehca: use correct destination for memcpy

On Mon, 2015-05-11 at 16:38 +0200, Nicholas Mc Guire wrote:
> Using an element of a struct as the address for the memcpy of the whole
> struct may introduce a buffer overflow and does not help readability either
> simply pass the real thing as first argument to memcpy.
> 
> Reported-by: Dan Carpenter <dan.carpenter@...cle.com>
> Signed-off-by: Nicholas Mc Guire <hofrat@...dl.org>
> ---
> 
> passing the first element of a struct as destination triggers buffer 
> overflows warnings in tools like Smatch. 
> ./drivers/infiniband/hw/ehca/ehca_mcast.c:ehca_attach_mcast.80 WARNING:
> memcpy copying entire struct to first element
> ./drivers/infiniband/hw/ehca/ehca_mcast.c:ehca_detach_mcast.117 WARNING:
> memcpy copying entire struct to first element
> 
> Simply use the structure rather than the first element (which could change)
> which also help readability.
> 
> Patch was only compile tested with ppc64_defconfig (implies
> CONFIG_INFINIBAND_EHCA=m)
> 
> Patch is against 4.1-rc3 (localversion-next is -next-20150511)

Applied, thanks.

-- 
Doug Ledford <dledford@...hat.com>
              GPG KeyID: 0E572FDD


Download attachment "signature.asc" of type "application/pgp-signature" (820 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ