Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795033233; b=Q+4wav2lrkdpSQKb/H84qUrFTCfQfQ40aMH4X78H5rJN3sbxyp8fBp78Z7q22pZlw0gq dUXZXCaW9eHf+sdeor7NU6pbdmdvQlH5FL8TPrHSCloE33IwvZEmGpmkhaJo87EzimxLt 7VkYLfLsuTNbZnkdxJamSJu5V6v9khfw0KoPvE3e73HHiiBT+BWiZxfxIv5UhVfKwTh6b SMe1AQ1BBAv6wrRk46RFW2Sz3mB+8h8Ps4nXxkuGUL3ney8VF4akhGLOUC4NXJgKtjsI/ Wd58nNKfMjW0jhWNSVlcETlGGJbMEN+v4Vi6IigtzGCPJA/Q0ud1ES1dIUBRjioJXow== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795033233; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=6MoQ5tP1fGRtqd/dAQxlxv9gK9ZAfh1qnEyu9z368BQ=; b=l5259g7+lLd33lLYIta3WDDBTukq0QRv1Rh0LNB5+cXxwwfNFU8kXT35wGhJySgtVzx+ W4pvJlJpQuooBWX4VGOcuUgKXpxVF/kmtGgjUX5osrwjkF44QzRezSIQ6TvayuMsyMPgk a1fyqacZSnIOyjPqMPRDMd3ytDBeiMfCj2gPsImDYnkDOWS0vTNsofNIF1Al/fyKUc464 3VGvnWMgFi6GyE5Ga7Cqy8ur2oaCaOFRchvKpGr9knnBqdp1SceS/84wrI8Rw2AsSBWep t2GHKvT4RQRFkIoWIXAw6F97hrenBT7igE5b6FryiZ4jBkSNu0MNuViojrWKsjohz7w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=2Z2Kgi4I; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 51738606A320; Wed, 18 Nov 2026 20:20:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=2Z2Kgi4I Received: by smtp.kernel.org (Postfix) with ESMTPSA id 37EB91F000C4; Wed, 18 Nov 2026 20:20:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795033232; bh=6MoQ5tP1fGRtqd/dAQxlxv9gK9ZAfh1qnEyu9z368BQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=2Z2Kgi4IR0LF3Xm/STG+pgp2vNl2rXBIvqbszShVHWoPi3j3rhGaMkxBVupUkyPm1 XHiPNqSRdtjBH/pDDHOcq9Ouk+k//kE6snw9J/bzmM2zQOe/NW/n9sXskK6eoM+Lov eIkTI4Ivem+tSwK7jIw0mM3oU55Dae+AvsODcM8o= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Joas Antonio dos Santos , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.12 1652/1756] net: dcb: initialize PFC value before calling getpfccfg Date: Wed, 18 Nov 2026 16:02:59 +0100 Message-ID: <20261118150115.498719550@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261118150007.957976754@linuxfoundation.org> References: <20261118150007.957976754@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Joas Antonio dos Santos [ Upstream commit ca87a2dffbb550fc934647d5e8d1c4ae85590132 ] dcbnl_getpfccfg() and dcbnl_cee_fill() pass the address of an uninitialized stack u8 to the driver's getpfccfg() op and then put it into the netlink reply unconditionally. The op returns void, so the core cannot tell whether the driver wrote the value. i40e_dcbnl_get_pfc_cfg() and ice_dcbnl_get_pfc_cfg() return without writing *setting unless the DCBX agent is host managed and in CEE mode. Both drivers normally run with firmware managed DCBX (DCB_CAP_DCBX_LLD_MANAGED), and i40e with FW LLDP disabled runs host managed in IEEE mode, so on a DCB capable i40e/ice port the PFC values in DCB_CMD_PFC_GCFG and DCB_CMD_CEE_GET replies, and in the CEE part of RTNLGRP_DCB notifications, come from uninitialized stack. The same u8 is reused for all eight priorities, so this is one byte per reply. dcb_doit() only requires CAP_NET_ADMIN for RTM_SETDCB, so the GET commands are available to unprivileged users. Set the value to 0 before each call, like the PG config path already presets its outputs to DCB_ATTR_VALUE_UNDEFINED. 0 is also what the reply contains today on kernels built with CONFIG_INIT_STACK_ALL_ZERO, so nothing changes for those. Found by code inspection, compile-tested only (W=1). I don't have i40e/ice hardware to check the reply. Fixes: b94b013eb626 ("ice: Implement DCBNL support") Fixes: 5effa78e7c94 ("i40e: Add netlink callbacks support for software based DCB") Signed-off-by: Joas Antonio dos Santos Link: https://patch.msgid.link/179289284460.50470.572724041164324949@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- net/dcb/dcbnl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c index 2e6b8c8fd2ded..1d82a9cbc2c4c 100644 --- a/net/dcb/dcbnl.c +++ b/net/dcb/dcbnl.c @@ -281,6 +281,7 @@ static int dcbnl_getpfccfg(struct net_device *netdev, struct nlmsghdr *nlh, if (!getall && !data[i]) continue; + value = 0; netdev->dcbnl_ops->getpfccfg(netdev, i - DCB_PFC_UP_ATTR_0, &value); ret = nla_put_u8(skb, i, value); @@ -1396,6 +1397,7 @@ static int dcbnl_cee_fill(struct sk_buff *skb, struct net_device *netdev) goto nla_put_failure; for (i = DCB_PFC_UP_ATTR_0; i <= DCB_PFC_UP_ATTR_7; i++) { + value = 0; ops->getpfccfg(netdev, i - DCB_PFC_UP_ATTR_0, &value); if (nla_put_u8(skb, i, value)) goto nla_put_failure; -- 2.53.0