提交 7696e0c3 编写于 作者: A Al Viro

binfmt_flat: use vm_munmap, we are missing ->mmap_sem there

Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
上级 5a5e4c2e
...@@ -562,7 +562,7 @@ static int load_flat_file(struct linux_binprm * bprm, ...@@ -562,7 +562,7 @@ static int load_flat_file(struct linux_binprm * bprm,
realdatastart = (unsigned long) -ENOMEM; realdatastart = (unsigned long) -ENOMEM;
printk("Unable to allocate RAM for process data, errno %d\n", printk("Unable to allocate RAM for process data, errno %d\n",
(int)-realdatastart); (int)-realdatastart);
do_munmap(current->mm, textpos, text_len); vm_munmap(textpos, text_len);
ret = realdatastart; ret = realdatastart;
goto err; goto err;
} }
...@@ -586,8 +586,8 @@ static int load_flat_file(struct linux_binprm * bprm, ...@@ -586,8 +586,8 @@ static int load_flat_file(struct linux_binprm * bprm,
} }
if (IS_ERR_VALUE(result)) { if (IS_ERR_VALUE(result)) {
printk("Unable to read data+bss, errno %d\n", (int)-result); printk("Unable to read data+bss, errno %d\n", (int)-result);
do_munmap(current->mm, textpos, text_len); vm_munmap(textpos, text_len);
do_munmap(current->mm, realdatastart, len); vm_munmap(realdatastart, len);
ret = result; ret = result;
goto err; goto err;
} }
...@@ -654,7 +654,7 @@ static int load_flat_file(struct linux_binprm * bprm, ...@@ -654,7 +654,7 @@ static int load_flat_file(struct linux_binprm * bprm,
} }
if (IS_ERR_VALUE(result)) { if (IS_ERR_VALUE(result)) {
printk("Unable to read code+data+bss, errno %d\n",(int)-result); printk("Unable to read code+data+bss, errno %d\n",(int)-result);
do_munmap(current->mm, textpos, text_len + data_len + extra + vm_munmap(textpos, text_len + data_len + extra +
MAX_SHARED_LIBS * sizeof(unsigned long)); MAX_SHARED_LIBS * sizeof(unsigned long));
ret = result; ret = result;
goto err; goto err;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册