Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2515147imm; Tue, 4 Sep 2018 05:55:22 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaUM+FFMlLesxa4pnxKi1Bmdy5CyrPNAwvriDiN/j0JJJXnIOLIVoVerJjPa/M1jc7fDlVb X-Received: by 2002:a62:b0b:: with SMTP id t11-v6mr30647835pfi.36.1536065722762; Tue, 04 Sep 2018 05:55:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536065722; cv=none; d=google.com; s=arc-20160816; b=K0QsXiYAhvHcFk+tHUwxWjg1Un2x4Op087S+CynjA6+Qz2SSN9R5ecx1iggn+nmww6 b53ZknqONfhFVPv80qWESaSq9DLFNl1nylo7mPwROJDDg1/XBx/GuUSVv5tMNdDYGYvH t+6XIxl3CJIgMLtnHGiT4jgzRfdJgBwE/EBhIGvC9kVvPzeC3UjBVFpFtrqcP8XFIqT/ DS/1ULdvntzPUGb6QQVGaCrYM5KEjM349bbSeKlphHUAFwSAN4rKjn9O8iADYHliZ06v M8tY2Rj87rMplDoAIQM9T/rBbWQJSAX0ZRjs0YJGlik0VXEgAo6pNlI0VrEx5MEAwQVU ZrPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=8es9PoX8fIxOkxx2e4PCt5th2RS4v5XOWz1z5tmbXjs=; b=ErIdYyIPuisyfZCxHPnVvqpAgAlRicmkSX/YInM2WGdrCycVCOHyShhjjsLlEO/72a ZM5IrwYxL3I82Ws2C5KX926QiDRwCgKFmMm91jlEwksf8Q27hSXyuHKueRzuSRdRKooX cIoZ5aszyxL4UsOTSgqJ8FCqdP9YVpVNfBfUwBakl07hvlSiZj17q1iyxyft+h2q1YTM kFbzFB8LSvkyZMcNqDG1Pzey3NGT99R9XK3Rl5vumvUePfO1XKYH97AgfzczSmIOP5ym WVbQ8lD6gmx0v+UjilzSZQx10ZnnZswijtY5aYZE4Gz2kRQPpGFH9CaZ3awoQ+EwpyXn E5dQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=JAPWCk1p; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a24-v6si20501422pgh.357.2018.09.04.05.55.07; Tue, 04 Sep 2018 05:55:22 -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=fail header.i=@gmail.com header.s=20161025 header.b=JAPWCk1p; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727217AbeIDRS6 (ORCPT + 99 others); Tue, 4 Sep 2018 13:18:58 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:36392 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726213AbeIDRS6 (ORCPT ); Tue, 4 Sep 2018 13:18:58 -0400 Received: by mail-lf1-f65.google.com with SMTP id x207-v6so2866606lff.3; Tue, 04 Sep 2018 05:53:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=8es9PoX8fIxOkxx2e4PCt5th2RS4v5XOWz1z5tmbXjs=; b=JAPWCk1pVj2qlp4Dl4OSeg0u8kA/4MtVB9/z24BgXyIf8HmvXpaspflmK/UJOnLAyN J83CZ77NLMWZlOAOiJmhAivK0oX+uxVNQM0Sx4ZJEB/6BhwZIM4JAS5QNLi4YEnnXMFR 9cQHrUWJbN6Xzs8K0Vec95wCQ3254SbWGvdHkvYt4OsbPYwvOpQg9H6NsH2I0d8d0/h0 kg5+6GGXfWSNbRgjxSjQfBtIyPyaP2xpZChqsWfN1HhdhzeJGJ8lRT3EfL7aknC84T89 YPICAzolhyXNzQPIrulICcn23n2ZcEXwo6+jLVpwa8Q7VRY+LFS31Bl0xcbZyZYPQbne TSjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=8es9PoX8fIxOkxx2e4PCt5th2RS4v5XOWz1z5tmbXjs=; b=TNeuN1xjRQ6wBWdm48nGYKVmXpyL/xa6lJBGEA1BjYGydqluX6vHbC9SNRsi0vBuS+ uvR7/5wRuSDk+186PxbBx1a/6ytjvwcummRNeUsRhBtlXGSYx7t298HpwCe/vbfK9aap A4pTVDDqFz8zfnj/ASTrRiDxvIX9iOG1sZ6nheXdg5UtK8gVzrOJhDTnNRFFWTuO1cML XaxXTBNJcz3QXIR5gbfoW6nyXXviBEZrzR1ntr4+3e+cXeyRVcDqTGZzUouQzdFoILK5 54xAIxEy5XPSS4D/Ekaqnu4786IMdkSlXZSFmcb0YpQrOFAeU6VVLIGSTxXvpxDgiF/X aCyw== X-Gm-Message-State: APzg51B1x0Q6uuR9IrcLVZgk4d48O4fS2BqQUCbSber0UMvtc4f3B2fv O3wgr6LXEKRtkMQhsTSe8ZI= X-Received: by 2002:a19:57c5:: with SMTP id l188-v6mr21655610lfb.109.1536065634724; Tue, 04 Sep 2018 05:53:54 -0700 (PDT) Received: from xi.terra (c-74bee655.07-184-6d6c6d4.bbcust.telenor.se. [85.230.190.116]) by smtp.gmail.com with ESMTPSA id z5-v6sm4022077lff.96.2018.09.04.05.53.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Sep 2018 05:53:53 -0700 (PDT) Received: from johan by xi.terra with local (Exim 4.91) (envelope-from ) id 1fxAqI-0001dJ-JG; Tue, 04 Sep 2018 14:54:02 +0200 Date: Tue, 4 Sep 2018 14:54:02 +0200 From: Johan Hovold To: Ulf Hansson Cc: Johan Hovold , Rob Herring , Greg Kroah-Hartman , Frank Rowand , DTML , Linux Kernel Mailing List , stable , Carlo Caione , Martin Blumenstingl Subject: Re: [PATCH v2 4/9] mmc: meson-mx-sdio: fix OF child-node lookup Message-ID: <20180904125402.GR28861@localhost> References: <20180827082153.22537-1-johan@kernel.org> <20180827082153.22537-5-johan@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Thanks, Johan