d174008
From a5cc68f3d63306d0d288f31edfc2ae6ef8ecd887 Mon Sep 17 00:00:00 2001
d174008
From: Mathias Krause <minipli@googlemail.com>
d174008
Date: Wed, 26 Jun 2013 21:52:30 +0000
d174008
Subject: af_key: fix info leaks in notify messages
d174008
d174008
key_notify_sa_flush() and key_notify_policy_flush() miss to initialize
d174008
the sadb_msg_reserved member of the broadcasted message and thereby
d174008
leak 2 bytes of heap memory to listeners. Fix that.
d174008
d174008
Signed-off-by: Mathias Krause <minipli@googlemail.com>
d174008
Cc: Steffen Klassert <steffen.klassert@secunet.com>
d174008
Cc: "David S. Miller" <davem@davemloft.net>
d174008
Cc: Herbert Xu <herbert@gondor.apana.org.au>
d174008
Signed-off-by: David S. Miller <davem@davemloft.net>
d174008
---
d174008
diff --git a/net/key/af_key.c b/net/key/af_key.c
d174008
index c5fbd75..9da8620 100644
d174008
--- a/net/key/af_key.c
d174008
+++ b/net/key/af_key.c
d174008
@@ -1710,6 +1710,7 @@ static int key_notify_sa_flush(const struct km_event *c)
d174008
 	hdr->sadb_msg_version = PF_KEY_V2;
d174008
 	hdr->sadb_msg_errno = (uint8_t) 0;
d174008
 	hdr->sadb_msg_len = (sizeof(struct sadb_msg) / sizeof(uint64_t));
d174008
+	hdr->sadb_msg_reserved = 0;
d174008
 
d174008
 	pfkey_broadcast(skb, GFP_ATOMIC, BROADCAST_ALL, NULL, c->net);
d174008
 
d174008
@@ -2699,6 +2700,7 @@ static int key_notify_policy_flush(const struct km_event *c)
d174008
 	hdr->sadb_msg_errno = (uint8_t) 0;
d174008
 	hdr->sadb_msg_satype = SADB_SATYPE_UNSPEC;
d174008
 	hdr->sadb_msg_len = (sizeof(struct sadb_msg) / sizeof(uint64_t));
d174008
+	hdr->sadb_msg_reserved = 0;
d174008
 	pfkey_broadcast(skb_out, GFP_ATOMIC, BROADCAST_ALL, NULL, c->net);
d174008
 	return 0;
d174008
 
d174008
--
d174008
cgit v0.9.2