diff options
Diffstat (limited to 'mm/util.c')
-rw-r--r-- | mm/util.c | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -230,8 +230,10 @@ void __vma_link_list(struct mm_struct *mm, struct vm_area_struct *vma, | |||
230 | } | 230 | } |
231 | 231 | ||
232 | /* Check if the vma is being used as a stack by this task */ | 232 | /* Check if the vma is being used as a stack by this task */ |
233 | int vma_is_stack_for_task(struct vm_area_struct *vma, struct task_struct *t) | 233 | int vma_is_stack_for_current(struct vm_area_struct *vma) |
234 | { | 234 | { |
235 | struct task_struct * __maybe_unused t = current; | ||
236 | |||
235 | return (vma->vm_start <= KSTK_ESP(t) && vma->vm_end >= KSTK_ESP(t)); | 237 | return (vma->vm_start <= KSTK_ESP(t) && vma->vm_end >= KSTK_ESP(t)); |
236 | } | 238 | } |
237 | 239 | ||
@@ -283,7 +285,8 @@ EXPORT_SYMBOL_GPL(__get_user_pages_fast); | |||
283 | int __weak get_user_pages_fast(unsigned long start, | 285 | int __weak get_user_pages_fast(unsigned long start, |
284 | int nr_pages, int write, struct page **pages) | 286 | int nr_pages, int write, struct page **pages) |
285 | { | 287 | { |
286 | return get_user_pages_unlocked(start, nr_pages, write, 0, pages); | 288 | return get_user_pages_unlocked(start, nr_pages, pages, |
289 | write ? FOLL_WRITE : 0); | ||
287 | } | 290 | } |
288 | EXPORT_SYMBOL_GPL(get_user_pages_fast); | 291 | EXPORT_SYMBOL_GPL(get_user_pages_fast); |
289 | 292 | ||
@@ -623,7 +626,7 @@ int get_cmdline(struct task_struct *task, char *buffer, int buflen) | |||
623 | if (len > buflen) | 626 | if (len > buflen) |
624 | len = buflen; | 627 | len = buflen; |
625 | 628 | ||
626 | res = access_process_vm(task, arg_start, buffer, len, 0); | 629 | res = access_process_vm(task, arg_start, buffer, len, FOLL_FORCE); |
627 | 630 | ||
628 | /* | 631 | /* |
629 | * If the nul at the end of args has been overwritten, then | 632 | * 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) | |||
638 | if (len > buflen - res) | 641 | if (len > buflen - res) |
639 | len = buflen - res; | 642 | len = buflen - res; |
640 | res += access_process_vm(task, env_start, | 643 | res += access_process_vm(task, env_start, |
641 | buffer+res, len, 0); | 644 | buffer+res, len, |
645 | FOLL_FORCE); | ||
642 | res = strnlen(buffer, res); | 646 | res = strnlen(buffer, res); |
643 | } | 647 | } |
644 | } | 648 | } |