Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: mathieu.desnoyers@efficios.com (Mathieu Desnoyers)
Subject: [ltt-dev] [URGENT] Re: [PATCH UST] UST strncpy assert fix
Date: Thu, 19 Aug 2010 17:19:06 -0400	[thread overview]
Message-ID: <20100819211906.GA24752@Krystal> (raw)
In-Reply-To: <20100817222321.GB4641@Krystal>

* Mathieu Desnoyers (mathieu.desnoyers at efficios.com) wrote:
> fix off by one in strncpy and write asserts(). Shows only when the event
> reserved fits the exact end of buffer.

Ping ? This bug deserves an immediate release, because it triggers the assert
when users reach a certain amount of data.

Thanks,

Mathieu

> 
> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>
> ---
>  libust/buffers.h |    6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> Index: ust/libust/buffers.h
> ===================================================================
> --- ust.orig/libust/buffers.h	2010-08-17 18:14:30.000000000 -0400
> +++ ust/libust/buffers.h	2010-08-17 18:15:25.000000000 -0400
> @@ -522,7 +522,8 @@ static __inline__ int ust_buffers_write(
>  	size_t buf_offset = BUFFER_OFFSET(offset, buf->chan);
>  
>  	assert(buf_offset < buf->chan->subbuf_size*buf->chan->subbuf_cnt);
> -	assert(buf_offset + len < buf->chan->subbuf_size*buf->chan->subbuf_cnt);
> +	assert(buf_offset + len
> +	       <= buf->chan->subbuf_size*buf->chan->subbuf_cnt);
>  
>  	ust_buffers_do_copy(buf->buf_data + buf_offset, src, len);
>  
> @@ -590,7 +591,8 @@ int ust_buffers_strncpy(struct ust_buffe
>  	int terminated;
>  
>  	assert(buf_offset < buf->chan->subbuf_size*buf->chan->subbuf_cnt);
> -	assert(buf_offset + len < buf->chan->subbuf_size*buf->chan->subbuf_cnt);
> +	assert(buf_offset + len
> +	       <= buf->chan->subbuf_size*buf->chan->subbuf_cnt);
>  
>  	copied = ust_buffers_do_strncpy(buf->buf_data + buf_offset,
>  				        src, len, &terminated);
> 
> -- 
> Mathieu Desnoyers
> Operating System Efficiency R&D Consultant
> EfficiOS Inc.
> http://www.efficios.com

-- 
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com




  reply	other threads:[~2010-08-19 21:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-17 22:23 [ltt-dev] " Mathieu Desnoyers
2010-08-19 21:19 ` Mathieu Desnoyers [this message]
2010-08-20  4:03 ` Pierre-Marc Fournier

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=20100819211906.GA24752@Krystal \
    --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