Commit c4aad69c authored by David S. Miller's avatar David S. Miller

[ELF] Enter KERNEL_DS after fill_psinfo, which does user acceses.

parent 228f1539
...@@ -1218,16 +1218,9 @@ static int elf_core_dump(long signr, struct pt_regs * regs, struct file * file) ...@@ -1218,16 +1218,9 @@ static int elf_core_dump(long signr, struct pt_regs * regs, struct file * file)
/* Set up header */ /* Set up header */
fill_elf_header(&elf, segs+1); /* including notes section*/ fill_elf_header(&elf, segs+1); /* including notes section*/
fs = get_fs();
set_fs(KERNEL_DS);
has_dumped = 1; has_dumped = 1;
current->flags |= PF_DUMPCORE; current->flags |= PF_DUMPCORE;
DUMP_WRITE(&elf, sizeof(elf));
offset += sizeof(elf); /* Elf header */
offset += (segs+1) * sizeof(struct elf_phdr); /* Program headers */
/* /*
* Set up the notes in similar form to SVR4 core dumps made * Set up the notes in similar form to SVR4 core dumps made
* with info from their /proc. * with info from their /proc.
...@@ -1254,6 +1247,13 @@ static int elf_core_dump(long signr, struct pt_regs * regs, struct file * file) ...@@ -1254,6 +1247,13 @@ static int elf_core_dump(long signr, struct pt_regs * regs, struct file * file)
numnote --; numnote --;
#endif #endif
fs = get_fs();
set_fs(KERNEL_DS);
DUMP_WRITE(&elf, sizeof(elf));
offset += sizeof(elf); /* Elf header */
offset += (segs+1) * sizeof(struct elf_phdr); /* Program headers */
/* Write notes phdr entry */ /* Write notes phdr entry */
{ {
struct elf_phdr phdr; struct elf_phdr phdr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment