diff options
Diffstat (limited to 'fs/proc')
-rw-r--r-- | fs/proc/kcore.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c index 80464432dfe6..ad72261ee3fe 100644 --- a/fs/proc/kcore.c +++ b/fs/proc/kcore.c @@ -359,8 +359,11 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos) phdr->p_type = PT_LOAD; phdr->p_flags = PF_R | PF_W | PF_X; phdr->p_offset = kc_vaddr_to_offset(m->addr) + data_offset; - phdr->p_vaddr = (size_t)m->addr; - if (m->type == KCORE_RAM) + if (m->type == KCORE_REMAP) + phdr->p_vaddr = (size_t)m->vaddr; + else + phdr->p_vaddr = (size_t)m->addr; + if (m->type == KCORE_RAM || m->type == KCORE_REMAP) phdr->p_paddr = __pa(m->addr); else if (m->type == KCORE_TEXT) phdr->p_paddr = __pa_symbol(m->addr); |