From patchwork Mon May 29 19:46:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangjin Wu X-Patchwork-Id: 100394 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1734089vqr; Mon, 29 May 2023 12:49:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7Bm3gegMEcj1fmnmQflvIZAEa0tOuMatda44cexPAcpPn5l3HxARvfOY0jepZc3BzdWLTQ X-Received: by 2002:a17:903:2450:b0:1ad:bc86:851 with SMTP id l16-20020a170903245000b001adbc860851mr203963pls.45.1685389772943; Mon, 29 May 2023 12:49:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685389772; cv=none; d=google.com; s=arc-20160816; b=W4PZeNvEXktd/2cfi5tuFx9Jzsaz2KzuqcyZvEKyw7OX6fNiA8kN910tmDvOS1clUZ NpiIOawSA1LXvEdSsYgYfYWQiep61nIfnM4gxcU006u/+p5+Ljc+Is3+D1yD8K4cYuPn RF91J+Onv/q7CmvvGpda4OFwpgEl7DjLDuj+udr3aatzk7U+/NosLRrTjjZRV3/sZ/aE N3P6lappb1RpBkGpoW7xu2SzOJCK9PHiXPoGgH5tlZxJ/R5kv8jTaFiQ+NmBUIGw8X54 BC0M8Wutb4m0UJXPA1mPeCw37ptXAO59F12pUMi/1KacuhoA+1fAdPz17vrBikT91bpE TCXQ== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u16-20020a170902e81000b001aaea4707c1si2921541plg.99.2023.05.29.12.49.19; Mon, 29 May 2023 12:49:32 -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 S229632AbjE2TrB (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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767259266529074497?= X-GMAIL-MSGID: =?utf-8?q?1767259266529074497?= 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;