All of lore.kernel.org
 help / color / mirror / Atom feed
From: Seebs <seebs@seebs.net>
To: "Burton, Ross" <ross.burton@intel.com>
Cc: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>,
	OE-core <openembedded-core@lists.openembedded.org>
Subject: Re: pseudo: host user contamination
Date: Sat, 24 Mar 2018 12:23:57 -0500	[thread overview]
Message-ID: <20180324122357.668e6afc@seebsdell> (raw)
In-Reply-To: <CAJTo0LbahOFYjBjonmfn5on78fFinG1Vk7R4kKtKX2mpmriEMA@mail.gmail.com>

On Sat, 24 Mar 2018 17:10:47 +0000
"Burton, Ross" <ross.burton@intel.com> wrote:

> On 24 March 2018 at 12:36, Richard Purdie
> <richard.purdie@linuxfoundation.org> wrote:
> > I think, at least in principle, pseudo could wrap that and intercept
> > this particular syscall, check syscall_number (the numbering having
> > its own set of issues) and then only handle the specific problem
> > case we have.
> 
> And to make things easier I think we could even just ENOTSUPP
> renameat2 in the short term (i.e. for 2.5), before looking at a more
> comprehensive intercepting
> which could solve the Go issue.

In the Go case, we would basically have to do something more like
debugger traps. They're not using libc *at all*, and unless something's
built with cgo or requires C-type libraries, it's not even going to be
dynamically linked. No dynamic linker => LD_PRELOAD is irrelevant.

> I filed a bug with coreutils yesterday.  "Just intercept syscall()"
> they said.

If they can describe a mechanism for intercepting syscall that they can
guarantee will work across all Linux architectures including possible
future architectures not yet in use, I'd love to know what it is.

See syscall(2) for some examples of the kinds of things that could be
concerns, such as the EABI calling convention. We can sort of hope for
the best if we just treat everything as a chain of unsigned longs, but
that's really *not* safe, and it should not be expected to work
reliably across architectures.

Honestly, reading it more closely, I don't think we can actually
produce behavior that precisely mimics the behavior of syscall() for
generic cases on architectures we currently run on. There's magic like
setting values in other registers, clobbering registers, and so on,
because *this function does not obey general architecture calling
conventions*. And if the wrapper does, the wrapper will break at least
some of the expected behaviors, by not behaving the same way.

Basically: I don't think we can promise that we will correctly pass
through both parameters to syscall() and returns from it in on existing
architectures we're actually running on today, for the whole set of
possible syscalls. So if we intercept syscall(), at least some
previously-valid programs break.

-s


  reply	other threads:[~2018-03-24 17:23 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-23 15:33 pseudo: host user contamination Enrico Scholz
2018-03-23 15:43 ` Enrico Scholz
2018-03-23 16:05   ` Burton, Ross
2018-03-23 16:10     ` Enrico Scholz
2018-03-23 16:17       ` Burton, Ross
2018-03-23 16:28       ` Seebs
2018-03-23 16:30         ` Burton, Ross
2018-03-23 16:49           ` Seebs
2018-03-23 16:56             ` Burton, Ross
2018-03-23 17:23               ` Seebs
2018-03-23 23:47             ` Richard Purdie
2018-03-23 23:56               ` Seebs
2018-03-24  0:22                 ` Enrico Scholz
2018-03-24  0:33                 ` Andre McCurdy
2018-03-24  0:36                   ` Seebs
2018-03-24  1:10                     ` Andre McCurdy
2018-03-24  1:17                       ` Seebs
2018-03-24  1:43                         ` Andre McCurdy
2018-03-24  2:44                           ` Seebs
2018-03-24 12:36                 ` Richard Purdie
2018-03-24 15:12                   ` Seebs
2018-03-24 17:10                   ` Burton, Ross
2018-03-24 17:23                     ` Seebs [this message]
2018-03-24 18:12                       ` Andre McCurdy
2018-03-24 18:22                         ` Seebs
2018-03-24 18:59                           ` Andre McCurdy
2018-03-24 19:24                             ` Seebs
2018-03-24 19:42                               ` Andre McCurdy
2018-03-24 19:50                                 ` Seebs
2018-03-24 20:12                                   ` Victor Kamensky
2018-03-24 23:04                                     ` Burton, Ross
2018-03-25  0:09                                       ` Victor Kamensky
2018-03-25  2:43                                         ` Andre McCurdy
2018-03-25  5:37                                           ` Victor Kamensky
2018-03-25  7:05                                             ` Andre McCurdy
2018-03-26 18:49                                               ` Andreas Müller
2018-03-26 19:31                                                 ` Seebs
2018-03-26 20:12                                                   ` Andre McCurdy
2018-03-26 21:07                                                     ` Seebs
2018-03-27  1:10                                                       ` Andre McCurdy
2018-03-27  1:32                                                         ` Seebs
2018-03-27  1:34                                                           ` Andre McCurdy
2018-03-27  2:07                                                             ` Seebs
2018-03-27  2:59                                                               ` Andre McCurdy
2018-03-27  4:41                                                                 ` Seebs
2018-03-27 19:11                                                                   ` Andre McCurdy
2018-03-27 19:22                                                                     ` Seebs
2018-03-27 20:12                                                                       ` Andre McCurdy
2018-03-27 20:20                                                                         ` Seebs
2018-03-27 20:52                                                                           ` Andre McCurdy
2018-03-27 21:10                                                                             ` Seebs
2018-03-29 12:04                                                                               ` Enrico Scholz
2018-03-29 14:06                                                                                 ` Seebs
2018-03-27 13:06                                                     ` Enrico Scholz
2018-03-27 15:50                                                       ` Seebs
2018-03-27 16:26                                                         ` Enrico Scholz
2018-03-27 16:46                                                           ` Seebs
2018-03-24 20:22                                   ` Joshua Watt
2018-03-24 21:01                                     ` Seebs
2018-03-24 20:27                                   ` Andre McCurdy
2018-03-27 14:42         ` Enrico Scholz
2018-03-27 15:55           ` Seebs
2018-03-27 16:35             ` Enrico Scholz
2018-03-27 16:40               ` Seebs
2018-03-27 19:20                 ` Enrico Scholz
2018-03-27 19:24                   ` Seebs
2018-03-27 20:06                     ` Enrico Scholz
2018-03-23 16:06 ` Burton, Ross

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=20180324122357.668e6afc@seebsdell \
    --to=seebs@seebs.net \
    --cc=enrico.scholz@sigma-chemnitz.de \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=ross.burton@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.