Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp6407156rwn; Tue, 13 Sep 2022 03:59:19 -0700 (PDT) X-Google-Smtp-Source: AA6agR6ShWC1BCTD4ZbpD92bGnzg360fN+9kKY9iiltZU94KDQIaePZDh5nP+Ir50J7p3fQgpYVI X-Received: by 2002:a17:90a:7642:b0:200:4a5e:1227 with SMTP id s2-20020a17090a764200b002004a5e1227mr3285295pjl.91.1663066759712; Tue, 13 Sep 2022 03:59:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663066759; cv=none; d=google.com; s=arc-20160816; b=oychgMDcrPx6HLhxLnPTdsu3L22z/GcujzXDbGy4VKJsKe0F4FlaFJp6QQElUoCj2T xh/enjhEXZzMMwwSE6vSqscSKiTu4WIRF4hm+fP9MJzPi0Qea7zpf7rIoeUYsNVkJ9PT yS02oPa4zrHpZ1SHjHnMHxcaE8iYW5oArMQBUPnJfm3NHdvwQz/wGGbzYii1bLhCCnx9 7hv/G+LASJiy8TUkz9Tg+wB51dL+fHTPi+n6GRg2JRwKlJafp5b3MUlrGYLyjZ2E5XOf EzWfv4dSW98xh2+nt3I7yBnlA7sYI/FcjELn5GXkquO5YFH10hg1XMytoWiwFDU3Hk6B 68oQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=oQ9VKh7lKBpZzXj2SDeGJNjqxKiaiW5G7hAjfWWdBTU=; b=iP0hzVJ1ymCEgAX3OWzg99hAXhbXa37uhQa71EfbD9xlYYhxc0KDp4KuTovajfJJ1s Cu9oVC84b6GJ0JlNZVLaidXe9RMnnJ3JACAM7T/G1t16YjniEGotnlNQ8zD2JrFRE/IH bKPI8ntfMvNmhDYdT6Bu++lI66neIFniz26G/Z3xiJmlM7DhZ9viQqCWsDxDWNUo4m3h 71QdAREWFAOCk9wjtMyXEKKIHKmmYvafzjhsCTJCK7uLh68mhfQ5BA0d5iIq0OadrMRM p/JGUwalqsX69+JFPa6VcjN99POo6XGvel+4ER9Lo0ESiKguzIow13Qz9HvLuOGtcKQ9 60UA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=ilkl91q2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r19-20020a635d13000000b0042adcc66b1asi12488277pgb.22.2022.09.13.03.59.07; Tue, 13 Sep 2022 03:59:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=ilkl91q2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231497AbiIMK01 (ORCPT + 99 others); Tue, 13 Sep 2022 06:26:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229765AbiIMKZ6 (ORCPT ); Tue, 13 Sep 2022 06:25:58 -0400 Received: from mail-pl1-x64a.google.com (mail-pl1-x64a.google.com [IPv6:2607:f8b0:4864:20::64a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5ED335C377 for ; Tue, 13 Sep 2022 03:25:57 -0700 (PDT) Received: by mail-pl1-x64a.google.com with SMTP id b11-20020a170902d50b00b0017828988079so5104210plg.21 for ; Tue, 13 Sep 2022 03:25:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date; bh=oQ9VKh7lKBpZzXj2SDeGJNjqxKiaiW5G7hAjfWWdBTU=; b=ilkl91q2khqrM3k6yYYhdoXWllgFVjk+BgNjetxjvxzPRTIgHR+e1BH5du9ZjCT5Gg /Rp4txgH4Xld1+h9SuxGB+lChOxQaox28ihex1kPfKOnOXW/9sYFoBcyqhMwf/GDY399 1fvGa8XUDGMUpI2shvEAIo9bnobtIA9uDkUtTeTTdky/mos6Gav7XOhceAa39YP9bCkd bretutUYIfD+ivU4LgLuwoWuD01AE79HdShW3Vd3hLh7gm6P82vDnuEvyDYgV0mvsw9q loK4+nLST/kSXDPpVYcydTfYe94VUTFfZ34R87l6VQlA0cokTPGKdy3dy1leMCSZSv7d r3tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date; bh=oQ9VKh7lKBpZzXj2SDeGJNjqxKiaiW5G7hAjfWWdBTU=; b=z8eLOTMXd7rvhdfzPHu1y4wSG1ILAl01cRQ8ec6Sv2iS8mXGTZxLokIrixxFiQArSF 6VEno/oyWAscLGsfGGcs/fVTrSTBgcPhKkFKRh6+GT/2G6Ypu4vrZVUpbeq1tvbRa5UK UXChdL833s3acuIH52Hv47Scp0zXr/gtmoluqAbe4QaxhmcetoCAktUEYCerO+BSP4OH HfbwouQBvyLtQgY+UG+6aNDz1u6gHX/EDPf7s4EWCXtat6loBLqRnr2wAcjKxy4zyKjm uhFtyhVPF9sgqh1Nyl5idE5e+GfVnMhtry7rEqOZZb2Ii6hoiAtE+4wJV1Lok8SiB2QH hWKg== X-Gm-Message-State: ACgBeo0dMQrz1aTKUyQiCl2SjPmHHuH8SO8UDYyGBac8+f9ykyTAHC0n lDNcE1g0Z3OHgpwCak0qZdjbOWeVl+o= X-Received: from avagin.kir.corp.google.com ([2620:15c:29:204:d94b:8d9d:2b23:6608]) (user=avagin job=sendgmr) by 2002:a17:90b:4f44:b0:1f5:1310:9e7f with SMTP id pj4-20020a17090b4f4400b001f513109e7fmr3219470pjb.235.1663064756794; Tue, 13 Sep 2022 03:25:56 -0700 (PDT) Date: Tue, 13 Sep 2022 03:25:50 -0700 In-Reply-To: <20220913102551.1121611-1-avagin@google.com> Mime-Version: 1.0 References: <20220913102551.1121611-1-avagin@google.com> X-Mailer: git-send-email 2.37.2.789.g6183377224-goog Message-ID: <20220913102551.1121611-2-avagin@google.com> Subject: [PATCH 1/2] Revert "selftests/timens: add a test for vfork+exit" From: Andrei Vagin To: Kees Cook Cc: linux-kernel@vger.kernel.org, Andrei Vagin , Andrei Vagin Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The next patch reverts the code that this test verified. This reverts commit 6342140db6609a0c7d34f68c52b2947468e0e630. Signed-off-by: Andrei Vagin --- tools/testing/selftests/timens/Makefile | 2 +- tools/testing/selftests/timens/vfork_exec.c | 90 --------------------- 2 files changed, 1 insertion(+), 91 deletions(-) delete mode 100644 tools/testing/selftests/timens/vfork_exec.c diff --git a/tools/testing/selftests/timens/Makefile b/tools/testing/selftests/timens/Makefile index f0d51d4d2c87..3a5936cc10ab 100644 --- a/tools/testing/selftests/timens/Makefile +++ b/tools/testing/selftests/timens/Makefile @@ -1,4 +1,4 @@ -TEST_GEN_PROGS := timens timerfd timer clock_nanosleep procfs exec futex vfork_exec +TEST_GEN_PROGS := timens timerfd timer clock_nanosleep procfs exec futex TEST_GEN_PROGS_EXTENDED := gettime_perf CFLAGS := -Wall -Werror -pthread diff --git a/tools/testing/selftests/timens/vfork_exec.c b/tools/testing/selftests/timens/vfork_exec.c deleted file mode 100644 index e6ccd900f30a..000000000000 --- a/tools/testing/selftests/timens/vfork_exec.c +++ /dev/null @@ -1,90 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "log.h" -#include "timens.h" - -#define OFFSET (36000) - -int main(int argc, char *argv[]) -{ - struct timespec now, tst; - int status, i; - pid_t pid; - - if (argc > 1) { - if (sscanf(argv[1], "%ld", &now.tv_sec) != 1) - return pr_perror("sscanf"); - - for (i = 0; i < 2; i++) { - _gettime(CLOCK_MONOTONIC, &tst, i); - if (abs(tst.tv_sec - now.tv_sec) > 5) - return pr_fail("%ld %ld\n", now.tv_sec, tst.tv_sec); - } - return 0; - } - - nscheck(); - - ksft_set_plan(1); - - clock_gettime(CLOCK_MONOTONIC, &now); - - if (unshare_timens()) - return 1; - - if (_settime(CLOCK_MONOTONIC, OFFSET)) - return 1; - - for (i = 0; i < 2; i++) { - _gettime(CLOCK_MONOTONIC, &tst, i); - if (abs(tst.tv_sec - now.tv_sec) > 5) - return pr_fail("%ld %ld\n", - now.tv_sec, tst.tv_sec); - } - - pid = vfork(); - if (pid < 0) - return pr_perror("fork"); - - if (pid == 0) { - char now_str[64]; - char *cargv[] = {"exec", now_str, NULL}; - char *cenv[] = {NULL}; - - // Check that we are still in the source timens. - for (i = 0; i < 2; i++) { - _gettime(CLOCK_MONOTONIC, &tst, i); - if (abs(tst.tv_sec - now.tv_sec) > 5) - return pr_fail("%ld %ld\n", - now.tv_sec, tst.tv_sec); - } - - /* Check for proper vvar offsets after execve. */ - snprintf(now_str, sizeof(now_str), "%ld", now.tv_sec + OFFSET); - execve("/proc/self/exe", cargv, cenv); - return pr_perror("execve"); - } - - if (waitpid(pid, &status, 0) != pid) - return pr_perror("waitpid"); - - if (status) - ksft_exit_fail(); - - ksft_test_result_pass("exec\n"); - ksft_exit_pass(); - return 0; -} -- 2.37.2.789.g6183377224-goog