From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <guix-devel-bounces+larch=yhetil.org@gnu.org>
Received: from mp1 ([2001:41d0:2:4a6f::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by ms11 with LMTPS
	id CHu0Dh1GJGCQUQAA0tVLHw
	(envelope-from <guix-devel-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Wed, 10 Feb 2021 20:46:21 +0000
Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by mp1 with LMTPS
	id EMBmCh1GJGAzAgAAbx9fmQ
	(envelope-from <guix-devel-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Wed, 10 Feb 2021 20:46:21 +0000
Received: from lists.gnu.org (lists.gnu.org [209.51.188.17])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by aspmx1.migadu.com (Postfix) with ESMTPS id 8B99B940481
	for <larch@yhetil.org>; Wed, 10 Feb 2021 20:46:20 +0000 (UTC)
Received: from localhost ([::1]:52266 helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <guix-devel-bounces+larch=yhetil.org@gnu.org>)
	id 1l9wNO-0007ly-UT
	for larch@yhetil.org; Wed, 10 Feb 2021 15:46:19 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:39216)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@gnu.org>) id 1l9wN8-0007lF-Pu
 for guix-devel@gnu.org; Wed, 10 Feb 2021 15:46:02 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:55804)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@gnu.org>)
 id 1l9wN7-0002UQ-HZ; Wed, 10 Feb 2021 15:46:01 -0500
Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=45612 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <ludo@gnu.org>)
 id 1l9wN5-0002ur-ND; Wed, 10 Feb 2021 15:46:01 -0500
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@gnu.org>
To: Maxime Devos <maximedevos@telenet.be>
Subject: Re: Potential security weakness in Guix services
References: <YBMybeFOP0VfW6G7@jasmine.lan> <87k0rrls0z.fsf@gnu.org>
 <08F0CD76-DDCF-4CFA-AE8D-5FB165A62B25@lepiller.eu>
 <c7e82df3921fb0eaefb9db798d634f63f6eb0142.camel@telenet.be>
 <87o8h2ehy7.fsf@gnu.org>
 <69968b3a01d872cabdf55a94b6c82d5057e010c9.camel@telenet.be>
 <87v9b66dm1.fsf@gnu.org>
 <56adb5efa894304c27beba99b07e2f8cfd8ee7cb.camel@telenet.be>
 <c6164b827beb62aa8f8f276473081eb7cf557110.camel@telenet.be>
 <87sg68zy15.fsf@gnu.org>
 <3c869a8c38ba8c98e29a06de1404f9dbf8fe7a68.camel@telenet.be>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 22 =?utf-8?Q?Pluvi=C3=B4se?= an 229 de la
 =?utf-8?Q?R=C3=A9volution?=
X-PGP-Key-ID: 0x090B11993D9AEBB5
X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc
X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5
X-OS: x86_64-pc-linux-gnu
Date: Wed, 10 Feb 2021 21:45:58 +0100
In-Reply-To: <3c869a8c38ba8c98e29a06de1404f9dbf8fe7a68.camel@telenet.be>
 (Maxime Devos's message of "Sat, 06 Feb 2021 23:01:49 +0100")
Message-ID: <87ft23648p.fsf@gnu.org>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-BeenThere: guix-devel@gnu.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "Development of GNU Guix and the GNU System distribution."
 <guix-devel.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/guix-devel>,
 <mailto:guix-devel-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/guix-devel>
List-Post: <mailto:guix-devel@gnu.org>
List-Help: <mailto:guix-devel-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/guix-devel>,
 <mailto:guix-devel-request@gnu.org?subject=subscribe>
Cc: guix-devel@gnu.org
Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org
Sender: "Guix-devel" <guix-devel-bounces+larch=yhetil.org@gnu.org>
X-Migadu-Flow: FLOW_IN
X-Migadu-Spam-Score: -2.86
Authentication-Results: aspmx1.migadu.com;
	dkim=none;
	dmarc=pass (policy=none) header.from=gnu.org;
	spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org
X-Migadu-Queue-Id: 8B99B940481
X-Spam-Score: -2.86
X-Migadu-Scanner: scn0.migadu.com
X-TUID: r4YwBZNxo7Oh

Hi Maxime,

Maxime Devos <maximedevos@telenet.be> skribis:

> On Sat, 2021-02-06 at 22:28 +0100, Ludovic Court=C3=A8s wrote:
>> Maxime Devos <maximedevos@telenet.be> skribis:
>>=20
>> I just remembered this subtlety: during bootup, the activation code is
>> evaluated by the Guile that=E2=80=99s in the initrd, which is a
>> statically-linked Guile, and thus we can=E2=80=99t use =E2=80=98dynamic-=
link=E2=80=99 & co. in
>> there.  :-/
>
> I remember trying to use make-forkexec-constructor/container from activat=
ion
> code, which didn't work, due to some uses of dynamic-func ...  I see two
> possible options to take:
>
> * extend gnu/packages/patches/guile-linux-syscalls.patch with, say,
>   a "%extra-function-pointers" procedure returning a vector (or alist,
>   or something else) of pointers to the relevant C functions.  This
>   allows us to write the FFI code mostly in Scheme, and only write C
>   code for obtaining function pointer.
>
> * extend gnu/packages/patches/guile-linux-syscalls.patch with
>   additional bindings, or write a patch extending guile itself with
>   fchownat
> and other *at support.  This (second) patch should be
>   submitted upstream, but can be kept in gnu/packages/patches until
>   support for *at
> functionality makes it upstream.

Like I wrote earlier in <87zh0gzy52.fsf@gnu.org>, I think we can fix
this particular issue (=E2=80=98mkdir-p/perms=E2=80=99) without resorting t=
o the *at
functions, and I think that=E2=80=99s what we should do.

Support for *at will be useful, especially if we can make it part of
Guile proper, but it=E2=80=99s not an absolute prerequisite for the issue at
hand.

WDYT?

Thanks for looking into this!

Ludo=E2=80=99.