public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: "Gustavo A. R. Silva" <garsilva@embeddedor.com>
Cc: Andreas Noever <andreas.noever@gmail.com>,
	Michael Jamet <michael.jamet@intel.com>,
	Yehezkel Bernat <yehezkel.bernat@intel.com>,
	linux-kernel@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH] thunderbolt: tb: fix use after free in tb_activate_pcie_devices
Date: Mon, 6 Nov 2017 11:18:55 +0200	[thread overview]
Message-ID: <20171106091855.GQ2283@lahna.fi.intel.com> (raw)
In-Reply-To: <20171105045254.GA13399@embeddedor.com>

On Sat, Nov 04, 2017 at 11:52:54PM -0500, Gustavo A. R. Silva wrote:
> Add a ̣̣continue statement in order to avoid using a previously
> free'd pointer tunnel in list_add.
> 
> Addresses-Coverity-ID: 1415336
> Fixes: 9d3cce0b6136 ("thunderbolt: Introduce thunderbolt bus and connection manager")
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>

Good catch!

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>

Greg, can you pick this to your char-misc tree? Thanks.

> ---
>  drivers/thunderbolt/tb.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/thunderbolt/tb.c b/drivers/thunderbolt/tb.c
> index d674e06..1424581 100644
> --- a/drivers/thunderbolt/tb.c
> +++ b/drivers/thunderbolt/tb.c
> @@ -225,6 +225,7 @@ static void tb_activate_pcie_devices(struct tb *tb)
>  			tb_port_info(up_port,
>  				     "PCIe tunnel activation failed, aborting\n");
>  			tb_pci_free(tunnel);
> +			continue;
>  		}
>  
>  		list_add(&tunnel->list, &tcm->tunnel_list);
> -- 
> 2.7.4

  reply	other threads:[~2017-11-06  9:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-05  4:52 [PATCH] thunderbolt: tb: fix use after free in tb_activate_pcie_devices Gustavo A. R. Silva
2017-11-06  9:18 ` Mika Westerberg [this message]
2017-11-06 13:16   ` Gustavo A. R. Silva

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=20171106091855.GQ2283@lahna.fi.intel.com \
    --to=mika.westerberg@linux.intel.com \
    --cc=andreas.noever@gmail.com \
    --cc=garsilva@embeddedor.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.jamet@intel.com \
    --cc=yehezkel.bernat@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