aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorHATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>2013-07-03 18:02:21 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-03 19:07:30 -0400
commitef9e78fd2753213ea01d77f7a76a9cb6ad0f50a7 (patch)
tree176cc825df5908c17d21d63124367b555da6f557 /fs
parent087350c9dcf1b38c597b31d7761f7366e2866e6b (diff)
vmcore: allow user process to remap ELF note segment buffer
Now ELF note segment has been copied in the buffer on vmalloc memory. To allow user process to remap the ELF note segment buffer with remap_vmalloc_page, the corresponding VM area object has to have VM_USERMAP flag set. [akpm@linux-foundation.org: use the conventional comment layout] Signed-off-by: HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com> Acked-by: Vivek Goyal <vgoyal@redhat.com> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Cc: Atsushi Kumagai <kumagai-atsushi@mxc.nes.nec.co.jp> Cc: Lisa Mitchell <lisa.mitchell@hp.com> Cc: Zhang Yanfei <zhangyanfei@cn.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/proc/vmcore.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/fs/proc/vmcore.c b/fs/proc/vmcore.c
index 9b9270eb0599..1082492e02fc 100644
--- a/fs/proc/vmcore.c
+++ b/fs/proc/vmcore.c
@@ -369,6 +369,7 @@ static int __init merge_note_headers_elf64(char *elfptr, size_t *elfsz,
369 Elf64_Ehdr *ehdr_ptr; 369 Elf64_Ehdr *ehdr_ptr;
370 Elf64_Phdr phdr; 370 Elf64_Phdr phdr;
371 u64 phdr_sz = 0, note_off; 371 u64 phdr_sz = 0, note_off;
372 struct vm_struct *vm;
372 373
373 ehdr_ptr = (Elf64_Ehdr *)elfptr; 374 ehdr_ptr = (Elf64_Ehdr *)elfptr;
374 375
@@ -385,6 +386,14 @@ static int __init merge_note_headers_elf64(char *elfptr, size_t *elfsz,
385 if (!*notes_buf) 386 if (!*notes_buf)
386 return -ENOMEM; 387 return -ENOMEM;
387 388
389 /*
390 * Allow users to remap ELF note segment buffer on vmalloc memory using
391 * remap_vmalloc_range.()
392 */
393 vm = find_vm_area(*notes_buf);
394 BUG_ON(!vm);
395 vm->flags |= VM_USERMAP;
396
388 rc = copy_notes_elf64(ehdr_ptr, *notes_buf); 397 rc = copy_notes_elf64(ehdr_ptr, *notes_buf);
389 if (rc < 0) 398 if (rc < 0)
390 return rc; 399 return rc;
@@ -548,6 +557,7 @@ static int __init merge_note_headers_elf32(char *elfptr, size_t *elfsz,
548 Elf32_Ehdr *ehdr_ptr; 557 Elf32_Ehdr *ehdr_ptr;
549 Elf32_Phdr phdr; 558 Elf32_Phdr phdr;
550 u64 phdr_sz = 0, note_off; 559 u64 phdr_sz = 0, note_off;
560 struct vm_struct *vm;
551 561
552 ehdr_ptr = (Elf32_Ehdr *)elfptr; 562 ehdr_ptr = (Elf32_Ehdr *)elfptr;
553 563
@@ -564,6 +574,14 @@ static int __init merge_note_headers_elf32(char *elfptr, size_t *elfsz,
564 if (!*notes_buf) 574 if (!*notes_buf)
565 return -ENOMEM; 575 return -ENOMEM;
566 576
577 /*
578 * Allow users to remap ELF note segment buffer on vmalloc memory using
579 * remap_vmalloc_range()
580 */
581 vm = find_vm_area(*notes_buf);
582 BUG_ON(!vm);
583 vm->flags |= VM_USERMAP;
584
567 rc = copy_notes_elf32(ehdr_ptr, *notes_buf); 585 rc = copy_notes_elf32(ehdr_ptr, *notes_buf);
568 if (rc < 0) 586 if (rc < 0)
569 return rc; 587 return rc;