Skip to content

selftests/nolibc: add user-space 'efault' handler

Zhangjin Wu linux-kselftest linux-riscv lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4selftests/nolibc: allow rerun with the same settingstools/testing/selftests/nolibc/nolibc-test.c+29 -170 replies
2/4selftests/nolibc: add rerun supporttools/testing/selftests/nolibc/nolibc-test.c+38 -150 replies
3/4selftests/nolibc: add user space efault handlertools/testing/selftests/nolibc/nolibc-test.c+149 -20 replies
4/4selftests/nolibc: add user-space efault restore test casetools/testing/selftests/nolibc/nolibc-test.c+15 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] selftests/nolibc: add user-space 'efault' handler

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 = <obar> [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 = <obar> [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/[email protected]/

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(-)
Signature · 7 lines
2.25.1


_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv