netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Patch nf] ipvs: initialize tbl->entries after allocation
@ 2018-04-23 20:53 Cong Wang
  2018-04-24  5:16 ` Julian Anastasov
  0 siblings, 1 reply; 4+ messages in thread
From: Cong Wang @ 2018-04-23 20:53 UTC (permalink / raw)
  To: netdev
  Cc: lvs-devel, netfilter-devel, Cong Wang, Simon Horman,
	Julian Anastasov, Pablo Neira Ayuso

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: <syzbot+3dfdea57819073a04f21@syzkaller.appspotmail.com>
Cc: Simon Horman <horms@verge.net.au>
Cc: Julian Anastasov <ja@ssi.bg>
Cc: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
---
 net/netfilter/ipvs/ip_vs_lblcr.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/netfilter/ipvs/ip_vs_lblcr.c b/net/netfilter/ipvs/ip_vs_lblcr.c
index 92adc04557ed..bc2bc5eebcb8 100644
--- a/net/netfilter/ipvs/ip_vs_lblcr.c
+++ b/net/netfilter/ipvs/ip_vs_lblcr.c
@@ -534,6 +534,7 @@ static int ip_vs_lblcr_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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-04-26 22:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-23 20:53 [Patch nf] ipvs: initialize tbl->entries after allocation Cong Wang
2018-04-24  5:16 ` Julian Anastasov
2018-04-26 12:14   ` Simon Horman
2018-04-26 22:21     ` Pablo Neira Ayuso

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).