Commit 20c9ccf
perf maps: Ensure kmap is set up for all inserts
__maps__fixup_overlap_and_insert may split or directly insert a map,
when doing this the map may need to have a kmap set up for the sake of
the kmaps. The missing kmap set up fails the check_invariants test in
maps, later "Internal error" reports from map__kmap and ultimately
causes segfaults.
Similar fixes were added in commit e0e4e0b ("perf maps: Add
missing map__set_kmap_maps() when replacing a kernel map") and commit
25d9c03 ("perf maps: Set the kmaps for newly created/added kernel
maps") but they missed cases. To try to reduce the risk of this,
update the kmap directly following any manual insert. This identified
another problem in maps__copy_from.
Fixes: e0e4e0b ("perf maps: Add missing map__set_kmap_maps() when replacing a kernel map")
Fixes: 25d9c03 ("perf maps: Set the kmaps for newly created/added kernel maps")
Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>1 parent 7947ad1 commit 20c9ccf
1 file changed
+5
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
477 | 477 | | |
478 | 478 | | |
479 | 479 | | |
| 480 | + | |
480 | 481 | | |
481 | 482 | | |
482 | 483 | | |
| |||
502 | 503 | | |
503 | 504 | | |
504 | 505 | | |
505 | | - | |
506 | | - | |
507 | 506 | | |
508 | 507 | | |
509 | 508 | | |
| |||
891 | 890 | | |
892 | 891 | | |
893 | 892 | | |
| 893 | + | |
894 | 894 | | |
895 | 895 | | |
896 | 896 | | |
| |||
918 | 918 | | |
919 | 919 | | |
920 | 920 | | |
| 921 | + | |
921 | 922 | | |
922 | 923 | | |
923 | 924 | | |
| |||
942 | 943 | | |
943 | 944 | | |
944 | 945 | | |
| 946 | + | |
945 | 947 | | |
946 | 948 | | |
947 | 949 | | |
948 | 950 | | |
949 | 951 | | |
950 | 952 | | |
951 | | - | |
952 | | - | |
953 | 953 | | |
954 | 954 | | |
955 | 955 | | |
| |||
1019 | 1019 | | |
1020 | 1020 | | |
1021 | 1021 | | |
| 1022 | + | |
1022 | 1023 | | |
1023 | 1024 | | |
1024 | 1025 | | |
| |||
0 commit comments