Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3582510rwd; Mon, 29 May 2023 13:06:23 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ79E61CGhqov97IWHcbsbYZt9I+SyZr+BNTcT7R2c6RFcx6yvS+VgZ6PRKJoTQOMzqoEsq9 X-Received: by 2002:a05:6a00:aca:b0:63d:3339:e967 with SMTP id c10-20020a056a000aca00b0063d3339e967mr800778pfl.19.1685390782751; Mon, 29 May 2023 13:06:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685390782; cv=none; d=google.com; s=arc-20160816; b=uVVo5CZW8dHu7QqIuJ8tnG1mcgs6WikwdAmshLRX7MtX9BewZHROaI0jPM+MlYxUT+ NJ8TI8YKb7/ZtjILbEg2yuIOFwpVGSqosP9V0cV9MIWGBdx/0InbL/n7eZMJzbPzFE7m LvFeRn4TJvTANw9Q0k4yqmfJcWN7Gs54+dsPQorHTVCPanz3kTwiYvUPDO145mlLAxYr 9c8beI5g5Z6dDgsb8ckB8IuEJLaMa2zbXen+F9rvp97HEQ5khSUyaXgHxjz1KfP1ozQ/ sjjEnkl5+XiAIzxkgbUpkS4k1iYwf9LxORUACpA47CboZZ32uzoozjJvkpMuaVKEFrFS B2eQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=+oURXyOvtr5TmnR6anZqu3pw4eT40YFxd0pNqDXfhrY=; b=WfEAdwX1NrZKGOFCHeKymdnFZjRQnOXC7uYFgYdBhv2/gJy0EscNKHPPMdXxgx0L38 egqqDPrF830F7H/5Ne/BeeG1/SN0ur+wpyu5D6ZAHXCE3CvibBVqU4HCz3f6EOc2TqaO sTX5j2/NAVJ2jkjD4YruxMUBa02QXop7TkZaw4fvMpRD3nfc9XxNIeCYXUMFFS+Q3AIN tDnCmjL7qup3Fhwu7oiF3/+F3qOMe4Puzpps1rTcq7Q1i9k3I7AhrzP84oxlB5eRe/g/ xQpsAaVTp/SzEOoVjNoXqcP0XQZf1F8lb9Nht4PnhCO0Rs6flWGywNwGg3I5qd8DnUkC 7maQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j63-20020a638042000000b00537d40e79a6si6238935pgd.177.2023.05.29.13.06.08; Mon, 29 May 2023 13:06:22 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229631AbjE2TrB (ORCPT + 99 others); Mon, 29 May 2023 15:47:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229455AbjE2TrA (ORCPT ); Mon, 29 May 2023 15:47:00 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.155.67.158]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FD74B7; Mon, 29 May 2023 12:46:58 -0700 (PDT) X-QQ-mid: bizesmtp79t1685389607t80smhoc Received: from linux-lab-host.localdomain ( [119.123.130.80]) by bizesmtp.qq.com (ESMTP) with id ; Tue, 30 May 2023 03:46:46 +0800 (CST) X-QQ-SSF: 01200000000000D0V000000A0000000 X-QQ-FEAT: q+EIYT+FhZqztxguIVnnRhTx7mjT8KL3kpkNC9vlw/RJOJQunBpKKt3coh9nS b3hqugotci/+9LQaEWn5aWBw66TFgblIOoUHGzmoydkxp1VYBK3Jk0ftC+E+SfP8adRPKNC UOsplQSyz0Noa7ioorK0D4V2iSL+p0qOOTecBgsQGIF03PxcS8Wg384BzjdHIzbWaJY6A9P goVQyM/uk01ucMbDc8gymFRq/Br7+KWgXOlJbnQnNhcW26+kodAetsOUhrxkRr7H4ylwCrw UZsspZLj5FqA/WiT3kx2fAwpok1NcIOqmfOaxha6aU4OOvFLZ3nLptqkzd5wdCMDmGDCCMx o54rHau5cEQE7opKNJnlEEdyJKve++VllBqRR/ep/KB8//hCOyKMbqg+HwrLQ== X-QQ-GoodBg: 0 X-BIZMAIL-ID: 274745737586768442 From: Zhangjin Wu To: w@1wt.eu Cc: arnd@arndb.de, falcon@tinylab.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-riscv@lists.infradead.org, thomas@t-8ch.de Subject: [PATCH v2 01/13] selftests/nolibc: remove gettimeofday_bad1/2 completely Date: Tue, 30 May 2023 03:46:42 +0800 Message-Id: <485fe4e27c1fd1a84d11e9fc47178a48de39263b.1685387484.git.falcon@tinylab.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrsz:qybglogicsvrsz3a-3 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, 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 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. Signed-off-by: Zhangjin Wu --- 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 a8fcad801cf2..7be2625f952d 100644 --- a/tools/testing/selftests/nolibc/nolibc-test.c +++ b/tools/testing/selftests/nolibc/nolibc-test.c @@ -582,10 +582,6 @@ int run_syscall(int min, int max) 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; CASE_TEST(gettimeofday_null); EXPECT_SYSZR(1, gettimeofday(NULL, NULL)); 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.25.1