mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-05 17:13:47 +01:00
af_key: fix info leaks in notify messages
key_notify_sa_flush() and key_notify_policy_flush() miss to initialize the sadb_msg_reserved member of the broadcasted message and thereby leak 2 bytes of heap memory to listeners. Fix that. Signed-off-by: Mathias Krause <[email protected]> Cc: Steffen Klassert <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Herbert Xu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
1 parent
a963a37d38
commit
a5cc68f3d6
1 file changed
+2
@@ -1710,6 +1710,7 @@ static int key_notify_sa_flush(const struct km_event *c)
|
||||
hdr->sadb_msg_version = PF_KEY_V2;
|
||||
hdr->sadb_msg_errno = (uint8_t) 0;
|
||||
hdr->sadb_msg_len = (sizeof(struct sadb_msg) / sizeof(uint64_t));
|
||||
hdr->sadb_msg_reserved = 0;
|
||||
|
||||
pfkey_broadcast(skb, GFP_ATOMIC, BROADCAST_ALL, NULL, c->net);
|
||||
|
||||
@@ -2699,6 +2700,7 @@ static int key_notify_policy_flush(const struct km_event *c)
|
||||
hdr->sadb_msg_errno = (uint8_t) 0;
|
||||
hdr->sadb_msg_satype = SADB_SATYPE_UNSPEC;
|
||||
hdr->sadb_msg_len = (sizeof(struct sadb_msg) / sizeof(uint64_t));
|
||||
hdr->sadb_msg_reserved = 0;
|
||||
pfkey_broadcast(skb_out, GFP_ATOMIC, BROADCAST_ALL, NULL, c->net);
|
||||
return 0;
|
||||
|
||||
|
||||
Reference in new issue
Block a user