netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] af_key: initialize xfrm encap_oa
@ 2009-01-23 12:30 Timo Teras
  2009-01-23 22:11 ` Herbert Xu
  0 siblings, 1 reply; 3+ messages in thread
From: Timo Teras @ 2009-01-23 12:30 UTC (permalink / raw)
  To: netdev; +Cc: Timo Teras, Herbert Xu

Currently encap_oa is left uninitialized, so it contains garbage data which
is visible to userland via Netlink. Initialize it by zeroing it out.

Signed-off-by: Timo Teras <timo.teras@iki.fi>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
---
 net/key/af_key.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/net/key/af_key.c b/net/key/af_key.c
index f8bd8df..7dcbde3 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -1285,6 +1285,7 @@ static struct xfrm_state * pfkey_msg2xfrm_state(struct net *net,
 				ext_hdrs[SADB_X_EXT_NAT_T_DPORT-1];
 			natt->encap_dport = n_port->sadb_x_nat_t_port_port;
 		}
+		memset(&natt->encap_oa, 0, sizeof(natt->encap_oa));
 	}
 
 	err = xfrm_init_state(x);
-- 
1.5.6.3


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

end of thread, other threads:[~2009-01-26  4:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-23 12:30 [PATCH] af_key: initialize xfrm encap_oa Timo Teras
2009-01-23 22:11 ` Herbert Xu
2009-01-26  4:49   ` David Miller

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