ipvs: fix info leak in getsockopt(IP_VS_SO_GET_TIMEOUT)
authorMathias Krause <minipli@googlemail.com>
Wed, 15 Aug 2012 11:31:56 +0000 (11:31 +0000)
committerWilly Tarreau <w@1wt.eu>
Mon, 10 Jun 2013 09:43:39 +0000 (11:43 +0200)
commit75ca20885ed80079d507fddda00b805e88258094
tree308b7bb56b783512410d85bff78e7dcbe8103777
parent9df2c9ad3bafd141a5e76b3d695aed0e37fac5c4
ipvs: fix info leak in getsockopt(IP_VS_SO_GET_TIMEOUT)

commit 2d8a041b7bfe1097af21441cb77d6af95f4f4680 upstream.

If at least one of CONFIG_IP_VS_PROTO_TCP or CONFIG_IP_VS_PROTO_UDP is
not set, __ip_vs_get_timeouts() does not fully initialize the structure
that gets copied to userland and that for leaks up to 12 bytes of kernel
stack. Add an explicit memset(0) before passing the structure to
__ip_vs_get_timeouts() to avoid the info leak.

Signed-off-by: Mathias Krause <minipli@googlemail.com>
Cc: Wensong Zhang <wensong@linux-vs.org>
Cc: Simon Horman <horms@verge.net.au>
Cc: Julian Anastasov <ja@ssi.bg>
Signed-off-by: David S. Miller <davem@davemloft.net>
[bwh: Backported to 2.6.32: adjust context]
Signed-off-by: Willy Tarreau <w@1wt.eu>
net/netfilter/ipvs/ip_vs_ctl.c