diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-21 16:36:41 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-21 16:36:41 -0400 |
commit | e2a0883e4071237d09b604a342c28b96b44a04b3 (patch) | |
tree | aa56f4d376b5eb1c32358c19c2669c2a94e0e1fd /arch/um/kernel | |
parent | 3a990a52f9f25f45469e272017a31e7a3fda60ed (diff) | |
parent | 07c0c5d8b8c122b2f2df9ee574ac3083daefc981 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs pile 1 from Al Viro:
"This is _not_ all; in particular, Miklos' and Jan's stuff is not there
yet."
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (64 commits)
ext4: initialization of ext4_li_mtx needs to be done earlier
debugfs-related mode_t whack-a-mole
hfsplus: add an ioctl to bless files
hfsplus: change finder_info to u32
hfsplus: initialise userflags
qnx4: new helper - try_extent()
qnx4: get rid of qnx4_bread/qnx4_getblk
take removal of PF_FORKNOEXEC to flush_old_exec()
trim includes in inode.c
um: uml_dup_mmap() relies on ->mmap_sem being held, but activate_mm() doesn't hold it
um: embed ->stub_pages[] into mmu_context
gadgetfs: list_for_each_safe() misuse
ocfs2: fix leaks on failure exits in module_init
ecryptfs: make register_filesystem() the last potential failure exit
ntfs: forgets to unregister sysctls on register_filesystem() failure
logfs: missing cleanup on register_filesystem() failure
jfs: mising cleanup on register_filesystem() failure
make configfs_pin_fs() return root dentry on success
configfs: configfs_create_dir() has parent dentry in dentry->d_parent
configfs: sanitize configfs_create()
...
Diffstat (limited to 'arch/um/kernel')
-rw-r--r-- | arch/um/kernel/skas/mmu.c | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/arch/um/kernel/skas/mmu.c b/arch/um/kernel/skas/mmu.c index 1aee587e9c5d..4947b319f53a 100644 --- a/arch/um/kernel/skas/mmu.c +++ b/arch/um/kernel/skas/mmu.c | |||
@@ -92,8 +92,6 @@ int init_new_context(struct task_struct *task, struct mm_struct *mm) | |||
92 | goto out_free; | 92 | goto out_free; |
93 | } | 93 | } |
94 | 94 | ||
95 | to_mm->stub_pages = NULL; | ||
96 | |||
97 | return 0; | 95 | return 0; |
98 | 96 | ||
99 | out_free: | 97 | out_free: |
@@ -103,7 +101,7 @@ int init_new_context(struct task_struct *task, struct mm_struct *mm) | |||
103 | return ret; | 101 | return ret; |
104 | } | 102 | } |
105 | 103 | ||
106 | void arch_dup_mmap(struct mm_struct *oldmm, struct mm_struct *mm) | 104 | void uml_setup_stubs(struct mm_struct *mm) |
107 | { | 105 | { |
108 | struct page **pages; | 106 | struct page **pages; |
109 | int err, ret; | 107 | int err, ret; |
@@ -120,29 +118,20 @@ void arch_dup_mmap(struct mm_struct *oldmm, struct mm_struct *mm) | |||
120 | if (ret) | 118 | if (ret) |
121 | goto out; | 119 | goto out; |
122 | 120 | ||
123 | pages = kmalloc(2 * sizeof(struct page *), GFP_KERNEL); | 121 | mm->context.stub_pages[0] = virt_to_page(&__syscall_stub_start); |
124 | if (pages == NULL) { | 122 | mm->context.stub_pages[1] = virt_to_page(mm->context.id.stack); |
125 | printk(KERN_ERR "arch_dup_mmap failed to allocate 2 page " | ||
126 | "pointers\n"); | ||
127 | goto out; | ||
128 | } | ||
129 | |||
130 | pages[0] = virt_to_page(&__syscall_stub_start); | ||
131 | pages[1] = virt_to_page(mm->context.id.stack); | ||
132 | mm->context.stub_pages = pages; | ||
133 | 123 | ||
134 | /* dup_mmap already holds mmap_sem */ | 124 | /* dup_mmap already holds mmap_sem */ |
135 | err = install_special_mapping(mm, STUB_START, STUB_END - STUB_START, | 125 | err = install_special_mapping(mm, STUB_START, STUB_END - STUB_START, |
136 | VM_READ | VM_MAYREAD | VM_EXEC | | 126 | VM_READ | VM_MAYREAD | VM_EXEC | |
137 | VM_MAYEXEC | VM_DONTCOPY, pages); | 127 | VM_MAYEXEC | VM_DONTCOPY, |
128 | mm->context.stub_pages); | ||
138 | if (err) { | 129 | if (err) { |
139 | printk(KERN_ERR "install_special_mapping returned %d\n", err); | 130 | printk(KERN_ERR "install_special_mapping returned %d\n", err); |
140 | goto out_free; | 131 | goto out; |
141 | } | 132 | } |
142 | return; | 133 | return; |
143 | 134 | ||
144 | out_free: | ||
145 | kfree(pages); | ||
146 | out: | 135 | out: |
147 | force_sigsegv(SIGSEGV, current); | 136 | force_sigsegv(SIGSEGV, current); |
148 | } | 137 | } |
@@ -151,8 +140,6 @@ void arch_exit_mmap(struct mm_struct *mm) | |||
151 | { | 140 | { |
152 | pte_t *pte; | 141 | pte_t *pte; |
153 | 142 | ||
154 | if (mm->context.stub_pages != NULL) | ||
155 | kfree(mm->context.stub_pages); | ||
156 | pte = virt_to_pte(mm, STUB_CODE); | 143 | pte = virt_to_pte(mm, STUB_CODE); |
157 | if (pte != NULL) | 144 | if (pte != NULL) |
158 | pte_clear(mm, STUB_CODE, pte); | 145 | pte_clear(mm, STUB_CODE, pte); |