Received: by 2002:ab2:6486:0:b0:1ef:eae8:a797 with SMTP id de6csp253094lqb; Sat, 16 Mar 2024 02:46:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVYWi7yu/2CKbv19apOPhAzwbcURamwarfFw1pANCJOOXIWnf8aV1nF9mL2FNE0oswqiOsjrpThewI06cPLSjDoMyw3UUH5V6oDd/hCWw== X-Google-Smtp-Source: AGHT+IHyTSVHhJ2F8hoZUK95CXmz8BsgsyIpo/Je6yj5HD4EJZrglyAufsnDG/IfzEM2nuUs4vTN X-Received: by 2002:a05:6a00:b4c:b0:6e6:f799:5480 with SMTP id p12-20020a056a000b4c00b006e6f7995480mr4540239pfo.4.1710582379470; Sat, 16 Mar 2024 02:46:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710582379; cv=pass; d=google.com; s=arc-20160816; b=FMR5N3PHDrWz23Tt3z6AevMBjy0gvzxyRSXfHX/R0xwTekMyr6Iyavm8DEioA5mqil W6fDo5AQaB1yyhJJfZWtIgenumoR/X6+zb8P9ZUDnPc4TdIUaET5+eDVNAtRrgfX24Xf 60ecN2wt96Abj2BfZ3ZawmHtd8Zqv7rJypvAr95Maaha40hYFEqqn7OVOmP3xyLMNEBx 03jJ5RHsb0IPppAmLNiyATiyYLCvDXDBR3Swtnrj1726Ps5tYoTzZVZtkQ8dxuvuyx4k s5gHpeezIRgtFKoojjmqJHZ2HnhuRp95elCa2p7EO+hk5kYDK49LHU60eii2O3gRDP9j I7BQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:subject:cc:to:from:date :dkim-signature; bh=Fd/UYSinQFLXB7b7RayERbmP2J/ErjoE+16L+UoVOvU=; fh=/B5rUkLamIPKUUAG8w7DOKwlRD1/Q4jDYetlK4+7KhU=; b=rvgQg012vTG7odF7Uo7YljnMNeMJp655mSgoYLy/ZH/cTOebJl6UfxNulax8AtOEiS CEB8weIwzGx6AEL6R+EYwXpJeqNxSLwpGO/JBqZguudIiAuH0i+FGrQXukpHFZYwt2hh 0SufGhm0+7MYmclQpJCmKjEcfn0pALbMyDsVBqB5xNUUU2ziPDKb6kbza/iyYkpQHVWh xDAlM0PGBHrb35X+WhA/uTivb056VxTywwhO7fgJN5k65/64j6+6VThrxOnl7soAGWU4 tR9eQOugL0HoJB7gtqI9ASZZrXDtr2LgI/DQoPedheC3Cr9hHMHADEkDJbrcbDTGVKy6 +b1g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="wc6W/u8U"; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-105144-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-105144-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id j3-20020a056a00174300b006e7079adf0fsi1081113pfc.339.2024.03.16.02.46.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Mar 2024 02:46:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-105144-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="wc6W/u8U"; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-105144-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-105144-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id BAACA2821B2 for ; Sat, 16 Mar 2024 09:46:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EB1FC171BB; Sat, 16 Mar 2024 09:46:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="wc6W/u8U" Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (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 618C2134C4 for ; Sat, 16 Mar 2024 09:46:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710582371; cv=none; b=QwUJ31LXxTqdVyH8xBk9ba6BpXNBQkH4vF+LwOYJAMChRiOjJ7bdVfjeczLkGojfWviIRmFTmRcjLavJvWVNIcQvbAPwl1Iy8X6FCusLDfvy79sB7N761hGda/9+4xzHCM2iId1ec3jsgD6b6AghonBsJiB3sRVpKpyldfQG+MY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710582371; c=relaxed/simple; bh=RT+XZPRzwFZFTgFvITaOrYfXlyrwyyKF/JKHV/iD79g=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=RhL62fFsr25Ovj0yARffV5ogKgW8m6vkW4C76n6YthxZz5d9MTArd3iOKZjWGkBI/LrgYbmQByrlVvIz/cr2j3zvqxA/PMS//SOZiu17GWvR414f3x6yFKi/RhPUZxEJ3CItNRLA52erLragNhu4GaSbM4neP4OXrtq2bWgfN/4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=wc6W/u8U; arc=none smtp.client-ip=209.85.128.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-414023d288cso8748145e9.2 for ; Sat, 16 Mar 2024 02:46:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710582368; x=1711187168; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=Fd/UYSinQFLXB7b7RayERbmP2J/ErjoE+16L+UoVOvU=; b=wc6W/u8UuZmXLyU3DULmxVaEGUnQ/O7XY7mEQKquCEfowMBtuK/dUE1RkCyB0WOFc9 9kud/r5KlFisRzKBY+cpsVAqlPTsYD/NfgdUTEW6E9u55EQhvWPBiW0kL+qKuzStWH7y Ecp4MmkG+iIKqDrLhVNeC/BmgoLjxWNeJ5nbOGl/+qDe9jc9WEe3QSVU0gpACmEaCuDw Ms5EuEa1FAQRqvBevylhb0/gN3WOz+9x57TsKh5sfUzMO8d4rkWnniNJJESsY7YeO2yS CdJD8QADtgHFwzEnswxxT3QKafUBhhiA6W6zz4IgBr7mqrLaoC0xmLa9enaNcaQoU6P7 mTYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710582368; x=1711187168; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Fd/UYSinQFLXB7b7RayERbmP2J/ErjoE+16L+UoVOvU=; b=UDrQi9G/F25rKUogpHrHvgqammugQIYgdO5MWABzsFJTovNa5jnAjCinTcEErxnCHo JXxKWjuJmAAvZLhpakC21Zg4e067k3jHmTunkYDkrZmuAYOxOkD1Xa8fNyn9agihc8jf +1BXP2+6LJdbV6w/MfKjX13jI1b0VO1kGfalCRRh93V4aRcmM39Jgjkl03b5o/AqrHul xD9xF2rqrxGVAVFSeOXb6svQwslu7SUofb0P7G6QQ1KtMt9T6lQVOPns4c63ZRPrrpaL dKuVCowQMyS7zz3fU68IOLwvvZB1kYItKAR0zqR6jSkokEbsVKqZBHm12+WMxxDRAO6X HTUQ== X-Forwarded-Encrypted: i=1; AJvYcCWqKQwbHaKsmGhuLZ4h5HwZLZtadoG1O6G7llzl0YQ8SkmBFpBcDb1bI84F7Y1KKJAgGKP/hH+XUvJ4v+1vXEII3zRgJFNAv9t1Wps0 X-Gm-Message-State: AOJu0YyNTmXMbYKN6o/BCIbOlialFV4yR4/7Vo1d4dA9v6haCfPuFYwr Ka6SiGuT/SNkSOpZnGdzVBBXXxu4xDfGi8oNssSG5HkveO7AmecxMMBBXhhsdZo= X-Received: by 2002:a05:600c:1c08:b0:413:fe9d:eaa5 with SMTP id j8-20020a05600c1c0800b00413fe9deaa5mr3500066wms.26.1710582367577; Sat, 16 Mar 2024 02:46:07 -0700 (PDT) Received: from localhost ([102.222.70.76]) by smtp.gmail.com with ESMTPSA id e15-20020a05600c4e4f00b004140893c0dbsm1026028wmq.17.2024.03.16.02.46.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Mar 2024 02:46:07 -0700 (PDT) Date: Sat, 16 Mar 2024 12:46:03 +0300 From: Dan Carpenter To: Ido Schimmel Cc: 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: [PATCH net] nexthop: fix uninitialized variable in nla_put_nh_group_stats() Message-ID: 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 X-Mailer: git-send-email haha only kidding 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; int err; int i; -- 2.43.0