Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1749635pxp; Mon, 7 Mar 2022 01:20:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJxuoUAR+q7nj0jYKuI2TqkzEhMv3VwlieaOJgjwpuI8AnxLFIPbaFPZ/WJy/RZ1xoBv8xYL X-Received: by 2002:a05:6402:51cb:b0:409:e99f:bc1c with SMTP id r11-20020a05640251cb00b00409e99fbc1cmr10295444edd.68.1646644852518; Mon, 07 Mar 2022 01:20:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646644852; cv=none; d=google.com; s=arc-20160816; b=rh2I4pLl16HLDbulg+U6qjKTknvgRJg/v9j6kIvCnYZmXdzs2f+eAfEy3JO/ZLqGgq UwvppMOvpnoes6mdUxXFVwOszv/oGiFSs0MvGBzBsbuudR3S4OSnOb/0pLCwD0RfozTa HNI+HVVfRZ0ym68hTQFhojtQQkdEMVInX+421WgeV2h2RgGb6e5A2xeX/CDXQ2E2ivNt qYGlN5yWhb9ClREt+QYUBUb9zIYfGlS3FTjiP+lYUdmxME24ytWl7HKWAptZZcH6GdaB wHcijr/AGrmPMc7ppyZKwmMuv4lbUvkvuk3zzKVfB3zsG9TBymw+IxxYyn1jp2xihCsi 6Elw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=1WgFWV/G5zJ1fhJnvGzti+mBFX39uCDVup/6USo3MlA=; b=fzLgWEJLqObmK5/ZH317q77Z9tztaDAVp8cqXDmc1s6kTgpcMVkBXS1/r215OYImj4 FNFtraTQfLds56I7tT2NgN0ody7srQeyzW785QCTSboW/NaLG+s5VBXm1+4VC3kHo526 qwbMeaJNSGdl1p7+YQdmUpqscqcfKbshMwQPofXjmVIwBTKkHG4lsHb9TGI09VcMbyej aXRJm5ywNR4/jffDrVANhSoj3QRsMpZEisFwo+xZytINc83wqeIH/v8lT/g1ECAbuMqq 0NnqjUGGylh3vJ10z71bJ5QphvlILydRuNMJ1f2jyLmksb58friCG92wtOCYtaVl1b7h MteQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=WBAv2tLP; 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 r7-20020a50c007000000b00410befcfee6si8206026edb.253.2022.03.07.01.20.30; Mon, 07 Mar 2022 01:20:52 -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; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=WBAv2tLP; 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 S235770AbiCGHRK (ORCPT + 99 others); Mon, 7 Mar 2022 02:17:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235759AbiCGHRJ (ORCPT ); Mon, 7 Mar 2022 02:17:09 -0500 Received: from new3-smtp.messagingengine.com (new3-smtp.messagingengine.com [66.111.4.229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C205C5A0A7; Sun, 6 Mar 2022 23:16:15 -0800 (PST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailnew.nyi.internal (Postfix) with ESMTP id 83B1C5801A1; Mon, 7 Mar 2022 02:16:12 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Mon, 07 Mar 2022 02:16:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=1WgFWV/G5zJ1fhJnv Gzti+mBFX39uCDVup/6USo3MlA=; b=WBAv2tLPRu30XVgBfI1ZZ7l+OOSUUcaNg oqAVODAPz2uPsOiGd7C70cGNnWc31T33WMa7ZnkQ4ME9XmTFihf2LffHFvFdwN3V HGobInawsU6ApvYwOX8h/TxP3FHXzYBh9t8avMIRpKB+7NcpYLoLj1NPe4bUcKIu R2mXSzdjJr5VEik3r7cJADfzXjBdQI06h+Xd5bR5WWtJxAQuEZEpt1USumgy/BDO FLnPPs5vr9huGlAK82OzLEtT7cOMA0jMEyEPbp/tpYIgberPjJ6AcKO/n24HfqmD YE1udl6lixcH8LepweY7zPy3A8igjOD387cYz5C5JUeq3PMXrt65A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddruddufedguddtiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffukfhfgggtuggjsehttd ertddttddvnecuhfhrohhmpefkughoucfutghhihhmmhgvlhcuoehiughoshgthhesihgu ohhstghhrdhorhhgqeenucggtffrrghtthgvrhhnpedtffekkeefudffveegueejffejhf etgfeuuefgvedtieehudeuueekhfduheelteenucevlhhushhtvghrufhiiigvpedtnecu rfgrrhgrmhepmhgrihhlfhhrohhmpehiughoshgthhesihguohhstghhrdhorhhg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 7 Mar 2022 02:16:11 -0500 (EST) Date: Mon, 7 Mar 2022 09:16:07 +0200 From: Ido Schimmel To: trix@redhat.com Cc: davem@davemloft.net, kuba@kernel.org, nathan@kernel.org, ndesaulniers@google.com, idosch@nvidia.com, petrm@nvidia.com, edumazet@google.com, avagin@gmail.com, yajun.deng@linux.dev, johannes.berg@intel.com, cong.wang@bytedance.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: Re: [PATCH] net: rtnetlink: fix error handling in rtnl_fill_statsinfo() Message-ID: References: <20220305181346.697365-1-trix@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220305181346.697365-1-trix@redhat.com> X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE 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 Sat, Mar 05, 2022 at 10:13:46AM -0800, trix@redhat.com wrote: > From: Tom Rix > > The clang static analyzer reports this issue > rtnetlink.c:5481:2: warning: Undefined or garbage > value returned to caller > return err; > ^~~~~~~~~~ > > There is a function level err variable, in the > list_for_each_entry_rcu block there is a shadow > err. Remove the shadow. > > In the same block, the call to nla_nest_start_noflag() > can fail without setting an err. Set the err > to -EMSGSIZE. > > Fixes: 216e690631f5 ("net: rtnetlink: rtnl_fill_statsinfo(): Permit non-EMSGSIZE error returns") > Signed-off-by: Tom Rix For net-next: Reviewed-by: Ido Schimmel Thanks