As Naresh reported, test_stacktrace_build_id() causes panic on i386 and arm32 systems. This is caused by page_address() returns NULL in certain cases. This patch fixes this error by using kmap_atomic/kunmap_atomic instead of page_address.
Unified · Split
| @@ -260,7 +260,7 @@ static int stack_map_get_build_id(struct vm_area_struct *vma, · 259 unmodified lines | ||
| 260 | 260 | return -EFAULT; /* page not mapped */ |
| 261 | 261 | |
| 262 | 262 | ret = -EINVAL; |
| 263 | − page_addr = page_address(page); | |
| 263 | + page_addr = kmap_atomic(page); | |
| 264 | 264 | ehdr = (Elf32_Ehdr *)page_addr; |
| 265 | 265 | |
| 266 | 266 | /* compare magic x7f "ELF" */ |
| @@ -276,6 +276,7 @@ static int stack_map_get_build_id(struct vm_area_struct *vma, · 9 unmodified lines | ||
| 276 | 276 | else if (ehdr->e_ident[EI_CLASS] == ELFCLASS64) |
| 277 | 277 | ret = stack_map_get_build_id_64(page_addr, build_id); |
| 278 | 278 | out: |
| 279 | + kunmap_atomic(page_addr); | |
| 279 | 280 | put_page(page); |
| 280 | 281 | return ret; |
| 281 | 282 | } |