All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Carlos Martín Nieto" <cmn@elego.de>
Cc: git@vger.kernel.org, Jeff King <peff@peff.net>
Subject: Re: [PATCH] valgrind: ignore SSE-based strlen invalid reads
Date: Wed, 16 Mar 2011 13:18:04 -0700	[thread overview]
Message-ID: <7vr5a67rb7.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <1300275961-5798-1-git-send-email-cmn@elego.de> ("Carlos Martín Nieto"'s message of "Wed, 16 Mar 2011 12:46:01 +0100")

Carlos Martín Nieto <cmn@elego.de> writes:

> Some versions of strlen use SSE to speed up the calculation and load 4
> bytes at a time, even if it means reading past the end of the
> allocated memory. This read is safe and when the strlen function is
> inlined, it is not replaced by valgrind, which reports a
> false-possitive.
>
> Tell valgrind to ignore this particular error, as the read is, in
> fact, safe. Current upstream-released version 2.6.1 is affected. Some
> distributions have this fixed in their latest versions.
>
> Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
> ---
>
>>>  I think 3.6.1 doesn't need it, as Debian's 1:3.5.0+3.6.0svn20100609-1
>>> version is reportedly fixed.
>>
>>Ah, nice.  A phrase like "some versions of valgrind before 3.6.1"
>>would be fine with me fwiw. :)
>
> I just downloaded and compiled the upstream release 2.6.1 and it's
> still affected (it does fix some other related
> false-positives). Fedorea rawhide has the fix in, according to their
> bug tracker. I haven't tested the reportedly-fixed version in Debian
> yet.

I take it that you meant 3.6.1 in both places above?

This somehow reminds me of my past life where I saw a buggy implementation
of strlen() in the C library loaded one word too many from memory, and
segfaulted even when the string ended before the end of a mapped page when
the next page was unmapped.

Anyway, nice digging.

  reply	other threads:[~2011-03-16 20:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-16  9:31 [PATCH] valgrind: ignore SSE-based strlen invalid reads Carlos Martín Nieto
2011-03-16  9:56 ` Jonathan Nieder
2011-03-16 10:41   ` Carlos Martín Nieto
2011-03-16 10:47   ` Carlos Martín Nieto
2011-03-16 10:52     ` Jonathan Nieder
2011-03-16 11:10       ` Carlos Martín Nieto
2011-03-16 11:25         ` Jonathan Nieder
2011-03-16 11:46           ` Carlos Martín Nieto
2011-03-16 20:18             ` Junio C Hamano [this message]
2011-03-16 20:44               ` Carlos Martín Nieto
2011-03-16 22:43         ` Andreas Schwab

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=7vr5a67rb7.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=cmn@elego.de \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.