From owner-freebsd-hackers@freebsd.org Sun Sep 27 19:56:28 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C3445426561 for ; Sun, 27 Sep 2020 19:56:28 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BzxHJ4qqTz4GGR for ; Sun, 27 Sep 2020 19:56:28 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f182.google.com (mail-qk1-f182.google.com [209.85.222.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 8424B14912 for ; Sun, 27 Sep 2020 19:56:28 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f182.google.com with SMTP id q63so8247020qkf.3 for ; Sun, 27 Sep 2020 12:56:28 -0700 (PDT) X-Gm-Message-State: AOAM5326irrFGGKf8fVGuRf7HkNbi0mS030CY4oLmkY2DONoqAa9JVQ1 W/2WHUBWF83Uiqu8Vk3e/OwJHcZ2CqPM2zfi1rw= X-Google-Smtp-Source: ABdhPJzPt7mQJ2gN8XqinAgX7QgzO/LR5Ej529dX1QRUBHZnb430Xmomw+/Tan3csSOLV3PbVQIwZ/be3mD2YSjaXkA= X-Received: by 2002:a37:a189:: with SMTP id k131mr8829971qke.34.1601236588142; Sun, 27 Sep 2020 12:56:28 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Kyle Evans Date: Sun, 27 Sep 2020 14:56:16 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Is it possible to exit the chroot(2) environment? To: Yuri Cc: Freebsd hackers list Content-Type: text/plain; charset="UTF-8" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Sep 2020 19:56:28 -0000 On Sun, Sep 27, 2020 at 2:47 PM Yuri wrote: > > On 2020-09-27 12:42, Kyle Evans wrote: > > I think the original report needs a ktrace to narrow down what's > > really going on... > > > https://people.freebsd.org/~yuri/rpm-ktrace-dump-chroot-fails.txt > Yup, that's pretty definitive: 69691 python3.7 CALL chroot(0x8026e6ad2) 69691 python3.7 NAMI "." 69691 python3.7 RET chroot -1 errno 1 Operation not permitted Note the explanation of EPERM: [EPERM] The effective user ID is not the super-user, or one or more filedescriptors are open directories. For the former half, a chroot in the very same python3.7 exec succeeded, so it must not be that. Try setting kern.chroot_allow_open_directories to some value that isn't 0 or 1.