all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Danny Milosavljevic <dannym@scratchpost.org>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 43513@debbugs.gnu.org
Subject: bug#43513: json-c build failure (on armhf-linux) while trying to build u-boot
Date: Fri, 25 Sep 2020 18:23:26 +0200	[thread overview]
Message-ID: <20200925182326.402aa6f2@scratchpost.org> (raw)
In-Reply-To: <87wo0hj13l.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1839 bytes --]

Hi Ludo,

On Fri, 25 Sep 2020 18:02:54 +0200
Ludovic Courtès <ludo@gnu.org> wrote:

> What are the odds of a build succeeding in the presence of broken
> getdents/readdir?  Wouldn’t such builds simply fail (as in the CMake
> case), as opposed to succeeding but somehow producing invalid binaries?

I don't know what hashing mechanism ext4 uses, but I guess the odds are not
that high IF THE DIRECTORY IS RANDOM.  If it's crafted by a malicious person,
all bets are off.

However, notice that glibc can only fail out of readdir once it gets an *actual*
value >= 2**32.  It's totally possible in principle to have a directory with
200 entries, the first 100 of which have d_off < 2**32, and the 101st has
d_off >= 2**32.  Readdir will only stop after having given back 100 entries
to the caller.  The caller most likely will process those 100 entries.
That's it, you've just forgotten to install/copy/read/whatever half the files.

Technically the caller could examine errno to find out that something bad
happened while using readdir, but odds are that they don't (I haven't seen
anyone do that in my entire career)--and also the error code they are using
is undocumented[1].  So even a person who would check wouldn't expect this
error value (errno == EOVERFLOW).  In short, it won't work in practice.

> We can still disabled emulated builds on ci.guix.gnu.org, but let’s
> first make sure we understand the practical impact of this bug.

We need non-emulated builds to compare.

If a real ARM machine uses substitutes for anything, it probably picks up
now-untrustworthy builds made by x86_64 for ARM and builds on top of those.

Or don't they use substitutes?
In that case everything would be OK-ish.
Otherwise huge mess...

[1] "man getdents64" does not list EOVERFLOW--at least not for me.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2020-09-25 16:50 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-19 15:36 bug#43513: json-c build failure (on armhf-linux) while trying to build u-boot Danny Milosavljevic
2020-09-19 21:05 ` Danny Milosavljevic
2020-09-21 12:22 ` Danny Milosavljevic
2020-09-21 12:23   ` Danny Milosavljevic
2020-09-21 12:44   ` Danny Milosavljevic
2020-09-25 10:13   ` Ludovic Courtès
2020-09-25 11:13     ` Danny Milosavljevic
2020-09-25 11:18       ` Danny Milosavljevic
2020-09-25 16:00         ` Ludovic Courtès
2020-09-25 16:25           ` Danny Milosavljevic
2020-09-26 10:53             ` Danny Milosavljevic
2020-09-26 17:20               ` Andreas Enge
2020-09-27  9:50               ` Andreas Enge
2020-09-27 11:32                 ` Danny Milosavljevic
2020-09-29 10:25               ` Ludovic Courtès
2020-09-29 10:43                 ` Danny Milosavljevic
2020-09-29 11:05                   ` Danny Milosavljevic
2020-09-30  9:10                   ` Ludovic Courtès
2020-09-30 11:27                     ` Danny Milosavljevic
2020-09-30 12:17                       ` Andreas Enge
2020-10-01 16:18                         ` Bengt Richter
2020-09-25 16:02       ` Ludovic Courtès
2020-09-25 16:23         ` Danny Milosavljevic [this message]
2020-09-25 16:37           ` Danny Milosavljevic

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=20200925182326.402aa6f2@scratchpost.org \
    --to=dannym@scratchpost.org \
    --cc=43513@debbugs.gnu.org \
    --cc=ludo@gnu.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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

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.