Jianlin Lv
0390c429db
selftests/bpf: Fix segmentation fault in test_progs
...
test_progs reports the segmentation fault as below:
$ sudo ./test_progs -t mmap --verbose
test_mmap:PASS:skel_open_and_load 0 nsec
[...]
test_mmap:PASS:adv_mmap1 0 nsec
test_mmap:PASS:adv_mmap2 0 nsec
test_mmap:PASS:adv_mmap3 0 nsec
test_mmap:PASS:adv_mmap4 0 nsec
Segmentation fault
This issue was triggered because mmap() and munmap() used inconsistent
length parameters; mmap() creates a new mapping of 3 * page_size, but the
length parameter set in the subsequent re-map and munmap() functions is
4 * page_size; this leads to the destruction of the process space.
To fix this issue, first create 4 pages of anonymous mapping, then do all
the mmap() with MAP_FIXED.
Another issue is that when unmap the second page fails, the length
parameter to delete tmp1 mappings should be 4 * page_size.
Signed-off-by: Jianlin Lv <Jianlin.Lv@arm.com >
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net >
Acked-by: Andrii Nakryiko <andriin@fb.com >
Link: https://lore.kernel.org/bpf/20200810153940.125508-1-Jianlin.Lv@arm.com
2020-08-11 15:36:45 +02:00
..
2020-03-25 11:50:48 +01:00
2020-05-16 01:18:14 +02:00
2019-12-19 16:14:08 +01:00
2020-06-28 10:06:53 -07:00
2020-08-06 16:39:14 -07:00
2020-04-28 17:27:08 -07:00
2020-03-23 20:51:55 +01:00
2020-01-10 17:20:07 +01:00
2020-03-20 21:46:12 +01:00
2020-07-30 01:30:26 +02:00
2020-07-31 00:43:49 +02:00
2020-03-02 17:00:41 -08:00
2020-06-09 11:21:43 -07:00
2020-03-02 17:00:41 -08:00
2020-08-01 20:38:28 -07:00
2020-07-02 16:09:01 +02:00
2020-04-26 10:00:36 -07:00
2020-07-02 16:09:01 +02:00
2019-12-18 17:33:36 -08:00
2020-04-28 19:48:05 -07:00
2020-08-01 23:10:42 -07:00
2020-01-20 16:37:45 -08:00
2020-05-01 10:36:32 -07:00
2020-07-01 09:06:12 +02:00
2020-06-30 22:21:29 +02:00
2020-03-04 13:41:06 -08:00
2020-05-09 00:48:20 +02:00
2019-11-15 23:43:53 +01:00
2020-03-04 13:41:06 -08:00
2020-05-09 00:48:20 +02:00
2020-06-30 10:46:39 -07:00
2020-06-30 10:46:39 -07:00
2020-03-30 15:00:30 -07:00
2020-07-25 20:16:35 -07:00
2020-03-30 01:17:35 +02:00
2020-05-09 00:48:20 +02:00
2020-04-28 19:48:05 -07:00
2020-05-09 00:48:20 +02:00
2020-06-22 17:01:48 -07:00
2020-05-09 00:48:20 +02:00
2020-03-02 22:06:27 -08:00
2020-07-02 16:09:01 +02:00
2020-05-09 00:48:20 +02:00
2020-06-22 22:22:59 +02:00
2020-08-11 15:36:45 +02:00
2020-03-04 13:41:06 -08:00
2020-04-28 19:48:05 -07:00
2019-03-02 11:10:40 -08:00
2020-02-19 15:01:07 -08:00
2020-07-09 00:44:45 +02:00
2020-07-25 20:16:35 -07:00
2019-11-10 19:26:30 -08:00
2020-05-09 00:48:20 +02:00
2020-05-09 00:48:20 +02:00
2019-12-15 15:58:04 -08:00
2020-05-09 00:48:20 +02:00
2020-05-09 00:48:20 +02:00
2019-04-26 19:04:19 -07:00
2019-04-26 19:04:19 -07:00
2019-12-15 15:58:05 -08:00
2019-10-22 21:35:03 +02:00
2020-07-21 13:26:26 -07:00
2020-06-01 14:38:22 -07:00
2020-06-08 16:00:42 +02:00
2020-07-25 20:37:02 -07:00
2020-03-09 22:34:59 +01:00
2020-03-05 14:02:41 -08:00
2020-08-06 16:58:42 -07:00
2020-05-09 00:48:20 +02:00
2020-04-29 23:31:00 +02:00
2020-08-01 20:38:28 -07:00
2020-08-03 23:32:23 +02:00
2020-06-01 14:38:21 -07:00
2020-07-13 17:07:43 -07:00
2020-06-01 14:38:20 -07:00
2020-02-20 01:17:24 +01:00
2020-03-13 21:37:06 +01:00
2020-07-16 20:57:09 +02:00
2019-09-06 09:59:05 -07:00
2020-06-17 10:54:05 -07:00
2019-09-06 09:59:05 -07:00
2020-05-09 00:48:20 +02:00
2020-08-06 16:58:42 -07:00
2019-12-17 22:16:35 -08:00
2019-08-28 00:35:40 +02:00
2019-08-28 00:35:40 +02:00
2019-11-24 17:04:12 -08:00
2019-08-28 00:35:40 +02:00
2019-08-28 00:35:40 +02:00
2019-08-28 00:35:40 +02:00
2020-07-02 16:09:01 +02:00
2020-01-10 17:20:07 +01:00
2020-04-02 19:42:52 -07:00
2020-05-13 12:19:38 -07:00
2019-05-09 15:53:56 -07:00
2020-07-13 16:55:49 -07:00
2020-02-20 18:03:10 -08:00
2020-07-08 01:07:36 +02:00
2020-06-24 00:04:36 +02:00
2020-03-17 19:29:12 +01:00
2020-05-14 21:21:57 -07:00
2020-04-15 13:26:08 +02:00
2020-05-09 00:48:20 +02:00
2020-07-16 17:00:32 +02:00
2020-06-09 11:36:19 -07:00
2020-04-08 01:35:24 +02:00
2020-08-01 20:38:28 -07:00
2020-05-09 00:48:20 +02:00
2019-12-13 13:09:32 -08:00
2020-05-09 00:48:20 +02:00