Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4331247rwd; Tue, 30 May 2023 04:04:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7EtWbhU7KxuKEhQoTjQ46Aj5rXpX8EVn2NZuZEUPwOY5GmDxQGDcPufVIyeiN61WVD/z6A X-Received: by 2002:a05:6a00:c82:b0:649:dd0d:69d1 with SMTP id a2-20020a056a000c8200b00649dd0d69d1mr2121657pfv.31.1685444639869; Tue, 30 May 2023 04:03:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685444639; cv=none; d=google.com; s=arc-20160816; b=EjLFUYPrswAjTfJO+i0pLdoA29zsB3AkHE5wK/0/eDZDryct9DHB7KUyBnG/VQFEeD +jAvuk+pJB+ByZeglfr+BqmNRLzkPZ9opjywBzypXThozHXNS1QZPgYvn3tGZ0CwdJRp bayjsuK/YQyPC/C5GblIhwv4dZqQ/Yb9LuoPpu3ntdWeLiIDEEE0EfVnTYENw7H7Bkpt 0pNrwhdim+59pH6OX6MZnOlLuZIYmbzBkx9lCQ0DLigIzeWu7yYbFnLykYrZxndwyJMN c+IyjFwf8S4+YAy8A7ZFFOZ6S6yzTZsUgP8UJBqgBUWdQdQ4rJVxQ6/RC3zFGPdyGn3d /nkw== 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:message-id:date:subject:cc:to:from; bh=fyzinr/PJJAPDZ+srGF5OAXwI8QB6Si+griabaxOT6w=; b=jsuGtPI0nqIIM3QCUnPo9BcC6tUDE+SZYyF4Z79aOtg3mo5pWDP89eyl9B9Ddc3luU HrGLjcjatiDYpm+camAMxIOaETs16ZxWpOrG8bT9jd97DQ8v3qclXl6KSwOIHAJQCTAn VMYHLnUU92UI1Hw33i33dIVSBNCKvnE3XA/X78iFxgl34QLl6FlJN9kxq8tNi9m4S9R/ I+28aub8UZc/uuUz+fiFdPLZTW9sUo5HAfkmFssE2/yj1rACM7KFp9IirJ2qfl5wAt4L kNJoI56qjKmVPnGQaNJ0X/jPyTynxG1baBCbVMaZx3nKuHHMYJ98jKjUikAnmTz6ONCN 9r8g== 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 x18-20020aa79ad2000000b00643af2c3432si1544904pfp.222.2023.05.30.04.03.46; Tue, 30 May 2023 04:03:59 -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 S231758AbjE3Ksf (ORCPT + 99 others); Tue, 30 May 2023 06:48:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231659AbjE3Kr5 (ORCPT ); Tue, 30 May 2023 06:47:57 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.155.67.158]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 910D8102; Tue, 30 May 2023 03:47:50 -0700 (PDT) X-QQ-mid: bizesmtp68t1685443664twnpak60 Received: from linux-lab-host.localdomain ( [119.123.130.226]) by bizesmtp.qq.com (ESMTP) with id ; Tue, 30 May 2023 18:47:43 +0800 (CST) X-QQ-SSF: 01200000000000D0V000000A0000000 X-QQ-FEAT: C46Rb8GPIEfLZaiD+Tj2Qw68S6CmHsgj7w+vsvgLRgBtK+77c1nm1Y+dZQciE yMI6X0Dlof9TqnGRL08Kb5tY/A2buyMdyGThpzwm1QqEHoKx4+PP5RZVSQGL6e09Ea2ij32 pPlQiDnGe+eyZW3rXAOllns96irDaF1DQpNSoiDmefKR8ZO5cCnENDJLPXotANFNbd81R+Y MiTH03hSIMCL7dPxdORkEpZqOKy7IzSF54yu/EZozLuPdDxiZXEZkCLD9UtK56W3I2zckfd HIY0mB8eeNxgNNPDkUCYIK9Awd6LZ1jompcNnI9riAwkgLIieRr3LCP0yt7i4pzAAoUxlcU 4jPq803VQxMD7rewyydupUZpW5wDtbxi7hA247/bsd/DPeXpc4lyUaSL+QCT5H2ADuk79yh X-QQ-GoodBg: 0 X-BIZMAIL-ID: 14120017678416040009 From: Zhangjin Wu To: w@1wt.eu Cc: falcon@tinylab.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-riscv@lists.infradead.org, thomas@t-8ch.de Subject: [PATCH 0/4] selftests/nolibc: add user-space 'efault' handler Date: Tue, 30 May 2023 18:47:38 +0800 Message-Id: X-Mailer: git-send-email 2.25.1 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 Hi, Willy, Thomas This is not really for merge, but only let it work as a demo code to test whether it is possible to restore the next test when there is a bad pointer access in user-space [1]. Besides, a new 'run' command is added to 'NOLIBC_TEST' environment variable or arguments to control the running iterations, this may be used to test the reentrancy issues, but no failures found currently ;-) With glibc, it works as following: $ ./nolibc-test run:2,syscall:28-30,stdlib:1 Running iteration(s): 2 Current iteration: 1 Running test 'syscall', from 28 to 30 28 dup3_m1 = -1 EBADF [OK] 29 efault_handler ! 11 SIGSEGV [OK] 30 execve_root = -1 EACCES [OK] Errors during this test: 0 Running test 'stdlib' 1 getenv_blah = <(null)> [OK] Errors during this test: 0 Total number of errors in the 1 iteration(s): 0 Current iteration: 2 Running test 'syscall' 28 dup3_m1 = -1 EBADF [OK] 29 efault_handler ! 11 SIGSEGV [OK] 30 execve_root = -1 EACCES [OK] Errors during this test: 0 Running test 'stdlib' 1 getenv_blah = <(null)> [OK] Errors during this test: 0 Total number of errors in the 2 iteration(s): 0 With nolibc, it will be skipped (run:2,syscall:28-30,stdlib:10): Running iteration(s): 2 Current iteration: 1 Running test 'syscall', from 28 to 30 28 dup3_m1 = -1 EBADF [OK] 29 efault_handler [SKIPPED] 30 execve_root = -1 EACCES [OK] Errors during this test: 0 Running test 'stdlib', from 10 to 10 10 strrchr_foobar_o = [OK] Errors during this test: 0 Total number of errors in the 1 iteration(s): 0 Current iteration: 2 Running test 'syscall', from 28 to 30 28 dup3_m1 = -1 EBADF [OK] 29 efault_handler [SKIPPED] 30 execve_root = -1 EACCES [OK] Errors during this test: 0 Running test 'stdlib', from 10 to 10 10 strrchr_foobar_o = [OK] Errors during this test: 0 Total number of errors in the 2 iteration(s): 0 Best regards, Zhangjin --- [1]: https://lore.kernel.org/linux-riscv/20230529113143.GB2762@1wt.eu/ Zhangjin Wu (4): selftests/nolibc: allow rerun with the same settings selftests/nolibc: add rerun support selftests/nolibc: add user space efault handler selftests/nolibc: add user-space efault restore test case tools/testing/selftests/nolibc/nolibc-test.c | 247 +++++++++++++++++-- 1 file changed, 221 insertions(+), 26 deletions(-) -- 2.25.1