[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <730297f0-41e8-45f0-52b3-c5657ce2a1ee@redhat.com>
Date: Mon, 6 Jun 2016 19:21:17 -0400
From: Doug Ledford <dledford@...hat.com>
To: Colin King <colin.king@...onical.com>,
Sean Hefty <sean.hefty@...el.com>,
Hal Rosenstock <hal.rosenstock@...il.com>,
Ira Weiny <ira.weiny@...el.com>,
Christoph Lameter <cl@...ux.com>,
Matan Barak <matanb@...lanox.com>,
Jason Gunthorpe <jgunthorpe@...idianresearch.com>,
linux-rdma@...r.kernel.org
Cc: linux-kernel@...r.kernel.org
Subject: Re: [PATCH] IB/core: fix null pointer dereference and memory leak in
error handling
On 6/1/2016 2:06 PM, Colin King wrote:
> From: Colin Ian King <colin.king@...onical.com>
>
> The current error handling in setup_hw_stats has a couple of issues.
> It is possible to generate a null pointer deference on the
> kfree of hsag->attrs[i] because two of the early error exit paths
> jump to the kfree when hsags NULL and not allocated. Fix this by
> moving the kfree on stats and jumping to that, avoiding the hsag
> freeing.
>
> Secondly, there is a memory leak of stats if the hsag allocation
> fails; instead of returning, jump to the kfree on stats.
>
> Signed-off-by: Colin Ian King <colin.king@...onical.com>
Thanks, applied.
Download attachment "signature.asc" of type "application/pgp-signature" (885 bytes)
Powered by blists - more mailing lists