diff options
author | 2017-01-24 09:57:18 -0800 | |
---|---|---|
committer | 2017-01-24 09:57:18 -0800 | |
commit | 62ed8ceda1699acae01b666497f004bfd3d67a6f (patch) | |
tree | fe38c83c49dfd568b540666948ef78cb9d082c38 /mm/util.c | |
parent | Input: elants_i2c - avoid divide by 0 errors on bad touchscreen data (diff) | |
parent | Linux 4.10-rc5 (diff) | |
download | wireguard-linux-62ed8ceda1699acae01b666497f004bfd3d67a6f.tar.xz wireguard-linux-62ed8ceda1699acae01b666497f004bfd3d67a6f.zip |
Merge tag 'v4.10-rc5' into for-linus
Sync up with mainline to apply fixup to a commit that came through
power supply tree.
Diffstat (limited to '')
-rw-r--r-- | mm/util.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/mm/util.c b/mm/util.c index 662cddf914af..3cb2164f4099 100644 --- a/mm/util.c +++ b/mm/util.c @@ -13,7 +13,7 @@ #include <linux/vmalloc.h> #include <asm/sections.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include "internal.h" @@ -230,8 +230,10 @@ void __vma_link_list(struct mm_struct *mm, struct vm_area_struct *vma, } /* Check if the vma is being used as a stack by this task */ -int vma_is_stack_for_task(struct vm_area_struct *vma, struct task_struct *t) +int vma_is_stack_for_current(struct vm_area_struct *vma) { + struct task_struct * __maybe_unused t = current; + return (vma->vm_start <= KSTK_ESP(t) && vma->vm_end >= KSTK_ESP(t)); } @@ -283,7 +285,8 @@ EXPORT_SYMBOL_GPL(__get_user_pages_fast); int __weak get_user_pages_fast(unsigned long start, int nr_pages, int write, struct page **pages) { - return get_user_pages_unlocked(start, nr_pages, write, 0, pages); + return get_user_pages_unlocked(start, nr_pages, pages, + write ? FOLL_WRITE : 0); } EXPORT_SYMBOL_GPL(get_user_pages_fast); @@ -623,7 +626,7 @@ int get_cmdline(struct task_struct *task, char *buffer, int buflen) if (len > buflen) len = buflen; - res = access_process_vm(task, arg_start, buffer, len, 0); + res = access_process_vm(task, arg_start, buffer, len, FOLL_FORCE); /* * If the nul at the end of args has been overwritten, then @@ -638,7 +641,8 @@ int get_cmdline(struct task_struct *task, char *buffer, int buflen) if (len > buflen - res) len = buflen - res; res += access_process_vm(task, env_start, - buffer+res, len, 0); + buffer+res, len, + FOLL_FORCE); res = strnlen(buffer, res); } } |