aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2012-06-28 05:56:52 -0400
committerAntonio Quartulli <ordex@autistici.org>2012-07-01 16:47:24 -0400
commit162d549c6905485262635fe594db337efb2828b5 (patch)
tree85346674b2ff741ec9053470736ba2d034156190 /net/batman-adv
parent0c5e45b63d22c6efa6f829c617d8f36688e53c5d (diff)
batman-adv: Don't leak information through uninitialized packet fields
The reserved fields in batman-adv packets are not set to a constant value. The content of these memory regions is leaked unintentionally to the network. This regression was introduced in 3b27ffb00fbe9d9189715ea13ce8712e2f0cb0c5 Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Diffstat (limited to 'net/batman-adv')
-rw-r--r--net/batman-adv/soft-interface.c1
-rw-r--r--net/batman-adv/translation-table.c1
-rw-r--r--net/batman-adv/vis.c2
3 files changed, 4 insertions, 0 deletions
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index b7c655cf626a..9e4bb61301ec 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -214,6 +214,7 @@ static int batadv_interface_tx(struct sk_buff *skb,
214 214
215 /* batman packet type: broadcast */ 215 /* batman packet type: broadcast */
216 bcast_packet->header.packet_type = BATADV_BCAST; 216 bcast_packet->header.packet_type = BATADV_BCAST;
217 bcast_packet->reserved = 0;
217 218
218 /* hw address of first interface is the orig mac because only 219 /* hw address of first interface is the orig mac because only
219 * this mac is known throughout the mesh 220 * this mac is known throughout the mesh
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index 245cc9a068d8..a438f4b582fc 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -2052,6 +2052,7 @@ static void batadv_send_roam_adv(struct batadv_priv *bat_priv, uint8_t *client,
2052 roam_adv_packet->header.packet_type = BATADV_ROAM_ADV; 2052 roam_adv_packet->header.packet_type = BATADV_ROAM_ADV;
2053 roam_adv_packet->header.version = BATADV_COMPAT_VERSION; 2053 roam_adv_packet->header.version = BATADV_COMPAT_VERSION;
2054 roam_adv_packet->header.ttl = BATADV_TTL; 2054 roam_adv_packet->header.ttl = BATADV_TTL;
2055 roam_adv_packet->reserved = 0;
2055 primary_if = batadv_primary_if_get_selected(bat_priv); 2056 primary_if = batadv_primary_if_get_selected(bat_priv);
2056 if (!primary_if) 2057 if (!primary_if)
2057 goto out; 2058 goto out;
diff --git a/net/batman-adv/vis.c b/net/batman-adv/vis.c
index f09cc9ad6ad8..2a2ea0681469 100644
--- a/net/batman-adv/vis.c
+++ b/net/batman-adv/vis.c
@@ -589,6 +589,7 @@ static int batadv_generate_vis_packet(struct batadv_priv *bat_priv)
589 packet->header.ttl = BATADV_TTL; 589 packet->header.ttl = BATADV_TTL;
590 packet->seqno = htonl(ntohl(packet->seqno) + 1); 590 packet->seqno = htonl(ntohl(packet->seqno) + 1);
591 packet->entries = 0; 591 packet->entries = 0;
592 packet->reserved = 0;
592 skb_trim(info->skb_packet, sizeof(*packet)); 593 skb_trim(info->skb_packet, sizeof(*packet));
593 594
594 if (packet->vis_type == BATADV_VIS_TYPE_CLIENT_UPDATE) { 595 if (packet->vis_type == BATADV_VIS_TYPE_CLIENT_UPDATE) {
@@ -890,6 +891,7 @@ int batadv_vis_init(struct batadv_priv *bat_priv)
890 packet->header.packet_type = BATADV_VIS; 891 packet->header.packet_type = BATADV_VIS;
891 packet->header.ttl = BATADV_TTL; 892 packet->header.ttl = BATADV_TTL;
892 packet->seqno = 0; 893 packet->seqno = 0;
894 packet->reserved = 0;
893 packet->entries = 0; 895 packet->entries = 0;
894 896
895 INIT_LIST_HEAD(&bat_priv->vis_send_list); 897 INIT_LIST_HEAD(&bat_priv->vis_send_list);