Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp6882577yba; Wed, 1 May 2019 23:26:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqx4X5+3jfY1+q70VcaARdX6oD79rkctwAS7KuDOocTg/82EUcGt6oRXO46mb1B7/Drp61dj X-Received: by 2002:a63:191b:: with SMTP id z27mr2229456pgl.327.1556778411823; Wed, 01 May 2019 23:26:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556778411; cv=none; d=google.com; s=arc-20160816; b=Hq3n67y03ObEyw8Gb4D9V4K/SUMcvZmuxPcsMNLOuaoi8Dap7uX+qJ1nQOlK2ZMvjM lPAaYixeSmf2MeyiQ9FkXrYSx6YwmxtmjXgnppIEIBMZb8FzxlhPg8yZpGmefEI4iPBh Lrf6zxVSST5QGo3qMmmTVCXqgPdNt+9G1GDF7yuwcnOgOFB8wOAqLpY4n0AairyrvUEQ PGp6KwVo7OOotgt9AAl+yYk5l3A3/JJ3S2ttdREqJyA/brTAHikJp9rmRKCYRVxwCzig 2TI8IOV1BrY6U26jo/VU+GQBHcbC179jva51IQZp+Q30p2W1dXvMZcKIVYT/1TmDH9kq cJqQ== 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:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=PY9vYmK3JVABMZ2vIQYBdwx9EoiVIIRE+IOZ7yWoATQ=; b=nOAMR/PKnWFN5nQ3ZVop9n9H4RwxG5iHO4j1t8CL1IeCcOBTR3Zm9XwsZG/rH7VAw7 nqZE5ZF0kE/MwDGgpCX8hpHiDQrBfXYBYx7U77MrU+cJz5fCIX+mez0+G+owwjAB8wE+ 41KZRQLi+1rTFxQ+7giOFX4LfR20PLiKJ3NvYeZUyk9rGUWGXpgWMY1QwGlQrNg/JCfz nrlsZckPoN5HxqjNCZ48mU5maffVV1W0qsQgR3qgfvBvvKFvtySIR2uHqGp/zhAlFkH5 egfYgpRDEBhzoyrFk1qr85vKWZ9lLzRzvYWptujE8ugDr8R+2JxFS2yiW2OwsEOkw5Of MIUA== ARC-Authentication-Results: i=1; mx.google.com; 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 g18si5301982plo.267.2019.05.01.23.26.36; Wed, 01 May 2019 23:26:51 -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; 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 S1726283AbfEBGZk (ORCPT + 99 others); Thu, 2 May 2019 02:25:40 -0400 Received: from gate.crashing.org ([63.228.1.57]:38865 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725764AbfEBGZk (ORCPT ); Thu, 2 May 2019 02:25:40 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id x426PTu3022074; Thu, 2 May 2019 01:25:30 -0500 Message-ID: <79fbc203bc9fa09d88ab2c4bff8635be4c293d49.camel@kernel.crashing.org> Subject: Re: [PATCH] driver core: Fix use-after-free and double free on glue directory From: Benjamin Herrenschmidt To: Muchun Song , gregkh@linuxfoundation.org, rafael@kernel.org Cc: linux-kernel , zhaowuyun@wingtech.com Date: Thu, 02 May 2019 09:25:29 +0300 In-Reply-To: References: <20190423143258.96706-1-smuchun@gmail.com> <24b0fff3775147c04b006282727d94fea7f408b4.camel@kernel.crashing.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 2019-04-28 at 22:49 +0800, Muchun Song wrote: > Hi Greg and Rafael: > > > Benjamin Herrenschmidt 于2019年4月28日周日 > 下午6:10写道: > > > > 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... Ben.