Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp899338yba; Thu, 9 May 2019 07:39:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqzDCigFztemQ/F3CPnww/lqSx0NFSmweuLNehmI2dc7SbBpRLVnQMb5AkzHTuw9YdjDJ5L3 X-Received: by 2002:a63:8342:: with SMTP id h63mr6110044pge.251.1557412768708; Thu, 09 May 2019 07:39:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557412768; cv=none; d=google.com; s=arc-20160816; b=HR5+1g6P+4l3mtIGbUDhtX1VIk2ZqlSyxiiUOLGhXg2Uy9Bp5ec+G0g6gvvP65pXHA RbsYHJ0X7DfecieX9VqYEBruCMFWUJNhdpdwqjMmmQhYENCMCcyShJKUE+oiARX+qt/0 UXVweYkzm2+EBQf7xxRBxZWQR3b6rqcMmuVIagfMmoSTfjzfAi30APehXuy72Thlotgo YTF6qUApUIYHpdSwmI41b6DyvyUobYt2MHj6kiN63dVIQXXdUCwh2O3tmAuGx3H/Rb+Z U9m4/VyXQZbhpWUz869jmMr5CVVAklW+t9QOSAk9Y3bL7oOG6FhdbUUIQLLu8dIAtwSv 9RCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature:dkim-signature; bh=5uXhtXTSwwicThmXcxC9Rm/hIkMbo5d/o+yTYjgcpQ0=; b=FsMK+OsEcQ+1oApjSKn7FJjOlYykYZQezKRjDr6Y2S0ko4htS230imAGSsFeq8VVRg lFDsJ15M5ARepIoFW3Gy6s1DPR8JQ7/HzP+9/0LbdlZ9Doo3aI33cbkUIhs3E4f5aF3F OnwGsmHHXxJhgqjlxK/2E33qAr+KACvZi/UzFOa+GqkC5IYaDc9tNSOhpbyo0hK8xGBu UtX9N+lUmk6Hdp0tTOCRuNsXnafg0Zvg2dw0boYcyOPgNwrO6VfZOhUa25bS4wODZ4rs ldj7uuJDYcI9nRvGQIAg2deR6WRpmOz6fYSXHxpaOoP+t/dBxH90XzcTKtnOP37z3JCi ZGzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=EJX8j9Ri; dkim=pass header.i=@codeaurora.org header.s=default header.b=KVLMA6xn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d30si3167159pla.105.2019.05.09.07.39.11; Thu, 09 May 2019 07:39:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=EJX8j9Ri; dkim=pass header.i=@codeaurora.org header.s=default header.b=KVLMA6xn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726631AbfEIOiV (ORCPT + 99 others); Thu, 9 May 2019 10:38:21 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:56980 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726187AbfEIOiV (ORCPT ); Thu, 9 May 2019 10:38:21 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id BD3A960779; Thu, 9 May 2019 14:38:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1557412699; bh=m/9MIbexuBdPxCFPr6oX4nJ8E4mDFLipijNpmR33xf0=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=EJX8j9RinsUzb5V1hvPYqVOPERp2yIR1uT/0HBSVR0Q+O6CI0LwmKwYLq0rKQ4ies zGVXpsPJRiso66Ua8hTfNohOiDKOVE8jhxX3gZ3wJ3mbNjHr2fSOS1Zb7OUpvuUkBI Xt2uYLXIwmn05nTC5BwCkI2TIq8o8q0yazTOrfbQ= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_INVALID,DKIM_SIGNED autolearn=no autolearn_force=no version=3.4.0 Received: from [10.204.78.109] (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: gkohli@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 9491D6016D; Thu, 9 May 2019 14:38:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1557412698; bh=m/9MIbexuBdPxCFPr6oX4nJ8E4mDFLipijNpmR33xf0=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=KVLMA6xnVzPYMMB8pD2qrzzyV4Ipd559Wuq/B/1f73knIZWmE0yQ3DBOJxGoFNIz8 PcGr67buW45zYJd+Hi9O/tZuj7J0sKHqYyxJxSxSZgaXyJl25MdQLz0eLBFB6kqPO0 hUp/EkRKZzI8FDXFHswA4oppfmczHonEPG+nM4tc= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 9491D6016D Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=gkohli@codeaurora.org Subject: Re: [PATCH] driver core: Fix use-after-free and double free on glue directory To: Greg KH , Muchun Song Cc: rafael@kernel.org, Benjamin Herrenschmidt , linux-kernel , zhaowuyun@wingtech.com, linux-arm-msm@vger.kernel.org References: <20190423143258.96706-1-smuchun@gmail.com> <24b0fff3775147c04b006282727d94fea7f408b4.camel@kernel.crashing.org> <79fbc203bc9fa09d88ab2c4bff8635be4c293d49.camel@kernel.crashing.org> <20190504153440.GB19654@kroah.com> From: Gaurav Kohli Message-ID: Date: Thu, 9 May 2019 20:08:02 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190504153440.GB19654@kroah.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi , Last patch will serialize the addition of child to parent directory, won't it affect performance. Regards Gaurav On 5/4/2019 9:04 PM, Greg KH wrote: > On Sat, May 04, 2019 at 10:47:07PM +0800, Muchun Song wrote: >> Benjamin Herrenschmidt 于2019年5月2日周四 下午2:25写道: >> >>>>> The basic idea yes, the whole bool *locked is horrid though. >>>>> Wouldn't it >>>>> work to have a get_device_parent_locked that always returns with >>>>> the mutex held, >>>>> or just move the mutex to the caller or something simpler like this >>>>> ? >>>>> >>>> >>>> Greg and Rafael, do you have any suggestions for this? Or you also >>>> agree with Ben? >>> >>> Ping guys ? This is worth fixing... >> >> I also agree with you. But Greg and Rafael seem to be high latency right now. > > It's in my list of patches to get to, sorry, hopefully will dig out of > that next week with the buffer that the merge window provides me. > > thanks, > > greg k-h > -- Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.