mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: [PATCH] Wasm support patch 2 (static syscalls)
Date: Tue, 28 Nov 2017 10:50:14 -0500	[thread overview]
Message-ID: <20171128155014.GA1627@brightrain.aerifal.cx> (raw)
In-Reply-To: <20171128150806.GO15263@port70.net>

On Tue, Nov 28, 2017 at 04:08:06PM +0100, Szabolcs Nagy wrote:
> * Nicholas Wilson <nicholas.wilson@realvnc.com> [2017-11-28 14:53:58 +0000]:
> > I think LTO would be required - but I might be missing something
> > in your scheme? I'm considering the cases like __setxid and
> > pthread_cancel, where the compiler can't work out which syscall
> > numbers are possible (because the numbers come from another
> > translation unit). In these cases, there's no way to eliminate any
> > of the branches in your switch statement.
> > 
> > In particular, getuid() is such a common library call that I think
> > we do want to be able to support it on Wasm, without having Musl
> > link in everything. I mean, it's not an obscure piece of
> > functionality, so it's worth a small refactor to make it usable
> > with Wasm.
> 
> getuid is not affected, only __setxid and cancellable syscalls are.
> 
> __setxid is not that important and can be worked around in generic code,
> but i don't see an easy solution for syscall_cp except that wasm
> probably don't need cancellation at all so it can be just defined
> to syscall.

I don't think calling __setxid even makes sense in wasm code. Do you
actually have a multiuser model with a privileged user who can change
uid to other users?

Cancellation is actually hard to do via an approach like this, since
you need some mechanism for determining the point at which the syscall
has atomically succeeded versus being blocked with no side effects
yet. Implementing it would probably require doing something similar to
what midipix does, but for now it can probably just be omitted.

Rich


  reply	other threads:[~2017-11-28 15:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-28 12:31 Nicholas Wilson
2017-11-28 12:59 ` Szabolcs Nagy
2017-11-28 13:23   ` Nicholas Wilson
2017-11-28 14:05     ` Szabolcs Nagy
2017-11-28 14:34       ` Nicholas Wilson
2017-11-28 14:35         ` Szabolcs Nagy
2017-11-28 14:53           ` Nicholas Wilson
2017-11-28 15:08             ` Szabolcs Nagy
2017-11-28 15:50               ` Rich Felker [this message]
2017-11-28 16:20                 ` Nicholas Wilson
2017-11-28 16:51         ` John Starks
2017-11-28 17:52           ` Szabolcs Nagy
2017-11-28 18:55             ` Rich Felker
2017-11-28 17:53           ` Nicholas Wilson

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=20171128155014.GA1627@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --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).