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 4F89D18454A; Tue, 30 Jul 2024 17:09:48 +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=1722359388; cv=none; b=NvWNHdi6rFhOr4g9qm4juYGBAs93f89Dw8SzbrU9FeemDcUjRbnIL/lR733zInkalpG65Zv41GkQmhTpKc9ScTV/mxfGoTKWI3w/TI8njFy7KKuz9bNr/zOj40ArUREjrnklMWmTVgvengElUTM3W2/eNxPgEhcRXMAYKSMLkqg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722359388; c=relaxed/simple; bh=zN3vu+5quAQMCNDCtnmSKfLYV9LCRk+BpM9ikwxLkyU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hFyKtBF24fgbRaEbpUiVz0TStL4nGKCR3ytvovya+LBVo9R/HqZQt3EOqMys6MwRHqfOCfK5tJetjjub7KFEpe8zj7GpS59ppqviJXXAQS08gvcPsaL0Y7hSyFST53R3Yo4jl4xhPjWXCGpIPchJEj8YlUiaFv5ymv6xZPdP9F0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=p9q8wcjS; 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="p9q8wcjS" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 76FE0C32782; Tue, 30 Jul 2024 17:09:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1722359387; bh=zN3vu+5quAQMCNDCtnmSKfLYV9LCRk+BpM9ikwxLkyU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p9q8wcjS4E32+vA8vJ3axjDvRBqYDoloeC+EyLKefwHIrktx1tCLU0/IdNuLB+3/9 unt5XhqVQpw5iQwmwce9i+YKaWpdYW7EfvAZUlFi0tek5TfErP8/sCL501kfTzRl8V 59P0ILq5w+GNzMX+yu3oJXdb5P0hbjkJpLwjaMZ0= 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.10 477/809] ipvs: properly dereference pe in ip_vs_add_service Date: Tue, 30 Jul 2024 17:45:53 +0200 Message-ID: <20240730151743.575550136@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240730151724.637682316@linuxfoundation.org> References: <20240730151724.637682316@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.10-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 b6d0dcf3a5c34..f4384e147ee16 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