Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: mathieu.desnoyers@efficios.com (Mathieu Desnoyers)
Subject: [lttng-dev] [PATCH babeltrace] Fix ctf-writer: possible use after	free
Date: Sun, 1 Dec 2013 02:00:10 +0000 (UTC)	[thread overview]
Message-ID: <906518736.78116.1385863210708.JavaMail.zimbra@efficios.com> (raw)
In-Reply-To: <1385749602-13426-1-git-send-email-jeremie.galarneau@efficios.com>

Merged, thanks!

Mathieu

----- Original Message -----
> From: "J?r?mie Galarneau" <jeremie.galarneau@efficios.com>
> To: lttng-dev at lists.lttng.org
> Sent: Friday, November 29, 2013 7:26:42 PM
> Subject: [lttng-dev] [PATCH babeltrace] Fix ctf-writer: possible use after	free
> 
> ctf_stream_pos' base_mma member must be copied from stream->pos before
> updating the final packet and content sizes. The original base_mma
> structure will be reallocated if the packet is resized.
> 
> Signed-off-by: J?r?mie Galarneau <jeremie.galarneau at efficios.com>
> ---
>  formats/ctf/writer/stream.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/formats/ctf/writer/stream.c b/formats/ctf/writer/stream.c
> index ac89429..4efb369 100644
> --- a/formats/ctf/writer/stream.c
> +++ b/formats/ctf/writer/stream.c
> @@ -464,7 +464,10 @@ int bt_ctf_stream_flush(struct bt_ctf_stream *stream)
>  	/*
>  	 * Update the packet total size and content size and overwrite the
>  	 * packet context.
> +	 * Copy base_mma as the packet may have been remapped (e.g. when a
> +	 * packet is resized).
>  	 */
> +	packet_context_pos.base_mma = stream->pos.base_mma;
>  	ret = set_structure_field_integer(stream_class->packet_context,
>  		"content_size", stream->pos.offset);
>  	if (ret) {
> --
> 1.8.4.2
> 
> 
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
> 

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com



      reply	other threads:[~2013-12-01  2:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-29 18:26 Jérémie Galarneau
2013-12-01  2:00 ` Mathieu Desnoyers [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=906518736.78116.1385863210708.JavaMail.zimbra@efficios.com \
    --to=mathieu.desnoyers@efficios.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