From patchwork Tue May 10 19:11:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 53755 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C2C90383941A for ; Tue, 10 May 2022 19:12:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C2C90383941A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1652209942; bh=MlxpGY21TqjTNe93sNB3X3DOsWDr9MgXsJHio2GOS7w=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=cUl6OhRfM5LYtICbA30gvjxHPGIXHM3UGe79VclqlUUXxDW57I77GNWgRlv8BSfvS ZYCBMwqflI0B51yEYH2LKp1MhMR823PRsmoodAJYPn9UHYPwwEp7/o3vjnILzJPvNy Q8ebyZVDAq6i9eZkTFUjoIFdy4BXwsKi6sNoP4N4= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oo1-xc2b.google.com (mail-oo1-xc2b.google.com [IPv6:2607:f8b0:4864:20::c2b]) by sourceware.org (Postfix) with ESMTPS id 5DD8D385380D for ; Tue, 10 May 2022 19:12:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5DD8D385380D Received: by mail-oo1-xc2b.google.com with SMTP id a23-20020a4ad5d7000000b0035ee70da7a9so3663870oot.1 for ; Tue, 10 May 2022 12:12:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=MlxpGY21TqjTNe93sNB3X3DOsWDr9MgXsJHio2GOS7w=; b=cvkj2V+YAIOneTg3c5YXDrVy/h5etZSA+mTYDfL8uX5t38SUf5fpsfZeDVrm4lUo7j 2Te/Vf1WKpOhi3vJxpAVaTL1iQqH2Wvo3YN3soCFaDaJRKCe/iZnvZwH58nzSAhO/rNU 5AaE1NED0I+E92H09JMhm+z2w5QBmqBKHrdveWgaZoJic0/W64oz7CGcI63BAmRN20Bg 9VRFAkKWuSdNrrtJL+x/HoI88PGVKv34SgThd1PFzJ/hsPo81iFVtWx93FPjLEZEBKa3 FmVC1wjei3l8BNFcGKLFlDmGMK8Y0KsMvZ0C3LTxjhoWmb5A3bV/2oknQ3IaHEaF6nTi hqpA== X-Gm-Message-State: AOAM530OenWgeqyXhT7bYcpSHXKXX7JqGsxRSgSfUA8iOhrlJGdbLnNR vIBzoxqApe1HNOwNIxoxlO4svFh66TbOWA== X-Google-Smtp-Source: ABdhPJxbIXl3FVxJT5HxJfzhKcWgZGqvGkcGGn3DGm3kbWYYZN6FzCm/m47ZZclHvS4tofHB5LemaQ== X-Received: by 2002:a4a:e604:0:b0:35f:8c21:7185 with SMTP id f4-20020a4ae604000000b0035f8c217185mr2927711oot.9.1652209920167; Tue, 10 May 2022 12:12:00 -0700 (PDT) Received: from birita.. ([2804:431:c7ca:5fbd:76f7:9485:c71c:cb46]) by smtp.gmail.com with ESMTPSA id a204-20020acab1d5000000b00325643bce40sm5792390oif.0.2022.05.10.12.11.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 May 2022 12:11:59 -0700 (PDT) To: libc-alpha@sourceware.org, Alexey Izbyshev , Carlos O'Donell , Florian Weimer Subject: [PATCH v4 0/3] Linux: Fix posix_spawn when user with time namespaces Date: Tue, 10 May 2022 16:11:52 -0300 Message-Id: <20220510191155.1998575-1-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-6.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" The patchset adds some support to tests the fallback code to use only use CLONE_VFORK. It uses unshare directly because it simpler than add container support. Adhemerval Zanella (3): linux: Add CLONE_NEWTIME from Linux 5.6 to bits/sched.h support: Add support_enter_time_namespace linux: Add fallback for clone failure on posix_spawn (BZ #29115) include/unistd.h | 4 +- io/closefrom.c | 2 +- posix/Makefile | 16 +- posix/tst-spawn-chdir-timens.c | 2 + posix/tst-spawn-chdir.c | 8 + posix/tst-spawn-timens.c | 2 + posix/tst-spawn.c | 6 + posix/tst-spawn2-timens.c | 2 + posix/tst-spawn2.c | 8 + posix/tst-spawn4-timens.c | 2 + posix/tst-spawn4.c | 10 +- posix/tst-spawn5-timens.c | 2 + posix/tst-spawn5.c | 10 +- posix/tst-spawn6-timens.c | 2 + posix/tst-spawn6.c | 12 +- support/Makefile | 1 + support/namespace.h | 5 + support/support_enter_time_namespace.c | 34 +++ sysdeps/unix/sysv/linux/bits/sched.h | 4 + sysdeps/unix/sysv/linux/closefrom_fallback.c | 6 +- sysdeps/unix/sysv/linux/spawni.c | 233 +++++++++++++++---- 21 files changed, 315 insertions(+), 56 deletions(-) create mode 100644 posix/tst-spawn-chdir-timens.c create mode 100644 posix/tst-spawn-timens.c create mode 100644 posix/tst-spawn2-timens.c create mode 100644 posix/tst-spawn4-timens.c create mode 100644 posix/tst-spawn5-timens.c create mode 100644 posix/tst-spawn6-timens.c create mode 100644 support/support_enter_time_namespace.c