diff options
Diffstat (limited to 'fs/binfmt_elf.c')
-rw-r--r-- | fs/binfmt_elf.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index 6cb4efbae885..b25707fee2cc 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c | |||
@@ -1722,26 +1722,25 @@ static int fill_note_info(struct elfhdr *elf, int phdrs, | |||
1722 | 1722 | ||
1723 | info->thread_status_size = 0; | 1723 | info->thread_status_size = 0; |
1724 | if (signr) { | 1724 | if (signr) { |
1725 | struct elf_thread_status *tmp; | 1725 | struct elf_thread_status *ets; |
1726 | rcu_read_lock(); | 1726 | rcu_read_lock(); |
1727 | do_each_thread(g, p) | 1727 | do_each_thread(g, p) |
1728 | if (current->mm == p->mm && current != p) { | 1728 | if (current->mm == p->mm && current != p) { |
1729 | tmp = kzalloc(sizeof(*tmp), GFP_ATOMIC); | 1729 | ets = kzalloc(sizeof(*ets), GFP_ATOMIC); |
1730 | if (!tmp) { | 1730 | if (!ets) { |
1731 | rcu_read_unlock(); | 1731 | rcu_read_unlock(); |
1732 | return 0; | 1732 | return 0; |
1733 | } | 1733 | } |
1734 | tmp->thread = p; | 1734 | ets->thread = p; |
1735 | list_add(&tmp->list, &info->thread_list); | 1735 | list_add(&ets->list, &info->thread_list); |
1736 | } | 1736 | } |
1737 | while_each_thread(g, p); | 1737 | while_each_thread(g, p); |
1738 | rcu_read_unlock(); | 1738 | rcu_read_unlock(); |
1739 | list_for_each(t, &info->thread_list) { | 1739 | list_for_each(t, &info->thread_list) { |
1740 | struct elf_thread_status *tmp; | ||
1741 | int sz; | 1740 | int sz; |
1742 | 1741 | ||
1743 | tmp = list_entry(t, struct elf_thread_status, list); | 1742 | ets = list_entry(t, struct elf_thread_status, list); |
1744 | sz = elf_dump_thread_status(signr, tmp); | 1743 | sz = elf_dump_thread_status(signr, ets); |
1745 | info->thread_status_size += sz; | 1744 | info->thread_status_size += sz; |
1746 | } | 1745 | } |
1747 | } | 1746 | } |
@@ -1997,10 +1996,10 @@ static int elf_core_dump(long signr, struct pt_regs *regs, struct file *file, un | |||
1997 | 1996 | ||
1998 | for (addr = vma->vm_start; addr < end; addr += PAGE_SIZE) { | 1997 | for (addr = vma->vm_start; addr < end; addr += PAGE_SIZE) { |
1999 | struct page *page; | 1998 | struct page *page; |
2000 | struct vm_area_struct *vma; | 1999 | struct vm_area_struct *tmp_vma; |
2001 | 2000 | ||
2002 | if (get_user_pages(current, current->mm, addr, 1, 0, 1, | 2001 | if (get_user_pages(current, current->mm, addr, 1, 0, 1, |
2003 | &page, &vma) <= 0) { | 2002 | &page, &tmp_vma) <= 0) { |
2004 | DUMP_SEEK(PAGE_SIZE); | 2003 | DUMP_SEEK(PAGE_SIZE); |
2005 | } else { | 2004 | } else { |
2006 | if (page == ZERO_PAGE(0)) { | 2005 | if (page == ZERO_PAGE(0)) { |
@@ -2010,7 +2009,7 @@ static int elf_core_dump(long signr, struct pt_regs *regs, struct file *file, un | |||
2010 | } | 2009 | } |
2011 | } else { | 2010 | } else { |
2012 | void *kaddr; | 2011 | void *kaddr; |
2013 | flush_cache_page(vma, addr, | 2012 | flush_cache_page(tmp_vma, addr, |
2014 | page_to_pfn(page)); | 2013 | page_to_pfn(page)); |
2015 | kaddr = kmap(page); | 2014 | kaddr = kmap(page); |
2016 | if ((size += PAGE_SIZE) > limit || | 2015 | if ((size += PAGE_SIZE) > limit || |