diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-11 19:06:54 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-11 19:06:54 -0400 |
commit | 00c3e276c54ca7e102f1b771715da76b4e86a098 (patch) | |
tree | 6563a263166bb5acf1945914e3770260dcc38d65 /kernel | |
parent | 605cd83694fa175894a1c63191f1f10c449b93a8 (diff) | |
parent | 29f6738609e40227dabcc63bfb3b84b3726a75bd (diff) |
Merge branch 'akpm' (Andrew's patch-bomb)
Merge random patches from Andrew Morton.
* Merge emailed patches from Andrew Morton <akpm@linux-foundation.org>: (32 commits)
memblock: free allocated memblock_reserved_regions later
mm: sparse: fix usemap allocation above node descriptor section
mm: sparse: fix section usemap placement calculation
xtensa: fix incorrect memset
shmem: cleanup shmem_add_to_page_cache
shmem: fix negative rss in memcg memory.stat
tmpfs: revert SEEK_DATA and SEEK_HOLE
drivers/rtc/rtc-twl.c: fix threaded IRQ to use IRQF_ONESHOT
fat: fix non-atomic NFS i_pos read
MAINTAINERS: add OMAP CPUfreq driver to OMAP Power Management section
sgi-xp: nested calls to spin_lock_irqsave()
fs: ramfs: file-nommu: add SetPageUptodate()
drivers/rtc/rtc-mxc.c: fix irq enabled interrupts warning
mm/memory_hotplug.c: release memory resources if hotadd_new_pgdat() fails
h8300/uaccess: add mising __clear_user()
h8300/uaccess: remove assignment to __gu_val in unhandled case of get_user()
h8300/time: add missing #include <asm/irq_regs.h>
h8300/signal: fix typo "statis"
h8300/pgtable: add missing #include <asm-generic/pgtable.h>
drivers/rtc/rtc-ab8500.c: ensure correct probing of the AB8500 RTC when Device Tree is enabled
...
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sys.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/kernel/sys.c b/kernel/sys.c index e0c8ffc50d7f..2d39a84cd857 100644 --- a/kernel/sys.c +++ b/kernel/sys.c | |||
@@ -1788,7 +1788,6 @@ SYSCALL_DEFINE1(umask, int, mask) | |||
1788 | #ifdef CONFIG_CHECKPOINT_RESTORE | 1788 | #ifdef CONFIG_CHECKPOINT_RESTORE |
1789 | static int prctl_set_mm_exe_file(struct mm_struct *mm, unsigned int fd) | 1789 | static int prctl_set_mm_exe_file(struct mm_struct *mm, unsigned int fd) |
1790 | { | 1790 | { |
1791 | struct vm_area_struct *vma; | ||
1792 | struct file *exe_file; | 1791 | struct file *exe_file; |
1793 | struct dentry *dentry; | 1792 | struct dentry *dentry; |
1794 | int err; | 1793 | int err; |
@@ -1816,13 +1815,17 @@ static int prctl_set_mm_exe_file(struct mm_struct *mm, unsigned int fd) | |||
1816 | down_write(&mm->mmap_sem); | 1815 | down_write(&mm->mmap_sem); |
1817 | 1816 | ||
1818 | /* | 1817 | /* |
1819 | * Forbid mm->exe_file change if there are mapped other files. | 1818 | * Forbid mm->exe_file change if old file still mapped. |
1820 | */ | 1819 | */ |
1821 | err = -EBUSY; | 1820 | err = -EBUSY; |
1822 | for (vma = mm->mmap; vma; vma = vma->vm_next) { | 1821 | if (mm->exe_file) { |
1823 | if (vma->vm_file && !path_equal(&vma->vm_file->f_path, | 1822 | struct vm_area_struct *vma; |
1824 | &exe_file->f_path)) | 1823 | |
1825 | goto exit_unlock; | 1824 | for (vma = mm->mmap; vma; vma = vma->vm_next) |
1825 | if (vma->vm_file && | ||
1826 | path_equal(&vma->vm_file->f_path, | ||
1827 | &mm->exe_file->f_path)) | ||
1828 | goto exit_unlock; | ||
1826 | } | 1829 | } |
1827 | 1830 | ||
1828 | /* | 1831 | /* |
@@ -1835,6 +1838,7 @@ static int prctl_set_mm_exe_file(struct mm_struct *mm, unsigned int fd) | |||
1835 | if (test_and_set_bit(MMF_EXE_FILE_CHANGED, &mm->flags)) | 1838 | if (test_and_set_bit(MMF_EXE_FILE_CHANGED, &mm->flags)) |
1836 | goto exit_unlock; | 1839 | goto exit_unlock; |
1837 | 1840 | ||
1841 | err = 0; | ||
1838 | set_mm_exe_file(mm, exe_file); | 1842 | set_mm_exe_file(mm, exe_file); |
1839 | exit_unlock: | 1843 | exit_unlock: |
1840 | up_write(&mm->mmap_sem); | 1844 | up_write(&mm->mmap_sem); |