Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp93626rwb; Mon, 28 Nov 2022 17:30:45 -0800 (PST) X-Google-Smtp-Source: AA0mqf7tRGf0/IrTEx9ttE1c1GobUaAWxzZWDtFnjYvlyuAKztRgnPxkzvxn++ScqnEpGO992BIx X-Received: by 2002:a17:90a:880f:b0:212:e996:704a with SMTP id s15-20020a17090a880f00b00212e996704amr61634812pjn.13.1669685444931; Mon, 28 Nov 2022 17:30:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669685444; cv=none; d=google.com; s=arc-20160816; b=KsFuBlCYZoqA4F3ElWCzGpPfWZMOHaGlSLKmL1HzGWWKTho8sfpki+te3MKSqdnADw iIhdKWDNcli4teTq0Z8tfcUZQBAhdtDFr5maI1zoqMNuoVbjEiORF6FYmR6E2z1R3WmF RFIGfqZELCiy4BiGzuwgqjuZOOweC4N0/jbmHItBzX8zv1nLWJwesrfYC0M7iPVMlx7I 6fvwbJ6nSJzkiPjQj6QHLpNoBuA2mASpjEbMdozA2tnT7QhFImqIG+iQSzaU/PnysULi qTN3hL6AwZEZ/kom+5VSttc2fdP3mA/7JNYc9jmpfwgbGFkw66b94R0T9b1eUcKrbjgs LFvg== 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:from :references:to:subject:user-agent:mime-version:date:message-id; bh=TggnMn124zitAso/WTnGGCPgm8u04tJBcWkgE/2zSw4=; b=iE9kmCblx/24xT+LEAESH43rtAXO9X1n0gpZciZUjHXi9uBfjW9Yr+DkOnPUUKir0e oQ2SEpxYT5/388SQ+dMkTBkURhEe/7Jck2OlFoWoSj6S3QSlDKfY0tL3J7HJpcRGALG9 dB17TsyDU6hsw6k+5UckUPlXyhv3cBm8jinfDqsrTGHgFI3xFdLrtm8t0GMyXy2mokT9 RTyLV89VxPWmKJ+Ow23mENzohL7kFCIsdHPjatIYBpyxqUmioerqJu+WJbuzetqU4/ux CRkmafZ8gZ9wrqeDhx06w+SBHd+B7XvtPc+3Yf+WI1e2eeQKqv2KufIKauLhZ2c/In2V JBzQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-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 bt19-20020a056a00439300b0053837d7cf84si4790922pfb.254.2022.11.28.17.30.36; Mon, 28 Nov 2022 17:30:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-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-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-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 S235054AbiK2B3X (ORCPT + 67 others); Mon, 28 Nov 2022 20:29:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235042AbiK2B3W (ORCPT ); Mon, 28 Nov 2022 20:29:22 -0500 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0D412ED58; Mon, 28 Nov 2022 17:29:21 -0800 (PST) Received: from dggpeml500024.china.huawei.com (unknown [172.30.72.54]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4NLl955YHkz15MxW; Tue, 29 Nov 2022 09:28:41 +0800 (CST) Received: from [10.174.178.41] (10.174.178.41) by dggpeml500024.china.huawei.com (7.185.36.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 29 Nov 2022 09:29:19 +0800 Message-ID: <3a3e0df0-fe2f-78c4-41ce-5cf194607a3a@huawei.com> Date: Tue, 29 Nov 2022 09:29:19 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.2.0 Subject: Re: [PATCH 1/2] udp_tunnel: Add checks for nla_nest_start() in __udp_tunnel_nic_dump_write() To: David Ahern , , , , , , , , References: <20221126100634.106887-1-yuancan@huawei.com> <20221126100634.106887-2-yuancan@huawei.com> From: Yuan Can In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.178.41] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpeml500024.china.huawei.com (7.185.36.10) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.5 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-wireless@vger.kernel.org 在 2022/11/28 3:39, David Ahern 写道: > On 11/26/22 3:06 AM, Yuan Can wrote: >> As the nla_nest_start() may fail with NULL returned, the return value needs >> to be checked. >> >> Fixes: c7d759eb7b12 ("ethtool: add tunnel info interface") >> Signed-off-by: Yuan Can >> --- >> net/ipv4/udp_tunnel_nic.c | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/net/ipv4/udp_tunnel_nic.c b/net/ipv4/udp_tunnel_nic.c >> index bc3a043a5d5c..75a0caa4aebe 100644 >> --- a/net/ipv4/udp_tunnel_nic.c >> +++ b/net/ipv4/udp_tunnel_nic.c >> @@ -624,6 +624,8 @@ __udp_tunnel_nic_dump_write(struct net_device *dev, unsigned int table, >> continue; >> >> nest = nla_nest_start(skb, ETHTOOL_A_TUNNEL_UDP_TABLE_ENTRY); >> + if (!nest) >> + goto err_cancel; > no need to call nla_nest_cancel if nest_start fails. Ok, thanks for the suggestion, it will be fixed in the next version. -- Best regards, Yuan Can