diff options
author | Zhangjin Wu <falcon@tinylab.org> | 2023-07-07 18:08:20 +0300 |
---|---|---|
committer | Willy Tarreau <w@1wt.eu> | 2023-08-23 05:38:02 +0300 |
commit | fcdbf5dda418aad3fdc5fcedbdb41900a24178a8 (patch) | |
tree | db17d7f13bd76812c49385927ce27cd80e4a4ade /tools/testing/selftests/nolibc/Makefile | |
parent | ba3d0892be0e2d5a7d144c5519920130639524fc (diff) | |
download | linux-fcdbf5dda418aad3fdc5fcedbdb41900a24178a8.tar.xz |
selftests/nolibc: add mmap_munmap_good test case
mmap() a file with a good offset and then munmap() it. a non-zero offset
is passed to test the 6th argument of my_syscall6().
Note, it is not easy to find a unique file for mmap() in different
scenes, so, a file list is used to search the right one:
- /dev/zero: is commonly used to allocate anonymous memory and is likely
present and readable
- /proc/1/exe: for 'run' and 'run-user' target, 'run-user' can not find
'/proc/self/exe'
- /proc/self/exe: for 'libc-test' target, normal program 'libc-test' has
no permission to access '/proc/1/exe'
- argv0: the path of the program itself, let it pass even with worst
case scene: no procfs and no /dev/zero
Suggested-by: Willy Tarreau <w@1wt.eu>
Link: https://lore.kernel.org/lkml/20230702193306.GK16233@1wt.eu/
Suggested-by: Thomas Weißschuh <linux@weissschuh.net>
Link: https://lore.kernel.org/lkml/bff82ea6-610b-4471-a28b-6c76c28604a6@t-8ch.de/
Signed-off-by: Zhangjin Wu <falcon@tinylab.org>
Signed-off-by: Willy Tarreau <w@1wt.eu>
Diffstat (limited to 'tools/testing/selftests/nolibc/Makefile')
0 files changed, 0 insertions, 0 deletions