Re: [PATCH] mm: use down_read_killable for locking mmap_sem in access_remote_vm

2019-05-17 Thread Michal Hocko
On Wed 15-05-19 11:21:18, Konstantin Khlebnikov wrote: > This function is used by ptrace and proc files like /proc/pid/cmdline and > /proc/pid/environ. Return 0 (bytes read) if current task is killed. Please add an explanation about why this is OK (as explained in the follow up email). > Mmap_sem

Re: [PATCH] mm: use down_read_killable for locking mmap_sem in access_remote_vm

2019-05-15 Thread Oleg Nesterov
> @@ -4348,7 +4348,9 @@ int __access_remote_vm(struct task_struct *tsk, struct > mm_struct *mm, > void *old_buf = buf; > int write = gup_flags & FOLL_WRITE; > > - down_read(&mm->mmap_sem); > + if (down_read_killable(&mm->mmap_sem)) > + return 0; > + I too think t