ipvs: add missing ip_vs_pe_put in sync code
authorJulian Anastasov <ja@ssi.bg>
Sat, 21 Feb 2015 19:03:10 +0000 (21:03 +0200)
committerDanny Wood <danwood76@gmail.com>
Tue, 29 Jan 2019 13:07:28 +0000 (13:07 +0000)
commit4dca2f9a259d236c88da96057a701f05fc005e67
tree317aa1ac15fb9af2834023e40aca882a6a7e4955
parentd30017e456d55eb633f6a10ccc2f50f1d94e323e
ipvs: add missing ip_vs_pe_put in sync code

commit 528c943f3bb919aef75ab2fff4f00176f09a4019 upstream.

ip_vs_conn_fill_param_sync() gets in param.pe a module
reference for persistence engine from __ip_vs_pe_getbyname()
but forgets to put it. Problem occurs in backup for
sync protocol v1 (2.6.39).

Also, pe_data usually comes in sync messages for
connection templates and ip_vs_conn_new() copies
the pointer only in this case. Make sure pe_data
is not leaked if it comes unexpectedly for normal
connections. Leak can happen only if bogus messages
are sent to backup server.

Fixes: fe5e7a1efb66 ("IPVS: Backup, Adding Version 1 receive capability")
Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/netfilter/ipvs/ip_vs_sync.c