Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4785645pxb; Tue, 28 Sep 2021 04:11:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx7OYD6d7r9NVvuLxRZI3wsS5sOKVifCJAazuA8/CAC6/KjEIyNwNS706/q2L7UvCZjR/ZT X-Received: by 2002:a05:6402:28ad:: with SMTP id eg45mr5918456edb.118.1632827467926; Tue, 28 Sep 2021 04:11:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632827467; cv=none; d=google.com; s=arc-20160816; b=HM6cywm3phcYq5reHeByJh09Jr97UXSdA/byG5yZPGk6xpV018fUxwnHlMuSNmGYB1 MtS/4pegQrm5qXTj85ffOaxK23RU7YEksJEDPuFsielkjHSj2kGdnFSkkCws0AqgwwQm AoCbyhrb9YA/1/EwVpjd+KPPBSuomChMrUR1SDQWNuOvLkCG+D1/5SXpuFRxUn059XYR tjxaj9LoToH62WZ7CGyQlij6UnrDnwtfAy3Eel/GYeFAghnQRk4vdTi5X7ki6D/TcQFV tpzGO2t4i6OAD/7Y2tB2mlv6Eye/sSk6rTNP3h1EtwseVYicqbdVh1CpxUl7nUcydhK6 83Ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:references :cc:to:from:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=x0TF30fHxd3gegxcCEondgQDh02mpuK7Cfxm1pxNpfI=; b=uFzuddcbf89TP2aEP0ljnuZHGRNOU//WucnMwzg47e9qK6+okHbc94VfnShM75IF+E UBzVkoHnRCvw9K9Oe5zBpE0iqn7AKskrcBZ1++sbqCY/warmRvHRmGZ6pq0Ni8ympBR6 cnC9RmZOefMfInzzeor6K4WvjZQFYJkepZwKqfaDWZ707Q9skswykqvftUlNGsYSxh4e yk3pHjceRHiiZMiJ5mTGL6K3CZA4x28VVYg6/2QW5wjL2DoJBsSrVXhYjdn3Fqyh04Pi uZXWyjbohWiwl+YHRXXFwcWiVfC6egufaqDp0skT+rX5pzzq9TOXtWFBVLsxKE+3wpGL WJrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=MuseAtcz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b15si22060696ejk.613.2021.09.28.04.10.43; Tue, 28 Sep 2021 04:11:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=MuseAtcz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240172AbhI1LKt (ORCPT + 99 others); Tue, 28 Sep 2021 07:10:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239068AbhI1LKs (ORCPT ); Tue, 28 Sep 2021 07:10:48 -0400 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26B96C061575; Tue, 28 Sep 2021 04:09:09 -0700 (PDT) Received: by mail-lf1-x133.google.com with SMTP id e15so91137263lfr.10; Tue, 28 Sep 2021 04:09:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language :from:to:cc:references:in-reply-to:content-transfer-encoding; bh=x0TF30fHxd3gegxcCEondgQDh02mpuK7Cfxm1pxNpfI=; b=MuseAtczwhFGOVWkDGFVGrYjjwJAYVJM8tkQm6DO8DnESfEEGCpCF9aLV7+nCUX6c9 aA19RILBgcCnxWQonMx38mrrEwhIFDIfi74YelSGzv87n6lB0HiyhNRg+U3fjBwvtJIx tKSmTwGAZiTwDKRWEgRw/9xupa02F+Vb8F8/LUrVi0gp9atVQ9/8e0BfoTRqyU/+FPQP Mgd7X6w4zpGDIZQ4X35oHNIg0go8cK0M/IU+r1oNpnLUWi6CxUUF3sum3XxMai34hfBw l3tknnjPgZp69FgZwOsi3LVo3Xd4TOXsiCCqxl0hGoH82p3d9oRDTXWyQ2A8yvDJsEiI NRhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:from:to:cc:references:in-reply-to :content-transfer-encoding; bh=x0TF30fHxd3gegxcCEondgQDh02mpuK7Cfxm1pxNpfI=; b=kUJcSf52Q+w72j4cnSg45tm8bXITCYtde25drKFXKZBeesusJk45z4jeQyzORLdMzw Dounc2u3Ghr3clAwPHkuGQCQJCN5ekfEGfBVGyiIWX1MpB2jQN10a05AKB/MtfjvsT57 weuqtL5DcaceNsr0JoWU+f2VTkCdopbzBwedeTHAjIurhqVykrEjKC5bKDvknQfiOTwT IDbUECi3g02mpej7Jc1xNFsrHqvlopCTm1HjerB9BQ+aXojDl/Xcm54scCRhqxzy0gR9 bDHJKODrLXEE1gVryY+frwMO1RV63gMmooO98dbXOUVdC6B+CCDZQ2emUjznX3GqBhBp b3pA== X-Gm-Message-State: AOAM530ckvWctEN6K7NKknQ7PD0R6dUp2fElw0ZKNwyo3FQkII+D6eGp znNqiCZlCC/JfW/5N+OWJoI= X-Received: by 2002:a05:651c:1509:: with SMTP id e9mr5430925ljf.280.1632827347541; Tue, 28 Sep 2021 04:09:07 -0700 (PDT) Received: from [172.28.2.233] ([46.61.204.60]) by smtp.gmail.com with ESMTPSA id r13sm1303965ljk.130.2021.09.28.04.09.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 28 Sep 2021 04:09:07 -0700 (PDT) Message-ID: Date: Tue, 28 Sep 2021 14:09:06 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0 Subject: Re: [PATCH] net: mdiobus: Fix memory leak in __mdiobus_register Content-Language: en-US From: Pavel Skripkin To: Dan Carpenter Cc: Yanfei Xu , Bartosz Golaszewski , andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net, kuba@kernel.org, p.zabel@pengutronix.de, syzbot+398e7dc692ddbbb4cfec@syzkaller.appspotmail.com, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Dongliang Mu References: <20210926045313.2267655-1-yanfei.xu@windriver.com> <20210928085549.GA6559@kili> <20210928092657.GI2048@kadam> <6f90fa0f-6d3b-0ca7-e894-eb971b3b69fa@gmail.com> <20210928103908.GJ2048@kadam> <63b18426-c39e-d898-08fb-8bfd05b7be9e@gmail.com> <20210928105943.GL2083@kadam> <283d01f0-d5eb-914e-1bd2-baae0420073c@gmail.com> In-Reply-To: <283d01f0-d5eb-914e-1bd2-baae0420073c@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/28/21 14:06, Pavel Skripkin wrote: >> It's not actually the same. The state has to be set before the >> device_register() or there is still a leak. >> > Ah, I see... I forgot to handle possible device_register() error. Will > send v2 soon, thank you > > > Wait... Yanfei's patch is already applied to net tree and if I understand correctly, calling put_device() 2 times will cause UAF or smth else. With regards, Pavel Skripkin