From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757653AbcASI4z (ORCPT ); Tue, 19 Jan 2016 03:56:55 -0500 Received: from szxga03-in.huawei.com ([119.145.14.66]:31101 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757385AbcASI4x (ORCPT ); Tue, 19 Jan 2016 03:56:53 -0500 Subject: Re: [PATCH RESEND] android: binder: Sanity check at binder ioctl To: Greg KH References: <1453175136-3351-1-git-send-email-puck.chen@hisilicon.com> <20160119073358.GA30483@kroah.com> <569DEA87.1020905@hisilicon.com> <20160119083512.GA28218@kroah.com> CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , From: chenfeng Message-ID: <569DFA29.9040008@hisilicon.com> Date: Tue, 19 Jan 2016 16:56:09 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <20160119083512.GA28218@kroah.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.142.192.172] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020204.569DFA52.0067,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 6b638b64a2c03774590a6b305b02ecb8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2016/1/19 16:35, Greg KH wrote: > On Tue, Jan 19, 2016 at 03:49:27PM +0800, chenfeng wrote: >> >> >> On 2016/1/19 15:33, Greg KH wrote: >>> On Tue, Jan 19, 2016 at 11:45:36AM +0800, Chen Feng wrote: >>>> When a process fork a child process, we should not allow the >>>> child process use the binder which opened by parent process. >>>> >>>> But if the binder-object creater is a thread of one process who exit, >>>> the other thread can also use this binder-object normally. >>>> We can distinguish this by the member proc->tsk->mm. >>>> If the thread exit the tsk->mm will be NULL. >>>> >>>> proc->tsk->mm != current->mm && proc->tsk->mm >>>> >>>> So only allow the shared mm_struct to use the same binder-object and >>>> check the existence of mm_struct. >>>> >>>> Signed-off-by: Chen Feng >>>> Signed-off-by: Wei Dong >>>> Signed-off-by: Junmin Zhao >>>> Reviewed-by: Zhuangluan Su >>>> --- >>>> drivers/android/binder.c | 2 ++ >>>> 1 file changed, 2 insertions(+) >>> >>> Why resend? What changed from the previous version? >>> >> My fault, it's my error commit. >> mistake the current->mm with current->tsk->mm. >> The robot-compile finds out this error. > > Then please make it a 'v2' patch, and say what you changed, otherwise > I'll assume it's identical to the first patch you sent in. > > And how did you test the first patch if it couldn't even compile? > It works well on our platform with hundreds of mobile phone. Since our working branch is not mainline,and the patch is send for mainline review. I made a mistake while making the patch. I will send a new V2 for this patch. Thanks! > greg k-h > > . >