mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@aerifal.cx>
To: musl@lists.openwall.com
Subject: Re: Daily cluts reports - numeric, setuid, and mid-term evaluation
Date: Fri, 15 Jul 2011 19:51:11 -0400	[thread overview]
Message-ID: <20110715235111.GR16618@brightrain.aerifal.cx> (raw)
In-Reply-To: <4E20C39C.7060502@gmail.com>

On Sat, Jul 16, 2011 at 12:47:56AM +0200, Luka Marčetić wrote:
>     * Fixing setuid.c, which should do its job of testing
> setuid/getuid in a threaded environment now - those who are
> following are probably interested in the results: The test indeed
> reports failure on certain libc's, but before I can say with
> confidence that the test is correct, I'm going to need a second pair
> of eyes, so if you're willing to review it please do fetch the file.
> More about this in #musl.

I'm glad you were able to get results! In the current form, the test
isn't checking exactly what it's supposed to, but it's very close.
What you're testing is for mismatch in the getuid() results for the
first- and last-created threads. There are a couple problems with this
but they're easily fixed:

Issue 1: The first- and last-created threads are not necessarily the
first and last threads to make the syscall. By checking that *all*
threads have the same result, rather than just the first and last, you
could find failures with a lot fewer tries.

Issue 2: While I believe it's "A Bad Thing" and non-conformant for
getuid() to ever return different results in different threads, the
*dangerous* case is when setuid() reported success but didn't actually
succeed in all threads. I would ignore the result (or only print a
warning, and continue searching for a more serious failure) when
setuid() returns -1. I sloppily made this change and no longer saw any
failures in musl, though it seems like it might be deadlocking
sometime... Haven't tested the change with glibc but I expect to still
see failures.

Rich


  reply	other threads:[~2011-07-15 23:51 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                 ` cluts: strerror_r() test Luka Marčetić
2011-07-14 10:47                   ` 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 [this message]
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=20110715235111.GR16618@brightrain.aerifal.cx \
    --to=dalias@aerifal.cx \
    --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).