From: "Luka Marčetić" <paxcoder@gmail.com>
To: musl@lists.openwall.com
Subject: Re: cluts: strerror_r() test
Date: Thu, 14 Jul 2011 12:41:35 +0200 [thread overview]
Message-ID: <4E1EC7DF.3070202@gmail.com> (raw)
In-Reply-To: <20110714095730.GF27991@openwall.com>
On 07/14/2011 11:57 AM, Solar Designer wrote:
> Luka, Rich -
>
> I've uncommented the test for strerror_r(), which you marked "glibc
> fail", and it passed the test on glibc 2.3.6 for me. What exactly was
> wrong with it (or rather with glibc) in your testing?
>
> Thanks,
>
> Alexander
The test was uncommented yesterday morning, as I found it was my fault
that it crashed, not glibc's. Actually, I think it was -O2 that helped
me realize that, after I had uncommented the function. Here's the
relevant diff:
https://github.com/lmarcetic/cluts/commit/803ebc888ebe6656287034739229baa93376d0fc#tests/buf.c
You can see that strerror_r was passed size-1, although size was not
initialized (or rather, it was initialized by a test before that one).
Strerror_r implementations are free to redirect a passed pointer to
immutable memory if size(buflen) argument is sufficiently large. Of
course, wanting to write to s[size-1] would SIGSEGV in that case. My
assumption was that glibc redirected the pointer even though I gave it
size-1, in which case it's incorrect behavior and it should simply copy
to the provided buffer. Turns out that's not the case, and the fail was
mine.
Luka.
next prev parent reply other threads:[~2011-07-14 10:41 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-05 0:41 Daily reports: Monday Luka Marčetić
2011-07-05 14:24 ` Daily reports: Tuesday Luka Marčetić
2011-07-06 20:28 ` Daily reports: Wednesday Luka Marčetić
2011-07-07 16:18 ` Szabolcs Nagy
2011-07-07 20:27 ` Luka Marčetić
2011-07-07 20:16 ` Daily reports: Thursday Luka Marčetić
2011-07-08 22:41 ` Daily reports: Friday Luka Marčetić
2011-07-09 1:12 ` Daily reports: Friday - cont Luka Marčetić
2011-07-09 1:38 ` Solar Designer
2011-07-09 11:53 ` Daily reports: Friday Solar Designer
2011-07-09 15:30 ` Luka Marčetić
2011-07-09 22:11 ` Luka Marčetić
2011-07-13 19:46 ` Solar Designer
2011-07-10 14:52 ` Daily reports: Friday (threaded setuid testing) Rich Felker
2011-07-11 22:59 ` Daily cluts reports Luka Marčetić
2011-07-14 9:57 ` cluts: strerror_r() test (was: Daily cluts reports) Solar Designer
2011-07-14 10:41 ` Luka Marčetić [this message]
2011-07-14 10:47 ` cluts: strerror_r() test Solar Designer
2011-07-14 17:55 ` Rich Felker
2011-07-14 19:35 ` Luka Marčetić
2011-07-15 0:09 ` Daily cluts reports Luka Marčetić
2011-07-15 22:47 ` Daily cluts reports - numeric, setuid, and mid-term evaluation Luka Marčetić
2011-07-15 23:51 ` Rich Felker
2011-07-17 0:37 ` Daily cluts reports - setuid reiteration Luka Marčetić
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=4E1EC7DF.3070202@gmail.com \
--to=paxcoder@gmail.com \
--cc=musl@lists.openwall.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.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
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).