Gentoo Archives: gentoo-dev

From: Alexis Ballier <aballier@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Reviving the Sandbox project
Date: Fri, 22 Sep 2017 18:31:58
Message-Id: 20170922203144.2fe89545@gentoo.org
In Reply to: Re: [gentoo-dev] Reviving the Sandbox project by "Michał Górny"
1 On Fri, 22 Sep 2017 19:39:16 +0200
2 Michał Górny <mgorny@g.o> wrote:
3
4 > W dniu pią, 22.09.2017 o godzinie 19∶15 +0200, użytkownik Alexis
5 > Ballier napisał:
6 > > On Fri, 22 Sep 2017 17:20:23 +0200
7 > > Michał Górny <mgorny@g.o> wrote:
8 > >
9 > > > W dniu pią, 22.09.2017 o godzinie 12∶57 +0200, użytkownik Alexis
10 > > > Ballier napisał:
11 > > > > On Fri, 22 Sep 2017 06:07:18 +0200
12 > > > > Michał Górny <mgorny@g.o> wrote:
13 > > > >
14 > > > > > W dniu czw, 21.09.2017 o godzinie 15∶41 -0700, użytkownik Matt
15 > > > > > Turner napisał:
16 > > > > > > On Thu, Sep 21, 2017 at 2:25 PM, Michał Górny
17 > > > > > > <mgorny@g.o> wrote:
18 > > > > > > > Given that sandbox is utterly broken by design, I don't
19 > > > > > > > really want to put too much effort in trying to make it a
20 > > > > > > > little better. I'd rather put the minimal effort required
21 > > > > > > > to make it not-much-worse.
22 > > > > > >
23 > > > > > > You said in your initial email that you weren't an expert
24 > > > > > > in its internals, but here you say it's broken by design.
25 > > > > > > Why do you think that?
26 > > > > > >
27 > > > > >
28 > > > > > Because it uses LD_PRELOAD which is a huge hack and which
29 > > > > > causes guaranteed issues we can't really fix. All we can do
30 > > > > > is disable it for emacs, for compiler-rt and I'm afraid this
31 > > > > > list will grow because overriding random library functions is
32 > > > > > never a good idea.
33 > > > >
34 > > > > I think we're all ears for a better solution. There are probably
35 > > > > much better ways to do sandboxing these days than 15 years ago.
36 > > > >
37 > > > > LD_PRELOAD does not work with static binaries. Hence the non
38 > > > > portable ptrace stuff. Hence bugs. Etc. The point is, that's the
39 > > > > best we have now.
40 > > > >
41 > > >
42 > > > I know of two obvious alternatives: ptrace and filesystem layer
43 > > > (e.g. FUSE).
44 > > >
45 > > > For the former, there's sydbox. I'm going to look into
46 > > > integrating it into Portage when I have more time.
47 > >
48 > > From: https://github.com/alip/pinktrace/blob/master/configure.ac
49 > > case "$host_cpu" in
50 > > i[[3456]]86|pentium)
51 > > x86?64*|amd64)
52 > > ia64)
53 > > powerpc64*)
54 > > powerpc*)
55 > > arm*)
56 > > [add support for those arches]
57 > > *)
58 > > AC_MSG_RESULT([NO!])
59 > > AC_MSG_ERROR([Architecture $host_cpu is not supported by
60 > > pinktrace]) ;;
61 > >
62 > > sandbox keywords:
63 > > 2.11-r5:0: ~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc
64 > > ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd
65 > >
66 > >
67 > > Good luck adding the missing bits!
68 > >
69 > >
70 > > > For the latter, I have writing one in TODO. But I'm not sure when
71 > > > I'll have enough time to do work on it.
72 > >
73 > > Not sure how that would work, but you'll likely need some kind of
74 > > chroot/container since you don't want to trust a random binary ran
75 > > as root to respect environment variables.
76 > >
77 >
78 > Environment variables? What for?
79 >
80
81 I don't know :)
82 I have no idea how you would provide a virtual FS that would be the
83 only thing ever seen by all processes spawned.

Replies

Subject Author
Re: [gentoo-dev] Reviving the Sandbox project "Michał Górny" <mgorny@g.o>