netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Moshe Shemesh <moshe@nvidia.com>, Jiri Pirko <jiri@nvidia.com>,
	Jakub Kicinski <kuba@kernel.org>, Sasha Levin <sashal@kernel.org>,
	davem@davemloft.net, edumazet@google.com, pabeni@redhat.com,
	idosch@nvidia.com, jacob.e.keller@intel.com,
	michal.wilczynski@intel.com, vikas.gupta@broadcom.com,
	shayd@nvidia.com, netdev@vger.kernel.org
Subject: [PATCH AUTOSEL 5.10 27/27] devlink: health: Fix nla_nest_end in error flow
Date: Sun, 26 Feb 2023 09:50:14 -0500	[thread overview]
Message-ID: <20230226145014.828855-27-sashal@kernel.org> (raw)
In-Reply-To: <20230226145014.828855-1-sashal@kernel.org>

From: Moshe Shemesh <moshe@nvidia.com>

[ Upstream commit bfd4e6a5dbbc12f77620602e764ac940ccb159de ]

devlink_nl_health_reporter_fill() error flow calls nla_nest_end(). Fix
it to call nla_nest_cancel() instead.

Note the bug is harmless as genlmsg_cancel() cancel the entire message,
so no fixes tag added.

Signed-off-by: Moshe Shemesh <moshe@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/core/devlink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/devlink.c b/net/core/devlink.c
index 72047750dcd96..4fccd27a6082e 100644
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -6093,7 +6093,7 @@ devlink_nl_health_reporter_fill(struct sk_buff *msg,
 	return 0;
 
 reporter_nest_cancel:
-	nla_nest_end(msg, reporter_attr);
+	nla_nest_cancel(msg, reporter_attr);
 genlmsg_cancel:
 	genlmsg_cancel(msg, hdr);
 	return -EMSGSIZE;
-- 
2.39.0


      parent reply	other threads:[~2023-02-26 14:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-26 14:49 [PATCH AUTOSEL 5.10 01/27] wifi: ath9k: Fix use-after-free in ath9k_hif_usb_disconnect() Sasha Levin
2023-02-26 14:49 ` [PATCH AUTOSEL 5.10 02/27] wifi: brcmfmac: Fix potential stack-out-of-bounds in brcmf_c_preinit_dcmds() Sasha Levin
2023-02-26 14:49 ` [PATCH AUTOSEL 5.10 06/27] wifi: ath11k: debugfs: fix to work with multiple PCI devices Sasha Levin
2023-02-26 14:49 ` [PATCH AUTOSEL 5.10 10/27] wifi: brcmfmac: ensure CLM version is null-terminated to prevent stack-out-of-bounds Sasha Levin
2023-02-26 14:49 ` [PATCH AUTOSEL 5.10 11/27] wifi: mt7601u: fix an integer underflow Sasha Levin
2023-02-26 14:49 ` [PATCH AUTOSEL 5.10 12/27] inet: fix fast path in __inet_hash_connect() Sasha Levin
2023-02-26 14:50 ` [PATCH AUTOSEL 5.10 13/27] ice: add missing checks for PF vsi type Sasha Levin
2023-02-26 14:50 ` [PATCH AUTOSEL 5.10 17/27] netpoll: Remove 4s sleep during carrier detection Sasha Levin
2023-02-26 14:50 ` [PATCH AUTOSEL 5.10 18/27] net: bcmgenet: Add a check for oversized packets Sasha Levin
2023-02-26 14:50 ` [PATCH AUTOSEL 5.10 20/27] wifi: mt76: dma: free rx_head in mt76_dma_rx_cleanup Sasha Levin
2023-02-26 14:50 ` [PATCH AUTOSEL 5.10 22/27] net/mlx5: fw_tracer: Fix debug print Sasha Levin
2023-02-26 14:50 ` Sasha Levin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230226145014.828855-27-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=idosch@nvidia.com \
    --cc=jacob.e.keller@intel.com \
    --cc=jiri@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.wilczynski@intel.com \
    --cc=moshe@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shayd@nvidia.com \
    --cc=stable@vger.kernel.org \
    --cc=vikas.gupta@broadcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).