Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751412AbdGQMw0 (ORCPT ); Mon, 17 Jul 2017 08:52:26 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:49134 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751290AbdGQMwZ (ORCPT ); Mon, 17 Jul 2017 08:52:25 -0400 Date: Mon, 17 Jul 2017 14:52:19 +0200 From: Greg Kroah-Hartman To: Dmitry Safonov Cc: linux-kernel@vger.kernel.org, 0x7f454c46@gmail.com, Al Viro , Arve =?iso-8859-1?B?SGr4bm5lduVn?= , Riley Andrews , devel@driverdev.osuosl.org, Android Kernel Team Subject: Re: [PATCH] binder: Drop needless locking in binder_mmap() Message-ID: <20170717125219.GA20205@kroah.com> References: <20170524145151.21310-1-dsafonov@virtuozzo.com> <723538c0-bee9-cf15-7dd9-6ddaebdd6b4e@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <723538c0-bee9-cf15-7dd9-6ddaebdd6b4e@virtuozzo.com> User-Agent: Mutt/1.8.3 (2017-05-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1466 Lines: 42 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 > > Cc: "Arve Hj?nnev?g" > > Cc: Greg Kroah-Hartman > > Cc: Riley Andrews > > Cc: devel@driverdev.osuosl.org > > Cc: Android Kernel Team > > Signed-off-by: Dmitry Safonov > > --- > > 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