Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1907669rwb; Fri, 2 Dec 2022 02:52:46 -0800 (PST) X-Google-Smtp-Source: AA0mqf4Bs3eHiKZ3yU2iRP7nOMKsa9R4IMTxcDW5qUCEKavrLeQtKJuwLBgvaUy3pNWR/YIUpxgl X-Received: by 2002:a17:907:8dcc:b0:7b2:b5aa:f1e0 with SMTP id tg12-20020a1709078dcc00b007b2b5aaf1e0mr47635915ejc.54.1669978366343; Fri, 02 Dec 2022 02:52:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669978366; cv=none; d=google.com; s=arc-20160816; b=U2tq/q+NIrmkVUbZL2l0W2N94Sif4e0XfLi+NVYzBoOJViYSrkyDjqRpC9v1FeqYtB rEy7VI6pX6sjxUbaWPFIZjZJtBghGbVZo+Lg9v4IICSgGIWzUZ5ksWIZ30bwpD6lJ8OZ J+jKaFETk1ClttVBp3VvVFGWYrQT3Vy5jcTtjkxeDGsR5Td8wFTffBqBQXb2PyQFXaPB jn6EVATEh3ANYjGRWUP9AfJagVP0jDbsQGUOchARKi5iwW80nd99xVqUylJwU/fHVaCC Lz8EH36JIM1q9T8KwUETvfyQEeAfVBfU0jhmTZb/5zRQtrIsv1NrfhljbbRddbclvlDB RISQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=peXFDZRSQs5CDbiGGb/N3Fs5pjUY2RyJnSfupMMC6Eg=; b=c4cBBpkti8CPF3OgTKqUnWfCk+K4hwQmyIi0zPLgge6gTMMkC/4FR2sdMdIo1eYSLK AiZLgRL/b+x8or4m7h2/M0WUwek3QIRj2COQH41WHC3Auh3kL26lJxWRANR2RfFbWmjc grxS2q1dx579SN0MlVlWmxGIwM1zLbJPQcRGn6tTXhyy9fX2/Aj5+6D3g4Kn8n+K/uS2 v57b0mDRh0/DMvPoDKaxlXjJhCzx+UZV4CyHIVQwtwLi81j8JCDfjFaU1kJ/t9wkvEEI WvXwKSSFPin6aDG5Om05aeTdNsA7qiIlhwbbnXNFPgVEan/KCslI6WhzR4OhaT910az2 SZUQ== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qf21-20020a1709077f1500b007b911ee70cbsi6275043ejc.796.2022.12.02.02.52.26; Fri, 02 Dec 2022 02:52:46 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233182AbiLBKSt (ORCPT + 83 others); Fri, 2 Dec 2022 05:18:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232841AbiLBKSo (ORCPT ); Fri, 2 Dec 2022 05:18:44 -0500 Received: from mail.nfschina.com (unknown [124.16.136.209]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C53788DBD0; Fri, 2 Dec 2022 02:18:42 -0800 (PST) Received: from localhost (unknown [127.0.0.1]) by mail.nfschina.com (Postfix) with ESMTP id 9F8871E80D27; Fri, 2 Dec 2022 18:14:37 +0800 (CST) X-Virus-Scanned: amavisd-new at test.com Received: from mail.nfschina.com ([127.0.0.1]) by localhost (mail.nfschina.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0MNc3Rl89av0; Fri, 2 Dec 2022 18:14:34 +0800 (CST) Received: from [172.30.38.124] (unknown [180.167.10.98]) (Authenticated sender: liqiong@nfschina.com) by mail.nfschina.com (Postfix) with ESMTPA id 465691E80CCF; Fri, 2 Dec 2022 18:14:34 +0800 (CST) Subject: Re: [PATCH] ipvs: initialize 'ret' variable in do_ip_vs_set_ctl() To: Dan Carpenter , Peilin Ye Cc: Simon Horman , Julian Anastasov , Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, lvs-devel@vger.kernel.org, netfilter-devel@vger.kernel.org, kernel-janitors@vger.kernel.org, coreteam@netfilter.org, Yu Zhe References: <20221202032511.1435-1-liqiong@nfschina.com> From: liqiong Message-ID: <9bc0af1a-3cf0-de4e-7073-0f7895b7f6eb@nfschina.com> Date: Fri, 2 Dec 2022 18:18:37 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Content-Language: en-US X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,MAY_BE_FORGED, NICE_REPLY_A,SPF_HELO_NONE,SPF_NONE 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 在 2022年12月02日 18:07, Dan Carpenter 写道: > On Fri, Dec 02, 2022 at 11:25:11AM +0800, Li Qiong wrote: >> The 'ret' should need to be initialized to 0, in case >> return a uninitialized value because no default process >> for "switch (cmd)". >> >> Signed-off-by: Li Qiong > If this is a real bug, then it needs a fixes tag. The fixes tag helps > us know whether to back port or not and it also helps in reviewing the > patch. Also get_maintainer.pl will CC the person who introduced the > bug so they can review it. They are normally the best person to review > their own code. > > Here it would be: > Fixes: c5a8a8498eed ("ipvs: Fix uninit-value in do_ip_vs_set_ctl()") > > Which is strange... Also it suggest that the correct value is -EINVAL > and not 0. > > The thing about uninitialized variable bugs is that Smatch and Clang > both warn about them so they tend to get reported pretty quick. > Apparently neither Nathan nor I sent forwarded this static checker > warning. :/ > > regards, > dan carpenter It is not a real bug, I use tool (eg: smatch, sparse) to audit the code, got this warning and check it, found may be a real problem.