Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3437981imm; Tue, 4 Sep 2018 23:32:50 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZFIYLhRPzAySbmRoZMgQCQpqF1qr6n1pGyEwMBbkqYFHB9suw6EbywAQKlbclbvTBPYHHs X-Received: by 2002:a63:5964:: with SMTP id j36-v6mr34667541pgm.222.1536129170619; Tue, 04 Sep 2018 23:32:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536129170; cv=none; d=google.com; s=arc-20160816; b=Ca4xNl8N8qOF2yUH76/l3yk/oKQ/4hVOKTmMjXNPjj6w00OHSs06gMiha7ib2ybqPl 95rN22/Fycv0vjwbqFHm5nUTWK3sL+UlZoN/p6ZolJMl0MZL80S8lpd9JIqPJKhNWEUW odXxMFFCP65JapazPYoe+tyHB/OVOcl/Xjd3p4dGmLpMpuaumxprqZPZNCjyBoUza+I9 AYzWHEKpxeIewvhaKpNiMgGGdV+LWvHdFtoxVzRHQvxK/j3VInSxxtqodyz9y03awX6i lqS14+1mH6MiGarMSVx9reijKHfX3UfjM8YVb9X+LvIYFDt2OVP3gi7BTtl3Z15d+f8e Z8ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature; bh=gUIXVqQ+e4p6svaItZ15QZA4cIxJQnxxDRm2cI5KcUQ=; b=maC1PhtTtvENoB6YzJUPs37Q+CS/4B9GSOrENmvhFWReCx0+dGvhcTps2cQ1CVrba+ wAuUslN/Vw8u/3D0CPaL/wMRubdkVl8C58kHC+ma3r64MDgrramzG+ExVskT1UXJTDI8 Aq8dFnv1GP08g8uGgniNPCSl5wypYMgCNtlU5ciF69RXeWRe/nK0YMcGnsaUeJ3wNK51 ydRwWsdF2BO0KY3SvTTaUrUEz+me71LW1X1Oq0E3ODUHa4QTw/B856Xt32Vso4cWEbpE wsr2OmiKjn3Hk/kTdfBMzfI9WUfV5mtKCV+kEf0LUbs4UAJOorAmcIlMVZcFUg8CB2Jn SjeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GlXXF0yM; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x12-v6si1006971pgj.175.2018.09.04.23.32.33; Tue, 04 Sep 2018 23:32:50 -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=@linaro.org header.s=google header.b=GlXXF0yM; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727664AbeIEK7J (ORCPT + 99 others); Wed, 5 Sep 2018 06:59:09 -0400 Received: from mail-it0-f67.google.com ([209.85.214.67]:36894 "EHLO mail-it0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726426AbeIEK7J (ORCPT ); Wed, 5 Sep 2018 06:59:09 -0400 Received: by mail-it0-f67.google.com with SMTP id h20-v6so8098622itf.2 for ; Tue, 04 Sep 2018 23:30:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=gUIXVqQ+e4p6svaItZ15QZA4cIxJQnxxDRm2cI5KcUQ=; b=GlXXF0yMPl7RuiQipGfa6vZBgyM/0HkdD8WwNvD93j2j5x0eB8MxGbDZlNALiQKap4 IflqkcT+CxnB84Dw04eYSEhAYl3pNYynpuwyBiNHAEzYdfXG8QKii8G46K/p6q3AgefN S0FlUzP2dHztyTRLLFEb1wLnObUPSxseRakpM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=gUIXVqQ+e4p6svaItZ15QZA4cIxJQnxxDRm2cI5KcUQ=; b=Ry5leNtOM0qvKQpWoaCxgDkrvSVXoN5UiPIGz8Dp2cwAlFICZIXSfem2gnbIQThdK1 phOkMHKv5lgZbt2rzu3aG7zos9v0AXHvjczQE76af6/re5flGHP2YMQ27DAKIpUtzHmY aCK+iJdIAbr2aMIIlPEjjatVYaf9BwT0n4dIb9tpCDFFtsB2GvnW2qaGvIiOASv1wIBt Nnzs1SIsBvM/iNn1YYUrUXpkyYHPAsH4oc3tao0cc+RhLBVcK0PqgCpaajcvfXtSah9t 06YH2M9wCpdVFO+TS1zfCJ/Maw5fYLI8LT6jjZZpRo9K05rVOKFlcSCJmQ1wnSeA1xv5 OdnA== X-Gm-Message-State: APzg51C0n2PvMPDJMu+57ljTmOO2BRRPDb//kTlR+jIWqUdb7Cx/iNNw hGohK0r7Dsu+KkZjUAl7DvHoOdf+TYewtdWp0YH6oQ== X-Received: by 2002:a24:b919:: with SMTP id w25-v6mr2698734ite.101.1536129030355; Tue, 04 Sep 2018 23:30:30 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:4f9a:0:0:0:0:0 with HTTP; Tue, 4 Sep 2018 23:30:29 -0700 (PDT) In-Reply-To: <20180904125402.GR28861@localhost> References: <20180827082153.22537-1-johan@kernel.org> <20180827082153.22537-5-johan@kernel.org> <20180904125402.GR28861@localhost> From: Ulf Hansson Date: Wed, 5 Sep 2018 08:30:29 +0200 Message-ID: Subject: Re: [PATCH v2 4/9] mmc: meson-mx-sdio: fix OF child-node lookup To: Johan Hovold Cc: Rob Herring , Greg Kroah-Hartman , Frank Rowand , DTML , Linux Kernel Mailing List , stable , Carlo Caione , Martin Blumenstingl Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4 September 2018 at 14:54, Johan Hovold wrote: > On Mon, Aug 27, 2018 at 04:44:44PM +0200, Ulf Hansson wrote: >> On 27 August 2018 at 10:21, Johan Hovold wrote: >> > Use the new of_get_compatible_child() helper to lookup the slot child >> > node instead of using of_find_compatible_node(), which searches the >> > entire tree from a given start node and thus can return an unrelated >> > (i.e. non-child) node. >> > >> > This also addresses a potential use-after-free (e.g. after probe >> > deferral) as the tree-wide helper drops a reference to its first >> > argument (i.e. the node of the device being probed). >> > >> > While at it, also fix up the related slot-node reference leak. >> > >> > Fixes: ed80a13bb4c4 ("mmc: meson-mx-sdio: Add a driver for the Amlogic Meson8 and Meson8b SoCs") >> > Cc: stable # 4.15 >> > Cc: Carlo Caione >> > Cc: Martin Blumenstingl >> > Cc: Ulf Hansson >> > Acked-by: Martin Blumenstingl >> > Signed-off-by: Johan Hovold >> >> Acked-by: Ulf Hansson > > Thanks for the ack. Rob's gotten the helper into -rc2, so feel free to > pick this one up directly to whichever mmc branch you prefer. I've been > able to trigger crashes after probe deferrals due to the use-after-free, > but this seems unlikely to be exploitable. Applied for fixes, thanks! Kind regards Uffe