From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 68C97138359 for ; Sat, 14 Nov 2020 16:41:10 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A6393E0391; Sat, 14 Nov 2020 16:41:09 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 6E250E0391 for ; Sat, 14 Nov 2020 16:41:09 +0000 (UTC) Received: by mail-ed1-f51.google.com with SMTP id v22so14299577edt.9 for ; Sat, 14 Nov 2020 08:41:08 -0800 (PST) X-Gm-Message-State: AOAM530llpsMs4rphocb1lMFXf9Fs31e7FtA+AwJrKk6fn+L1k16YMDZ QzaxUhvVmzdCdVwXqEZ/hBo1NqK61wLr3MJoHnA= X-Google-Smtp-Source: ABdhPJzkgDeExdDdvsOgmf8FAhnocM+b32EmI6s/9GxMs3Id7j7nZe31rFzDCduhRcAwxqipF9PNliiKPXI6ksWfhX0= X-Received: by 2002:a50:fa92:: with SMTP id w18mr7987723edr.44.1605372065365; Sat, 14 Nov 2020 08:41:05 -0800 (PST) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-catalyst@lists.gentoo.org Reply-to: gentoo-catalyst@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 References: <5fa82ef4b4010271be53a5d5c94e5c19b81f2bb3.camel@rohde-schwarz.com> In-Reply-To: <5fa82ef4b4010271be53a5d5c94e5c19b81f2bb3.camel@rohde-schwarz.com> From: Matt Turner Date: Sat, 14 Nov 2020 11:40:52 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [gentoo-catalyst] [PATCH] catalyst: Restore root and cwd after exiting mount namespace To: gentoo-catalyst@lists.gentoo.org Content-Type: text/plain; charset="UTF-8" X-Archives-Salt: df2b920e-a53a-4a83-b6ca-3779c9c6bcd2 X-Archives-Hash: 5b1bae71428e567fd8d27779d8f87db0 On Mon, Nov 9, 2020 at 2:36 PM Felix Bier wrote: > > This commit saves the file descriptor of /proc/self/{root,cwd} > before entering into the new mount namespace. When restoring the > previous mount namespace, it restores /proc/self/{root,cwd} > based on the saved file descriptors. > > Without this change, catalyst cannot be run in a chroot when > using the recent changes regarding mount namespaces: After the > mount namespace has been exited, /proc/self/root points to the "/" > of the host system, not the "/" of the chroot. Therefore, the > cleanup phase of catalyst runs outside of the chroot. > > The code is similar to how nsenter(1) sets root and cwd: > https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/tree/sys-utils/nsenter.c#n452 > > Tested in a Gentoo chroot and in Gentoo VM (non-chroot). > > Signed-off-by: Felix Bier Very nice. Thanks a bunch! I've committed all four patches, but not until I munged them: I stripped out all the headers except From/Date/Subject (and modified subject to remove [gentoo-catalyst], etc; then ran base64 -d on the body. Only then could I get the patches to apply. I really don't understand why. I've never had to do this before. Maybe you're sending the patches from a branch with a bunch of other work on it? I'd suggest making a fresh clone of catalyst and trying to apply the patches yourself to see if you can determine what's going on.