Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1415574

Re: [PATCH] IB/core: fix null pointer dereference and memory leak in error handling

From Doug Ledford <dledford@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH] IB/core: fix null pointer dereference and memory leak in error handling
Date 2016-06-07 01:30 +0200
Message-ID <rHc81-36i-13@gated-at.bofh.it> (permalink)
References <rFiKB-3t1-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

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.


Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] IB/core: fix null pointer dereference and memory leak in error handling Colin King <colin.king@canonical.com> - 2016-06-01 20:10 +0200
  Re: [PATCH] IB/core: fix null pointer dereference and memory leak in  error handling Doug Ledford <dledford@redhat.com> - 2016-06-07 01:30 +0200

csiph-web