linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Cc: Sherry Yang <sherryy@android.com>, Michal Hocko <mhocko@suse.com>,
	srikar@linux.vnet.ibm.com, songliubraving@fb.com,
	peterz@infradead.org, mingo@redhat.com, acme@kernel.org,
	alexander.shishkin@linux.intel.com, jolsa@redhat.com,
	namhyung@kernel.org, linux-kernel@vger.kernel.org,
	aneesh.kumar@linux.ibm.com,
	syzbot+1068f09c44d151250c33@syzkaller.appspotmail.com
Subject: Re: [PATCH] Uprobes: Fix deadlock between delayed_uprobe_lock and fs_reclaim
Date: Tue, 26 Feb 2019 17:20:50 +0100	[thread overview]
Message-ID: <20190226162049.GB21443@redhat.com> (raw)
In-Reply-To: <611d2ba9-c14b-4580-a7ec-8bcf0013cd6b@linux.ibm.com>

On 02/26, Ravi Bangoria wrote:
>
> On 2/8/19 2:03 PM, Ravi Bangoria wrote:
> >
> >
> > On 2/6/19 7:06 PM, Oleg Nesterov wrote:
> >> Ravi, I am on vacation till the end of this week, can't read your patch
> >> carefully.
> >>
> >> I am not sure I fully understand the problem, but shouldn't we change
> >> binder_alloc_free_page() to use mmput_async() ? Like it does if trylock
> >> fails.
> >
> > I don't understand binderfs code much so I'll let Sherry comment on this.
>
> Sherry, Can you please comment on this.

Yes, please. I don't even know what android/binder does, but I think we need
the trivial patch below.

If nothing else, any reason why err_down_write_mmap_sem_failed needs _async
should equally apply to the case when down_write_trylock() succeeds, no?

And. This lockdep report basically means that (without this change) kmalloc
is not safe under any lock which can be taken in __mmput() path, I don't think
we should blame or change uprobes.c.

Oleg.

--- x/drivers/android/binder_alloc.c
+++ x/drivers/android/binder_alloc.c
@@ -981,7 +981,7 @@ enum lru_status binder_alloc_free_page(s
 		trace_binder_unmap_user_end(alloc, index);

 		up_write(&mm->mmap_sem);
-		mmput(mm);
+		mmput_async(mm);
 	}

 	trace_binder_unmap_kernel_start(alloc, index);


      reply	other threads:[~2019-02-26 16:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-04  4:06 [PATCH] Uprobes: Fix deadlock between delayed_uprobe_lock and fs_reclaim Ravi Bangoria
2019-02-06 13:36 ` Oleg Nesterov
2019-02-08  8:33   ` Ravi Bangoria
2019-02-26  3:53     ` Ravi Bangoria
2019-02-26 16:20       ` Oleg Nesterov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190226162049.GB21443@redhat.com \
    --to=oleg@redhat.com \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=aneesh.kumar@linux.ibm.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhocko@suse.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=ravi.bangoria@linux.ibm.com \
    --cc=sherryy@android.com \
    --cc=songliubraving@fb.com \
    --cc=srikar@linux.vnet.ibm.com \
    --cc=syzbot+1068f09c44d151250c33@syzkaller.appspotmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).