Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp299549lqt; Mon, 18 Mar 2024 08:12:09 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV6mZ6wHLM4URzfV3D8ked7nY5FjaZ/DRKBaqVfK52hmGlwoYdGnOOxtwaIdneh6grt/aS6sGsKFLSQ7Mez0BoxS9c1Qbmh0YYwm8Ytjg== X-Google-Smtp-Source: AGHT+IGRM9y6aJRb+gRa6DyMJH5ZBSC/FdV5lpTYnEgLV6rO0RD/Uol+N6y+gn7K5+gzc1Ju/o8E X-Received: by 2002:a2e:8195:0:b0:2d4:707e:623 with SMTP id e21-20020a2e8195000000b002d4707e0623mr6631020ljg.37.1710774729760; Mon, 18 Mar 2024 08:12:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710774729; cv=pass; d=google.com; s=arc-20160816; b=XxbrKQZTTxFZz07x9g5XD7sSq9HLQ9S+EwS5MuwHueCHEFqIhF28V/JJd4cGis/zBH t1+HtHfIJeXRxS0sulTOEAQ994ifAFYDIO4uFVL+3mwsxRXm5q/JIsPdjeSv2FyjcsJk LuyEkyzw5ioP2mZnp4cJMD2GDlGz9KSCGasX9Z/PI+PcFrQ5wVYw5pcCqagWo1bOR3kE T1Hm3ax2uE0oV4pvGZoQ9o15MVzZUY5LIcxF+g3pATpC5vrhdBsrXMqQYBg15RMUXISf OLSnzrEUoJFpKDaekA8pRzyZvWHkoPSLKKCJIDfFtDuyqdyr4Nd4bvbtMWPBYCq6x2vt +wLg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=xWOqW0YebhNynLRnswRT+iDOKo43sLSNLgQuiEyKwZk=; fh=2ErllEq906Rmj/w2FfBGw4kFtqJunEltCsHk1LT6plA=; b=ygYnnETCon7MF6ZzRcA4pwo4paL8oOsFWEjqMcfyLH3IiafZ39Q7d/ZTwxYo5bf3Qr S8t1nrBuoPI14d9Amj6Rq+GohyfQlFd1H6tRaLxpNsLdINJ4I1GKA7WIBVbxO8/BxBhz PZ7v6Un9nQWSzCfx9MN2t/be2yStM+vLzBRnGHz/2f39hR+0zsxyAQtBzYbBxBeVzjIK OvPr7927LQ1rjzeNC+hPI95wa3wlqa5pvD8aVaAvn0jfAw1qox3rzp1axV6X4IKJssLG 1WfwWoLCB2OwpPhuyZVYqiXb75cWsGKya1p/9cwm/lh9c7kJQBhb55lPbC5Nbi8TaINJ LsAA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@resnulli-us.20230601.gappssmtp.com header.s=20230601 header.b=t0Et7gEh; arc=pass (i=1 dkim=pass dkdomain=resnulli-us.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-105797-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-105797-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id y18-20020a056402359200b00568949972edsi4496817edc.180.2024.03.18.08.12.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Mar 2024 08:12:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-105797-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@resnulli-us.20230601.gappssmtp.com header.s=20230601 header.b=t0Et7gEh; arc=pass (i=1 dkim=pass dkdomain=resnulli-us.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-105797-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-105797-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 529571F221D4 for ; Mon, 18 Mar 2024 08:03:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1ABAB24B28; Mon, 18 Mar 2024 08:03:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=resnulli-us.20230601.gappssmtp.com header.i=@resnulli-us.20230601.gappssmtp.com header.b="t0Et7gEh" Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CB54D24205 for ; Mon, 18 Mar 2024 08:02:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710748981; cv=none; b=R8tk8LMHB264rGLVXyIBBmNn4/vnE2G6Qasqrn3A4ZBMPgw8oDpYJ5FMmKvxKCAg0ezyTgsI7TKrbOyZAOaebjOlQYY/HrIP0h4Qv0krYy6B3f8DCYEMD6kbvAFP5EyEnsYCE2lI+9Td7+7abPb/1hfQ8BlLy5WjmEtsxjirkAA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710748981; c=relaxed/simple; bh=XqaEr8+5PbPTo9cFExJMuDm6EYQQTHY+jja90dnLCDo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=KsQwHa4wjaD7bLlEf9Ny7xQlEQdFXVjw15b1ilOGOzsbgiIOLNoEPxYl3JFm5EzHYAZAfIrV1k+ErW0Zq4/NyRA01BwSQ3GGEbyP3MD1z5A+R/xFc8GPrM3VKONPmR3XXmFTab+x2PyrcAQIoxbLfeplaUDJWcLK0xu4bZCHMLQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=resnulli.us; spf=none smtp.mailfrom=resnulli.us; dkim=pass (2048-bit key) header.d=resnulli-us.20230601.gappssmtp.com header.i=@resnulli-us.20230601.gappssmtp.com header.b=t0Et7gEh; arc=none smtp.client-ip=209.85.128.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=resnulli.us Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=resnulli.us Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-4141156f245so3112955e9.2 for ; Mon, 18 Mar 2024 01:02:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20230601.gappssmtp.com; s=20230601; t=1710748978; x=1711353778; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=xWOqW0YebhNynLRnswRT+iDOKo43sLSNLgQuiEyKwZk=; b=t0Et7gEhTCw5IKP6p97Ixw9v2Voosz/NUSTnlffg8a4R+3Ju6HQTzjHY48mEu6Tm29 xQrfTGimSNdBN02F9rQpNzuACS7w3RnQ5SQdZxI0EpqRQ+dKS69trtHMwTk0w987blie 7oL6FEXIWbER93zVucakITLIYgz4WnnI8Yn8SHFd5uY9v6IkhtMzJqlhXaiYlXbNXGCk SdJW9WNrSXKwrKNgAjGwhpsZaMXZDc6Z48+r5LeQBZo0zOyWMmYDKiFZ4TnI3O6wR1Bf KKXFO6YTtbQDzdWj+yoXuq4R3XsbMnb0MKNq/nQtZ44PJp8Utyu453hz9LPjFD/ZXCR7 0VIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710748978; x=1711353778; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=xWOqW0YebhNynLRnswRT+iDOKo43sLSNLgQuiEyKwZk=; b=Llq1euVyY5nbbT2AYZ8kwe63tlmb96XXFo/QgdEeYJHhr1gSqh6lRB2zkgib7bv4S9 bJjX78eIz4aCE17qUVmB6FHfcZ3vpyNAp0qZk4MsCwWCdfaoLpjklGWXoNGrjLayX+IF z4eDY41yn5zVHjqJ8J7/JZanSY6BHzniQnzMZScFcr9yCvFyHPURU8ez9ko4VLrJfu5R nkiHWhexsBidJCi64tGYprTFGUo1TV+N0ejJGBUj1yWnPmk/phSby+uZUzVCyA+W9UZi 7Ddmy85DO8KPHp3UNg2rUffeBv9JdNbbRfp/BY35OnGAbrk9s94RATIe9Dtxj0KHZqV4 U7LQ== X-Forwarded-Encrypted: i=1; AJvYcCVQXtURSbixxoawaOy1Rt7zRnNfwyr0x/snqf/jZFAt975G/atgRcAmDPtrj+fdpWo2QAPzhXalvTOgZMlTNcA3Qf6LU/5EM4d3d2ID X-Gm-Message-State: AOJu0YxGLX9jc2ol7oQBxm88hw6Cid4ljULva9qlqa41jrVtsFGs4/Ex CiW7gLqapiabhUUmNNRoALfAXoqxyoQwEpK9fuN7w8DrogsaTAaC34k0KySTctc= X-Received: by 2002:a05:600c:1c84:b0:412:e70a:ab8a with SMTP id k4-20020a05600c1c8400b00412e70aab8amr8103345wms.25.1710748977943; Mon, 18 Mar 2024 01:02:57 -0700 (PDT) Received: from localhost ([193.47.165.251]) by smtp.gmail.com with ESMTPSA id by1-20020a056000098100b0033e18421618sm5582669wrb.17.2024.03.18.01.02.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Mar 2024 01:02:57 -0700 (PDT) Date: Mon, 18 Mar 2024 09:02:54 +0100 From: Jiri Pirko To: Dan Carpenter Cc: Ido Schimmel , David Ahern , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Petr Machata , Kees Cook , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH net] nexthop: fix uninitialized variable in nla_put_nh_group_stats() Message-ID: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sat, Mar 16, 2024 at 10:46:03AM CET, dan.carpenter@linaro.org wrote: >The nh_grp_hw_stats_update() function doesn't always set "hw_stats_used" >so it could be used without being initialized. Set it to false. > >Fixes: 5072ae00aea4 ("net: nexthop: Expose nexthop group HW stats to user space") >Signed-off-by: Dan Carpenter >--- > net/ipv4/nexthop.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/net/ipv4/nexthop.c b/net/ipv4/nexthop.c >index 74928a9d1aa4..c25bfdf4e25f 100644 >--- a/net/ipv4/nexthop.c >+++ b/net/ipv4/nexthop.c >@@ -824,8 +824,8 @@ static int nla_put_nh_group_stats(struct sk_buff *skb, struct nexthop *nh, > u32 op_flags) > { > struct nh_group *nhg = rtnl_dereference(nh->nh_grp); >+ bool hw_stats_used = false; > struct nlattr *nest; >- bool hw_stats_used; Probably better to set this in one place and have: if (nexthop_notifiers_is_empty(net)) { *hw_stats_used = false; return 0; } in nh_grp_hw_stats_update(). > int err; > int i; > >-- >2.43.0 > >