Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1689011

Re: [PATCH] binder: Drop needless locking in binder_mmap()

From Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Newsgroups linux.kernel
Subject Re: [PATCH] binder: Drop needless locking in binder_mmap()
Date 2017-07-17 15:00 +0200
Message-ID <u4dN0-57W-29@gated-at.bofh.it> (permalink)
References <u4dN0-57W-31@gated-at.bofh.it> <u4dN0-57W-33@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Jun 19, 2017 at 05:53:34PM +0300, Dmitry Safonov wrote:
> On 05/24/2017 05:51 PM, Dmitry Safonov wrote:
> > binder_mmap() protected proc->buffer from concurrent changes.
> > It was introduced with commit bd1eff9741af ("Staging: android: binder:
> > Fix crashes when sharing a binder file between processes").
> > 
> > The commit fixed such races alike:
> > 
> > task1
> > =====
> > fd = open("/dev/binder",..)
> > fork()
> > ---------------------------------------->task2
> >    |                                      =====
> > mmap(fd)				mmap(fd)
> > 
> > Afterwards the situation was changed with the commit a79f41ed9786
> > ("binder: don't allow mmap() by process other than proc->tsk").
> > That commit prohibited mmap'ing of fd, that was opened by some
> > other task.
> > That restriction has made locking in binder_mmap() unnecessary.
> > 
> > Cc: Al Viro <viro@zeniv.linux.org.uk>
> > Cc: "Arve Hjønnevåg" <arve@android.com>
> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > Cc: Riley Andrews <riandrews@android.com>
> > Cc: devel@driverdev.osuosl.org
> > Cc: Android Kernel Team <kernel-team@android.com>
> > Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
> > ---
> >   drivers/android/binder.c | 5 -----
> >   1 file changed, 5 deletions(-)
> 
> Ping?

The "break up the binder lock" patches should have now made this
obsolete, right?  If not, can you please rebase it on my
char-misc-testing tree and resend?

thanks,

greg k-h

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [PATCH] binder: Drop needless locking in binder_mmap() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-17 15:00 +0200

csiph-web