Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp5658468imm; Mon, 27 Aug 2018 01:46:31 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaKYRWZKBoaf8rAu5vtEbsid3BFTjsEOfyd606BNjTWHF+JorzW0P6Iq8EHTVKpNj6A7c8o X-Received: by 2002:a63:bc0a:: with SMTP id q10-v6mr11320893pge.60.1535359591534; Mon, 27 Aug 2018 01:46:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535359591; cv=none; d=google.com; s=arc-20160816; b=YGqx4D0HFz/d+3gUkRyJkmzqYAIZZFCGd4T2+lz07W/joJfzue2Z0yYGFfZwbv1dNZ 3nq6jPb97HFZMH4nxXlOWeRVxM6QgqR4tp6CBMS6xkq+ISc3rFL7iZGTfj7WovUIbOgI ISOO9BNMmglq0GL+CgRvh1EJgUSulZXDbuU40S1wdKgoV665CJNvBY2eAjF5nILFp2l/ 7LkvSfBtHluzo0vRx9D+x0JHT+jRmuE/fkdT/hRIeefVHpYW+WddZYCA2HIo0up7MY4s oxuWeAcCCYq8X19AYRCGm634ZdT8eiYvpdlX+Pkg4E99j87StOsCSp94dYr+CpIn0bKm 1jhg== 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=MVwnb6YB2NxrCktoPgmjFjHVGEIc7ASLkQhna90wuPU=; b=VehmhY7l6KZxSUC2x3Zya8NXOPCM30AJ1ysFGFfcua2lJs+pN3LNWznreaOsWQ0um8 BpEPy+/EJ7HGxhrv7UXQaUmqW7TZz//VkRCX9Jxf9Uhuvh5B6QZbXz/xrU0AotR7Nlgl qtDQyiVhZJTAioyJjrR+mDITMsTSbyMLTofrijklb2KVFvx+8RCUK5PlwD0mzqYT25fo n+lykv97/kLudXn8M9xxg7yfhxFLpfy4AVMBrsFvpGdAnTAjbjlUUhZdGU0ZnxbDiP71 NcojNI6lE/HGKPhTcu10kSR4WuTu4wp4eYm8LriFnyU4SkPJkkWTY690Wvkx9zo/N3BC EyNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=NHYvm7eL; 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 w68-v6si15100159pfw.308.2018.08.27.01.46.16; Mon, 27 Aug 2018 01:46:31 -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=NHYvm7eL; 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 S1727446AbeH0MaA (ORCPT + 99 others); Mon, 27 Aug 2018 08:30:00 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:36123 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726934AbeH0MaA (ORCPT ); Mon, 27 Aug 2018 08:30:00 -0400 Received: by mail-lj1-f194.google.com with SMTP id v26-v6so7872194ljj.3; Mon, 27 Aug 2018 01:44:17 -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=MVwnb6YB2NxrCktoPgmjFjHVGEIc7ASLkQhna90wuPU=; b=NHYvm7eLa/qd0SBmJNi/hWFZ4K7tbxZVAbgFQZzWSSyPR4Rvb+LDVWFLDjSywUj1SE G/1Fte7CeT7Se6Bl2bG7swiWKQ5SY/agQ8SubIY8qrduazLixJkNgH7XwiHksI1wJHba Yu3e33KpJhGlTOnJsSlEQFrPjeAkIhgNMVlmKdO88bZcgEC99nwe1snu8m0v3JMls0O3 v3OIlKRxbFmSMFyZSbtraeQCADO9r63IyxqJGfCK9XHNWVRUap6AtuaCQq9QIy0rQYzy TqNVkMHI7mkMtrpGQAjIXb0ryhSclRiZMRQUXt2FHH8DLC6YVHSLv2zGR8yOKgpVc8rE oyaA== 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=MVwnb6YB2NxrCktoPgmjFjHVGEIc7ASLkQhna90wuPU=; b=XbKsIcynjCApLYaphxuYdjijgMNu6SP1U8cD+Tubf6UfA2Bw+q9BlGqA8Lnl8K7fmO kABPiuzaizYd2CYKV9iJz3qdxXwkGCcmgeQANphwN8MPovArJVu9WTSQsGECtwoE9zc6 GYrM6r5f5CF8lxkeEdnU+BBgYJVsiuHwUvF/ULEpY0kxxWevWoSMbeBuJuWuhfOEDwLA VuEVjLrFQlS/HY/HjSNgKYmWr4h1JM0wT4tam+DbzdYyW1/uWQ8foDXCekaky530rfjg PkB1MoOEOQxFKsrqsacONEtjJPFOOmnjw+EE0bbdZkC33GVJTilONmYTbzg5h3hlav7w wYDw== X-Gm-Message-State: APzg51DTBVMeeVrMqGQuZhuiDmXdUs3Ind6kLbda5P+HNwTiRHhUHUv6 TY0sQgOKLR3iPQGkHF9/xJA= X-Received: by 2002:a2e:3c1a:: with SMTP id j26-v6mr7620867lja.149.1535359456787; Mon, 27 Aug 2018 01:44:16 -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 q15-v6sm2634151ljh.34.2018.08.27.01.44.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Aug 2018 01:44:15 -0700 (PDT) Received: from johan by xi.terra with local (Exim 4.91) (envelope-from ) id 1fuD8A-0005z5-Rl; Mon, 27 Aug 2018 10:44:14 +0200 Date: Mon, 27 Aug 2018 10:44:14 +0200 From: Johan Hovold To: Boris Brezillon Cc: Johan Hovold , Rob Herring , Greg Kroah-Hartman , Frank Rowand , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, stable , Nicolas Ferre , Josh Wu Subject: Re: [PATCH v2 5/9] mtd: nand: atmel: fix OF child-node lookup Message-ID: <20180827084414.GZ14967@localhost> References: <20180827082153.22537-1-johan@kernel.org> <20180827082153.22537-6-johan@kernel.org> <20180827102820.3abf7291@bbrezillon> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180827102820.3abf7291@bbrezillon> 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 10:28:20AM +0200, Boris Brezillon wrote: > Hi Johan > > On Mon, 27 Aug 2018 10:21:49 +0200 > Johan Hovold wrote: > > > Use the new of_get_compatible_child() helper to lookup the nfc 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 a related nfc-node reference leak. > > > > Fixes: f88fc122cc34 ("mtd: nand: Cleanup/rework the atmel_nand driver") > > Cc: stable # 4.11 > > Cc: Nicolas Ferre > > Cc: Josh Wu > > Cc: Boris Brezillon > > Signed-off-by: Johan Hovold > > Acked-by: Boris Brezillon Thanks for the ack. > I'll let Miquel queue this patch to the nand/next branch, unless you > want it to be merged in 4.19, in which case I'll queue it to the > mtd/fixes branch. Note that there's a dependency on the first patch of the series which adds the new helper. Rob can pick up the entire series if the various maintainers agree, otherwise I'll try to get at the least the helper into -rc2. I'd prefer getting the use-after-frees fixed in 4.19, but queuing for 4.20 should be fine too. Thanks, Johan