From: "René Scharfe" <l.s.r@web.de>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: "Git List" <git@vger.kernel.org>,
"David Coppa" <dcoppa@openbsd.org>,
"Junio C Hamano" <gitster@pobox.com>,
"SZEDER Gábor" <szeder.dev@gmail.com>
Subject: Re: [PATCH] t4062: stop using repetition in regex
Date: Tue, 8 Aug 2017 17:18:31 +0200 [thread overview]
Message-ID: <1e7ed028-77fe-195a-4acf-6c80d1704463@web.de> (raw)
In-Reply-To: <alpine.DEB.2.21.1.1708081648130.11175@virtualbox>
Am 08.08.2017 um 16:49 schrieb Johannes Schindelin:
> Hi René,
>
> On Tue, 8 Aug 2017, René Scharfe wrote:
>
>> OpenBSD's regex library has a repetition limit (RE_DUP_MAX) of 255.
>> That's the minimum acceptable value according to POSIX. In t4062 we use
>> 4096 repetitions in the test "-G matches", though, causing it to fail.
>>
>> Do the same as the test "-S --pickaxe-regex" in the same file and search
>> for a single zero instead. That still suffices to trigger the buffer
>> overrun in older versions (checked with b7d36ffca02^ and --valgrind on
>> Linux), simplifies the test a bit, and avoids exceeding OpenBSD's limit.
>
> I am afraid not. The 4096 is precisely the page size required to trigger
> the bug on Windows against which this regression test tries to safeguard.
Checked with b7d36ffca02^ on MinGW now as well and found that it
segfaults with the proposed change ten out of ten times.
You get different results? How is that possible? The search string is
NUL-terminated in each case, while the point of the test is that the
file contents isn't, right?
> Maybe simply disable the test on OpenBSD instead? Or guard the {4096}
> behind the MINGW prereq.
It's easy to build a long search string with two repetitions or by using
a longer string as the base, if necessary. But first we need to find out
why regexec() doesn't overflow in your case. My build uses the version
from compat/. Why would it stop before reaching a NUL? That sounds like
a different and serious bug.
Thanks,
René
next prev parent reply other threads:[~2017-08-08 15:19 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-08 6:53 [PATCH] t4062: stop using repetition in regex René Scharfe
2017-08-08 14:49 ` Johannes Schindelin
2017-08-08 15:18 ` René Scharfe [this message]
2017-08-08 22:09 ` Junio C Hamano
2017-08-08 22:26 ` Junio C Hamano
2017-08-08 22:34 ` René Scharfe
2017-08-09 5:29 ` Junio C Hamano
2017-08-09 6:15 ` René Scharfe
2017-08-09 14:15 ` René Scharfe
2017-08-09 14:25 ` David Coppa
2017-08-09 21:49 ` Johannes Schindelin
2017-08-09 16:07 ` Junio C Hamano
2017-08-09 17:20 ` René Scharfe
2017-08-09 17:47 ` Junio C Hamano
2017-08-10 6:08 ` René Scharfe
2017-08-11 18:20 ` Junio C Hamano
2017-08-08 22:27 ` René Scharfe
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=1e7ed028-77fe-195a-4acf-6c80d1704463@web.de \
--to=l.s.r@web.de \
--cc=Johannes.Schindelin@gmx.de \
--cc=dcoppa@openbsd.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=szeder.dev@gmail.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;
as well as URLs for NNTP newsgroup(s).