A subsequent fix for arm64 will use this parameter to parse the vma information from the snapshot created by dump_vma_snapshot() rather than traversing the vma list without the mmap_lock.
Unified · Split
| @@ -76,7 +76,7 @@ static int mte_dump_tag_range(struct coredump_params *cprm, · 75 unmodified lines | ||
| 76 | 76 | return ret; |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | −Elf_Half elf_core_extra_phdrs(void) | |
| 79 | +Elf_Half elf_core_extra_phdrs(struct coredump_params *cprm) | |
| 80 | 80 | { |
| 81 | 81 | struct vm_area_struct *vma; |
| 82 | 82 | int vma_count = 0; |
| @@ -113,7 +113,7 @@ int elf_core_write_extra_phdrs(struct coredump_params *cprm, loff_t offset) · 30 unmodified lines | ||
| 113 | 113 | return 1; |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | −size_t elf_core_extra_data_size(void) | |
| 116 | +size_t elf_core_extra_data_size(struct coredump_params *cprm) | |
| 117 | 117 | { |
| 118 | 118 | struct vm_area_struct *vma; |
| 119 | 119 | size_t data_size = 0; |
| @@ -7,7 +7,7 @@ · 6 unmodified lines | ||
| 7 | 7 | #include <asm/elf.h> |
| 8 | 8 | |
| 9 | 9 | |
| 10 | −Elf64_Half elf_core_extra_phdrs(void) | |
| 10 | +Elf64_Half elf_core_extra_phdrs(struct coredump_params *cprm) | |
| 11 | 11 | { |
| 12 | 12 | return GATE_EHDR->e_phnum; |
| 13 | 13 | } |
| @@ -60,7 +60,7 @@ int elf_core_write_extra_data(struct coredump_params *cprm) · 46 unmodified lines | ||
| 60 | 60 | return 1; |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | −size_t elf_core_extra_data_size(void) | |
| 63 | +size_t elf_core_extra_data_size(struct coredump_params *cprm) | |
| 64 | 64 | { |
| 65 | 65 | const struct elf_phdr *const gate_phdrs = |
| 66 | 66 | (const struct elf_phdr *) (GATE_ADDR + GATE_EHDR->e_phoff); |
| @@ -7,7 +7,7 @@ · 6 unmodified lines | ||
| 7 | 7 | #include <asm/elf.h> |
| 8 | 8 | |
| 9 | 9 | |
| 10 | −Elf32_Half elf_core_extra_phdrs(void) | |
| 10 | +Elf32_Half elf_core_extra_phdrs(struct coredump_params *cprm) | |
| 11 | 11 | { |
| 12 | 12 | return vsyscall_ehdr ? (((struct elfhdr *)vsyscall_ehdr)->e_phnum) : 0; |
| 13 | 13 | } |
| @@ -60,7 +60,7 @@ int elf_core_write_extra_data(struct coredump_params *cprm) · 46 unmodified lines | ||
| 60 | 60 | return 1; |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | −size_t elf_core_extra_data_size(void) | |
| 63 | +size_t elf_core_extra_data_size(struct coredump_params *cprm) | |
| 64 | 64 | { |
| 65 | 65 | if ( vsyscall_ehdr ) { |
| 66 | 66 | const struct elfhdr *const ehdrp = |
| @@ -2034,7 +2034,7 @@ static int elf_core_dump(struct coredump_params *cprm) · 2033 unmodified lines | ||
| 2034 | 2034 | * The number of segs are recored into ELF header as 16bit value. |
| 2035 | 2035 | * Please check DEFAULT_MAX_MAP_COUNT definition when you modify here. |
| 2036 | 2036 | */ |
| 2037 | − segs = cprm->vma_count + elf_core_extra_phdrs(); | |
| 2037 | + segs = cprm->vma_count + elf_core_extra_phdrs(cprm); | |
| 2038 | 2038 | |
| 2039 | 2039 | /* for notes section */ |
| 2040 | 2040 | segs++; |
| @@ -2074,7 +2074,7 @@ static int elf_core_dump(struct coredump_params *cprm) · 33 unmodified lines | ||
| 2074 | 2074 | dataoff = offset = roundup(offset, ELF_EXEC_PAGESIZE); |
| 2075 | 2075 | |
| 2076 | 2076 | offset += cprm->vma_data_size; |
| 2077 | − offset += elf_core_extra_data_size(); | |
| 2077 | + offset += elf_core_extra_data_size(cprm); | |
| 2078 | 2078 | e_shoff = offset; |
| 2079 | 2079 | |
| 2080 | 2080 | if (e_phnum == PN_XNUM) { |
| @@ -1509,7 +1509,7 @@ static int elf_fdpic_core_dump(struct coredump_params *cprm) · 1508 unmodified lines | ||
| 1509 | 1509 | tmp->next = thread_list; |
| 1510 | 1510 | thread_list = tmp; |
| 1511 | 1511 | |
| 1512 | − segs = cprm->vma_count + elf_core_extra_phdrs(); | |
| 1512 | + segs = cprm->vma_count + elf_core_extra_phdrs(cprm); | |
| 1513 | 1513 | |
| 1514 | 1514 | /* for notes section */ |
| 1515 | 1515 | segs++; |
| @@ -1555,7 +1555,7 @@ static int elf_fdpic_core_dump(struct coredump_params *cprm) · 39 unmodified lines | ||
| 1555 | 1555 | dataoff = offset = roundup(offset, ELF_EXEC_PAGESIZE); |
| 1556 | 1556 | |
| 1557 | 1557 | offset += cprm->vma_data_size; |
| 1558 | − offset += elf_core_extra_data_size(); | |
| 1558 | + offset += elf_core_extra_data_size(cprm); | |
| 1559 | 1559 | e_shoff = offset; |
| 1560 | 1560 | |
| 1561 | 1561 | if (e_phnum == PN_XNUM) { |
| @@ -105,14 +105,14 @@ int elf_core_copy_task_fpregs(struct task_struct *t, elf_fpregset_t *fpu); · 104 unmodified lines | ||
| 105 | 105 | * Dumping its extra ELF program headers includes all the other information |
| 106 | 106 | * a debugger needs to easily find how the gate DSO was being used. |
| 107 | 107 | */ |
| 108 | −extern Elf_Half elf_core_extra_phdrs(void); | |
| 108 | +extern Elf_Half elf_core_extra_phdrs(struct coredump_params *cprm); | |
| 109 | 109 | extern int |
| 110 | 110 | elf_core_write_extra_phdrs(struct coredump_params *cprm, loff_t offset); |
| 111 | 111 | extern int |
| 112 | 112 | elf_core_write_extra_data(struct coredump_params *cprm); |
| 113 | −extern size_t elf_core_extra_data_size(void); | |
| 113 | +extern size_t elf_core_extra_data_size(struct coredump_params *cprm); | |
| 114 | 114 | #else |
| 115 | −static inline Elf_Half elf_core_extra_phdrs(void) | |
| 115 | +static inline Elf_Half elf_core_extra_phdrs(struct coredump_params *cprm) | |
| 116 | 116 | { |
| 117 | 117 | return 0; |
| 118 | 118 | } |
| @@ -127,7 +127,7 @@ static inline int elf_core_write_extra_data(struct coredump_params *cprm) · 8 unmodified lines | ||
| 127 | 127 | return 1; |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | −static inline size_t elf_core_extra_data_size(void) | |
| 130 | +static inline size_t elf_core_extra_data_size(struct coredump_params *cprm) | |
| 131 | 131 | { |
| 132 | 132 | return 0; |
| 133 | 133 | } |