Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Seebs <seebs@seebs.net>
To: Andre McCurdy <armccurdy@gmail.com>
Cc: OE-core <openembedded-core@lists.openembedded.org>
Subject: Re: pseudo: host user contamination
Date: Mon, 26 Mar 2018 16:07:46 -0500	[thread overview]
Message-ID: <20180326160746.1dce7ae9@seebsdell> (raw)
In-Reply-To: <CAJ86T=X4u0=82wPCdwngRwQL-==trUDVfuH-4FGC-2G6AmfVgg@mail.gmail.com>

On Mon, 26 Mar 2018 13:12:44 -0700
Andre McCurdy <armccurdy@gmail.com> wrote:

> That's based on your assumption that a C wrapper needs to care about
> results in architecture specific registers, which I contend is not a
> correct interpretation of the syscall manpage.

My observation is: If this doesn't matter, why is glibc doing it? It
seems really weird to mention this thing, and bother doing it, if it
*never* matters. So possibly it does matter. Sometimes. When?

I don't feel comfortable assuming I understand the code if it's doing
something like that, I can't see when it would affect anything, and the
code hasn't been removed to improve performance. I'd be a lot more
comfortable disregarding the weird return values and register
specifications if I could look at real-world examples of how that
information is used.

> Did you find any evidence to support your interpretation? e.g. Did you
> find any examples of callers to the libc syscall() API which use
> architecture specific assembler to examine the result of the syscall?

I have seen exactly one use of syscall() in the wild at all, that being
the recent addition to coreutils.

The evidence for my interpretation that you *could* need to know about
arch-specific behavior is the EABI example, which clearly indicates the
*possibility* that code in C has to care about architectural variance
in non-obvious ways. I don't know what ways those might be, and this
call is so rarely used that I'm not sure it would be reasonable to
generalize about it. (I also don't know whether it's still true on
64-bit ARM, and whether it also applies to pointer values or only to
integer values, or...)

> The gnulib code calling syscall(SYS_renameat2, ...) certainly doesn't
> do that - it just checks the C function return value and errno. Since
> there's no architecture specific code to examine the syscall() result,
> do you expect coreutils mv to now incorrectly detect errors on ia64?

No. But I don't know whether *anyone* is using syscall(), other than
this one single example I've seen identified. I also don't know how
widely tested the code in question is, or on what architectures.

Testing on non-x86 architectures has often been sporadic in the open
source community, and I think that's improved, but I don't know how
much. If I'm looking at something that's almost never used, and I don't
have specific information that the existing usage is being fully tested
on "obscure" targets (such as mips, arm, etc), I am going to be at
least a little distrustful.

-s


  reply	other threads:[~2018-03-26 21:07 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
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 [this message]
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=20180326160746.1dce7ae9@seebsdell \
    --to=seebs@seebs.net \
    --cc=armccurdy@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox