Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp318456rwd; Mon, 12 Jun 2023 14:08:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7FZKkB+MJo67ROfm+/2M4IX8wrJZ0HsnSocWzA4hxOISjPnD8DMoNHwahTnh4Wl8s93xCX X-Received: by 2002:a17:906:fd8d:b0:974:5124:497b with SMTP id xa13-20020a170906fd8d00b009745124497bmr10879128ejb.34.1686604120144; Mon, 12 Jun 2023 14:08:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686604120; cv=none; d=google.com; s=arc-20160816; b=qsuj+nwczKQuW+DPwPpcfXt2MbK5lVKPYMu3CqW+8L2mqulcDtAo9kLYUdeeIEzvO6 uWcWV9eZDDl3rKRjt6KrtnDe+caRamOoLFsRrRhJKSSDe3QCUadVh336qsNnfJG1fgdJ FvBbtVEFgs0FaTbf/48xwkEVbf/LFcT9OP/R03eN8sHl3ruy3T46Iv6mW7mCzI9pTYlq VtGFDF3LXZzT98Hcg1NN1QDcq8fpM3gVc+l0ikOq9xRI2Fa7XDC3trIw88pZyornIvAQ DQz/MVC17p3PyV0FPDAhyd0IKlNduSU9FX97AUjt1wqznEOBLhC99XDpLvXwtIWbvV7S U+3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=1PPwlAM5oOuMaGSOc58w0uGJ+8X3KFv8UNH7MpMIz6Q=; b=wQL9LdV0pevL0gQ4pvozNMDNl3CAcPqbc8U7xnX3ABV5XqJwFpfP8Sv/CUcR/KZ3qn oQ1OBBcatUFl2SGQsEC6IiNLxm2dwAe+wQ7vV3WUz3oSOKojc/zzUVG/HRzeFPA4RbVB RpTmYgpfJIDAdKZUezZ1ugH6Rs+EANNv2F5KEKRvPU086b77CRDOIDVKPHATxUFAvBdn HK1Dx+s3Abj/dAhYLHE2UVisjlIiT1xkVzAoeKg7l6TrZOwhghpG9h03tv1AHnT9SlbO 4nrvUrxlRj78O9QZJPlQxq7zRq08O60H72LwbQJGNWlhI9YfsHUGgrQTiSz6jcXtenr8 R13w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CZg9DHFh; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y14-20020a170906558e00b0096f4d4bb07asi5766495ejp.141.2023.06.12.14.08.15; Mon, 12 Jun 2023 14:08:40 -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=@kernel.org header.s=k20201202 header.b=CZg9DHFh; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238485AbjFLUv1 (ORCPT + 99 others); Mon, 12 Jun 2023 16:51:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235972AbjFLUtA (ORCPT ); Mon, 12 Jun 2023 16:49:00 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D80C71FEF for ; Mon, 12 Jun 2023 13:46:54 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E2FD462F24 for ; Mon, 12 Jun 2023 20:45:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6678BC433A4; Mon, 12 Jun 2023 20:45:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686602717; bh=UfVmyxrW4sUICr3wEMH37xShjLNOPo5lV2yjbch7arw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CZg9DHFhLfiw1sKYA+IDtBUBoVhx0kedHv2DFQ9QdHIUoyAi2TMbwhHp6plOrw0Uh 5pNqnM6cvthSZqj7hfWhaM4wF1iWKoVWTux8b8HKow2YqEqxn9hdAfjfQ8mhfCxuuf 7wEcMuA5Orc1YQVkp8J+jHWodTPbPOJykHuJ7Gur1JEibNbW+F1Y9tpoaJULbMgs1M q/Hm3+mhWPaW22J1BOzk79xRs5zc+OMcPYhTuOaTxab2qSKXQALKbHA3edS/a8zM9c 073lg/mS2ceyKAAIVhjf83i+xphkEM8RdizLXYWE2zkVdJXC3AtceGZU5G2DvspCO1 /5ugQXSPp94sw== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 26FA1CE3A92; Mon, 12 Jun 2023 13:45:16 -0700 (PDT) From: "Paul E. McKenney" To: linux-kernel@vger.kernel.org Cc: gwml@vger.gnuweeb.org, kernel-team@meta.com, w@lwt.eu, Zhangjin Wu , Willy Tarreau , =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , "Paul E . McKenney" Subject: [PATCH v2 nolibc 50/53] selftests/nolibc: remove gettimeofday_bad1/2 completely Date: Mon, 12 Jun 2023 13:45:11 -0700 Message-Id: <20230612204514.292087-50-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <8b757cc0-3719-4e63-a755-9710384137bc@paulmck-laptop> References: <8b757cc0-3719-4e63-a755-9710384137bc@paulmck-laptop> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 From: Zhangjin Wu In the clock_gettime / clock_gettime64 syscalls based gettimeofday(), there is no way to let kernel space 'fixup' the invalid data pointer of 'struct timeval' and 'struct timezone' for us for we need to read timespec from kernel space and then convert to timeval in user-space ourselves and also we need to simply ignore and reset timezone in user-space. Without this removal, the invalid (void *)1 address will trigger a sigsegv (signum = 11) signal and stop the whole test. Suggested-by: Willy Tarreau Link: https://lore.kernel.org/linux-riscv/20230528113325.GJ1956@1wt.eu/ Signed-off-by: Zhangjin Wu Reviewed-by: Thomas Weißschuh Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney --- tools/testing/selftests/nolibc/nolibc-test.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c index 7896bc3f609e..b1f3ad25de35 100644 --- a/tools/testing/selftests/nolibc/nolibc-test.c +++ b/tools/testing/selftests/nolibc/nolibc-test.c @@ -593,10 +593,6 @@ int run_syscall(int min, int max) CASE_TEST(fork); EXPECT_SYSZR(1, test_fork()); break; CASE_TEST(getdents64_root); EXPECT_SYSNE(1, test_getdents64("/"), -1); break; CASE_TEST(getdents64_null); EXPECT_SYSER(1, test_getdents64("/dev/null"), -1, ENOTDIR); break; -#ifdef NOLIBC - CASE_TEST(gettimeofday_bad1); EXPECT_SYSER(1, gettimeofday((void *)1, NULL), -1, EFAULT); break; - CASE_TEST(gettimeofday_bad2); EXPECT_SYSER(1, gettimeofday(NULL, (void *)1), -1, EFAULT); break; -#endif CASE_TEST(getpagesize); EXPECT_SYSZR(1, test_getpagesize()); break; CASE_TEST(ioctl_tiocinq); EXPECT_SYSZR(1, ioctl(0, TIOCINQ, &tmp)); break; CASE_TEST(ioctl_tiocinq); EXPECT_SYSZR(1, ioctl(0, TIOCINQ, &tmp)); break; -- 2.40.1