mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Solar Designer <solar@openwall.com>
To: musl@lists.openwall.com
Subject: Re: cluts review
Date: Wed, 13 Jul 2011 18:12:49 +0400	[thread overview]
Message-ID: <20110713141249.GA23314@openwall.com> (raw)
In-Reply-To: <20110713133838.GA16618@brightrain.aerifal.cx>

Rich,

Thank you for your comments.  Would you please start similarly reviewing
and commenting on Luka's code in here without me having to do it? ;-)

On Wed, Jul 13, 2011 at 09:38:38AM -0400, Rich Felker wrote:
> On Wed, Jul 13, 2011 at 03:07:23PM +0400, Solar Designer wrote:
> > The uses of SA_NODEFER appeared to be a bug anyway, so I am simply
> > removing them.
> 
> It's not a bug.

I meant that I saw no valid reason in the surrounding code to set that
flag.  But you appear to mention that there was a reason in one of the
instances.  Maybe there was.

> > +#define _BSD_SOURCE /* for scandir() and alphasort() */
> 
> These are POSIX 2008 functions. _BSD_SOURCE should not be needed for
> anything.

Is it acceptable to require POSIX 2008?  Don't we want cluts to build
and run on significantly older systems, which wouldn't know to define
these functions on -D_POSIX_C_SOURCE=200809L?

> > +#include <sys/param.h> /* for PATH_MAX */
> 
> This is a classic error I fought with all the time early in musl's
> life cycle - it's absolutely the wrong fix. sys/param.h is completely
> nonstandard. PATH_MAX comes from limits.h, as long as you have the
> proper feature test macros defined, but it might not be defined, in
> which case you have to use sysconf/pathconf. That could still come
> back as "no limit" though, in which case security for functions which
> need a PATH_MAX-sized buffer is broken...

What specific feature test macros would you recommend for getting
PATH_MAX defined?

> > +#define _XOPEN_SOURCE /* for sigaction() */
> 
> Needs a value, not a blank definition. Current version is 700.

My understanding is that blank means requesting an older version of the
spec, but I admit I am not sure which one - and as I pointed out in
another posting a while ago, it does appear to differ across systems.

So, your proposal is to always request the latest spec version.
Wouldn't it possibly be better to request the oldest sufficient for us?

> > -    act.sa_flags   = SA_NODEFER;
> > +    act.sa_flags   = 0;
> 
> This was being used as part of the longjmp trick.

Why, how?  Did we seriously want to keep the signal blocked?

> By the way, there are a lot of warnings about local vars potentially
> clobbered by longjmp. Those are worth checking out.

Right.

Thanks,

Alexander


  reply	other threads:[~2011-07-13 14:12 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-13 11:07 Solar Designer
2011-07-13 12:02 ` Luka Marčetić
2011-07-13 12:21   ` Solar Designer
2011-07-13 12:57     ` Luka Marčetić
2011-07-13 13:42       ` Rich Felker
2011-07-13 14:21         ` Solar Designer
2011-07-13 13:54       ` Solar Designer
2011-07-13 14:00         ` Rich Felker
2011-07-13 14:31           ` Solar Designer
2011-07-13 14:03     ` Rich Felker
2011-07-13 14:37       ` Solar Designer
2011-07-13 16:03   ` Solar Designer
2011-07-13 16:55     ` Luka Marčetić
2011-07-13 17:05       ` Solar Designer
2011-07-13 17:25         ` Luka Marčetić
2011-07-13 17:52           ` Solar Designer
2011-07-13 19:29             ` Luka Marčetić
2011-07-13 19:55               ` Rich Felker
2011-07-13 20:39               ` Solar Designer
2011-07-13 21:44                 ` Solar Designer
2011-07-13 19:52             ` Rich Felker
2011-07-13 20:03       ` Rich Felker
2011-07-14 18:56       ` Rich Felker
2011-07-13 13:38 ` Rich Felker
2011-07-13 14:12   ` Solar Designer [this message]
2011-07-13 14:26     ` Rich Felker
2011-07-13 14:46       ` Solar Designer
2011-07-13 16:25   ` Luka Marčetić
2011-07-13 17:03     ` Solar Designer

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=20110713141249.GA23314@openwall.com \
    --to=solar@openwall.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).