Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6668967rwb; Tue, 22 Nov 2022 17:15:14 -0800 (PST) X-Google-Smtp-Source: AA0mqf7zTPBCwvGtO/1lyLvnZbJ9Ii5WMqTVv5rA7tukMpEjio6nkmSe1oA2ZLztj5gps16E2Bz3 X-Received: by 2002:a62:cd04:0:b0:56c:14c9:70dc with SMTP id o4-20020a62cd04000000b0056c14c970dcmr6863196pfg.17.1669166114698; Tue, 22 Nov 2022 17:15:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669166114; cv=none; d=google.com; s=arc-20160816; b=0qpmuBUlCzoQU1iMxo/DYMlrpKMlZV4PWE6MkjbUGbKdXLETgwe+6tugCD7j1KxyVI CPR+MwxbevWXWDSCvMFObNDL61OmHtEtCwTGQgX+LriamUZznGTI2hQg2ycXnnrEKn+N 28t8A1fMkQJaSE8m/JznbHsKkVI+wEabv8K8LiWHK4w4nfTtgNJaNhoDaRU9d7DD4olK 5p4z93S8KKMazXrtKWmCvIgX6Ij/YzBdVf6P8t6yImOog9kk8qcyTfrpP3cJvY3uY9eR 62kBQjT2N1s0xzKiRpYawTGmiW5/1Gnw84zA46N0FkO/IvO26nmrY7PmqHZWKSntWzaw qwaQ== 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 :mime-version:user-agent:date:message-id:from:cc:references:to :subject; bh=E7HzESiu4AHn7dDxxsyMgp0lWe0LSdZ37CjtdjU3+eI=; b=r3lOAWz2yCaohqFXiAbsoywW+IgudgltvQJ9avWkNDVLIp93s8VzuTTcWI2j0uDyfg /DaUQVVDFuPA7cFcCzQl4KTw/RFrbOmlp8qHuPdGyE/KVkk8jAUHnDl5tf+X/GxzJBoX YL/Rk2kdMsv11wZB8BwiOW7/1JYZ0lO+FUHLz00yPEKcZjyyRybFiO7BN9HGu2qUEl3B rN8THHa1rjwp3d+iInQZ5qTT2Yjxlaan7RKyU9hp1bHGzHoFY+P20gYNFjUv+tDJ6t4T rEcsnf/3iEuEDWQyRYa1tA9aGlpv14ezsyfZ40cJetOYcRxQudduKfvfGlHC8lfDxDS7 tCFA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oo11-20020a17090b1c8b00b00212f0d1bf7csi460113pjb.158.2022.11.22.17.15.03; Tue, 22 Nov 2022 17:15:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235466AbiKWBL0 (ORCPT + 89 others); Tue, 22 Nov 2022 20:11:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235624AbiKWBKh (ORCPT ); Tue, 22 Nov 2022 20:10:37 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DEC6E0DD0; Tue, 22 Nov 2022 17:10:10 -0800 (PST) Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4NH31m2HHtzHv2R; Wed, 23 Nov 2022 09:09:32 +0800 (CST) Received: from kwepemm600005.china.huawei.com (7.193.23.191) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 23 Nov 2022 09:10:08 +0800 Received: from [10.67.109.54] (10.67.109.54) by kwepemm600005.china.huawei.com (7.193.23.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 23 Nov 2022 09:10:07 +0800 Subject: Re: [PATCH net v2] net: mdio-ipq4019: fix possible invalid pointer dereference To: Andrew Lunn References: <20221117090514.118296-1-tanghui20@huawei.com> <6cad3105-0e70-d890-162b-513855885fde@huawei.com> <3cb5a576-8eb7-54fc-4f4b-9db360b6713d@huawei.com> CC: , , , , , , , , From: Hui Tang Message-ID: <806343a9-abe7-cffb-c153-2e8bffc89c93@huawei.com> Date: Wed, 23 Nov 2022 09:10:07 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.109.54] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemm600005.china.huawei.com (7.193.23.191) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022/11/21 22:36, Andrew Lunn wrote: >> Hi, Andrew >> >> My new patchset is ready, but I just found out that another patch has been >> applied to netdev/net.git. Can I solve the problem in present way? And I >> will add devm_ioremap_resource_optional() helper later to optimize related >> drivers. How about this? > > This is one of those harder to merge changes. patches to lib/devres.c > generally go via GregKH. Networking changes are merged via the netdev > list. > > Did you find this issue via a static analyser? I assume you are > running it over the entire tree and are finding problems in multiple > subsystems? So devm_ioremap_resource_optional() is potentially going > to be needed in lots of places? Yes, I grep the entire drives, some drivers is really going to be needed for devm_ioremap_resource_optional() case. For example: drivers/mmc/host/mtk-sd.c drivers/mmc/host/sdhci-st.c drivers/ufs/host/ufs-qcom.c drivers/mfd/bcm2835-pm.c net/mdio/mdio-ipq4019.c drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c > One way to get this merged is to cross post the patch adding > devm_ioremap_resource_optional() and ask GregKH to ACK it, and then > get netdev to merge it. You can then use it within the netdev > subsystem. What you cannot do is use it in other subsystems until the > next kernel cycle when it will be globally available. > > So three patches. One adding devm_ioremap_resource_optional(), one to > revert the 'fix', and one with the real fix using > devm_ioremap_resource_optional(). Thanks