From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cong Wang Subject: [Patch nf] ipvs: initialize tbl->entries in ip_vs_lblc_init_svc() Date: Mon, 23 Apr 2018 14:04:45 -0700 Message-ID: <20180423210445.18336-1-xiyou.wangcong@gmail.com> Cc: lvs-devel@vger.kernel.org, netfilter-devel@vger.kernel.org, Cong Wang , Simon Horman , Julian Anastasov , Pablo Neira Ayuso To: netdev@vger.kernel.org Return-path: Received: from mail-pg0-f67.google.com ([74.125.83.67]:33434 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932157AbeDWVFV (ORCPT ); Mon, 23 Apr 2018 17:05:21 -0400 Sender: netdev-owner@vger.kernel.org List-ID: Similarly, tbl->entries is not initialized after kmalloc(), therefore causes an uninit-value warning in ip_vs_lblc_check_expire(), as reported by syzbot. Reported-by: Cc: Simon Horman Cc: Julian Anastasov Cc: Pablo Neira Ayuso Signed-off-by: Cong Wang --- net/netfilter/ipvs/ip_vs_lblc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/netfilter/ipvs/ip_vs_lblc.c b/net/netfilter/ipvs/ip_vs_lblc.c index 3057e453bf31..83918119ceb8 100644 --- a/net/netfilter/ipvs/ip_vs_lblc.c +++ b/net/netfilter/ipvs/ip_vs_lblc.c @@ -371,6 +371,7 @@ static int ip_vs_lblc_init_svc(struct ip_vs_service *svc) tbl->counter = 1; tbl->dead = false; tbl->svc = svc; + atomic_set(&tbl->entries, 0); /* * Hook periodic timer for garbage collection -- 2.13.0