From: Doug Ledford <dledford@redhat.com>
To: Colin King <colin.king@canonical.com>,
Sean Hefty <sean.hefty@intel.com>,
Hal Rosenstock <hal.rosenstock@gmail.com>,
Ira Weiny <ira.weiny@intel.com>, Christoph Lameter <cl@linux.com>,
Matan Barak <matanb@mellanox.com>,
Jason Gunthorpe <jgunthorpe@obsidianresearch.com>,
linux-rdma@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] IB/core: fix null pointer dereference and memory leak in error handling
Date: Mon, 6 Jun 2016 19:21:17 -0400 [thread overview]
Message-ID: <730297f0-41e8-45f0-52b3-c5657ce2a1ee@redhat.com> (raw)
In-Reply-To: <1464804396-13936-1-git-send-email-colin.king@canonical.com>
[-- Attachment #1.1: Type: text/plain, Size: 666 bytes --]
On 6/1/2016 2:06 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.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@canonical.com>
Thanks, applied.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]
prev parent reply other threads:[~2016-06-06 23:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-01 18:06 Colin King
2016-06-06 23:21 ` Doug Ledford [this message]
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=730297f0-41e8-45f0-52b3-c5657ce2a1ee@redhat.com \
--to=dledford@redhat.com \
--cc=cl@linux.com \
--cc=colin.king@canonical.com \
--cc=hal.rosenstock@gmail.com \
--cc=ira.weiny@intel.com \
--cc=jgunthorpe@obsidianresearch.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=matanb@mellanox.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
all inboxes | Powered by JetHome®