From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BEDF41448FA; Tue, 30 Jul 2024 16:46:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722357962; cv=none; b=eI7UnWOEZ+qzb6CYnmkj25vEyQJ+7WKDRBLZvqrUCoVWkraMbE0/3+fYKKn5LQ9egycZPni+bJj7l3KMzGlo2OerwWJk9y8unpSC6Nbsdq0bndhSQX2fybk7BBpRv7SHW169XJsIeawvoT5Xe085hWEiI7yJ+f4qjQxxjadheWU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722357962; c=relaxed/simple; bh=BaOHbBPbA7qvskbYxpgnYssoHqis89wbXTrXSfubzz8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bXRRQYgczchFJovlAOKWNITsZXG7T7dWsGEkgGQJMw7bG+xb+ceey2c8/kQoVcHD5v6T8vTzyYiY9s8xcJ0v/J6mfM6TVoBjIFy0l0Tj+TldECfa5cWlK8tXi6X+DaM/0WmV6XcjZW4McV3C432Cu5TvyAuBe/CuFxTwGZdJVZY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=wLVsgC3s; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="wLVsgC3s" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3BAE4C32782; Tue, 30 Jul 2024 16:46:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1722357962; bh=BaOHbBPbA7qvskbYxpgnYssoHqis89wbXTrXSfubzz8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wLVsgC3soFD3gsvDeGxsglKlGayMCqq9OQZCWZrZzr6+l4gkf6Kd/TfqRogwNRZfq nIJjJIBsvKroeeRLnY8+N4tEb3Nl+pI9+UNmY3x3W4mbfwvwRM28vbMZHVTIqQH3lL dMoYeVv9lxOX0kfZ6+LhPZKfS//PSDHyQyUS5zXo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Chen Hanxiao , Julian Anastasov , Simon Horman , Pablo Neira Ayuso , Sasha Levin Subject: [PATCH 6.6 312/568] ipvs: properly dereference pe in ip_vs_add_service Date: Tue, 30 Jul 2024 17:46:59 +0200 Message-ID: <20240730151652.066370342@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240730151639.792277039@linuxfoundation.org> References: <20240730151639.792277039@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Chen Hanxiao [ Upstream commit cbd070a4ae62f119058973f6d2c984e325bce6e7 ] Use pe directly to resolve sparse warning: net/netfilter/ipvs/ip_vs_ctl.c:1471:27: warning: dereference of noderef expression Fixes: 39b972231536 ("ipvs: handle connections started by real-servers") Signed-off-by: Chen Hanxiao Acked-by: Julian Anastasov Acked-by: Simon Horman Signed-off-by: Pablo Neira Ayuso Signed-off-by: Sasha Levin --- net/netfilter/ipvs/ip_vs_ctl.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c index 143a341bbc0a4..dec5309d9f1f5 100644 --- a/net/netfilter/ipvs/ip_vs_ctl.c +++ b/net/netfilter/ipvs/ip_vs_ctl.c @@ -1459,18 +1459,18 @@ ip_vs_add_service(struct netns_ipvs *ipvs, struct ip_vs_service_user_kern *u, if (ret < 0) goto out_err; - /* Bind the ct retriever */ - RCU_INIT_POINTER(svc->pe, pe); - pe = NULL; - /* Update the virtual service counters */ if (svc->port == FTPPORT) atomic_inc(&ipvs->ftpsvc_counter); else if (svc->port == 0) atomic_inc(&ipvs->nullsvc_counter); - if (svc->pe && svc->pe->conn_out) + if (pe && pe->conn_out) atomic_inc(&ipvs->conn_out_counter); + /* Bind the ct retriever */ + RCU_INIT_POINTER(svc->pe, pe); + pe = NULL; + /* Count only IPv4 services for old get/setsockopt interface */ if (svc->af == AF_INET) ipvs->num_services++; -- 2.43.0