public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
From: Sven Eckelmann <sven@narfation.org>
To: b.a.t.m.a.n@lists.open-mesh.org
Subject: [B.A.T.M.A.N.] [PATCHv2 2/2] batctl: Don't leak information through uninitialized packet fields
Date: Thu, 28 Jun 2012 11:56:53 +0200	[thread overview]
Message-ID: <1340877413-18434-2-git-send-email-sven@narfation.org> (raw)
In-Reply-To: <1340877413-18434-1-git-send-email-sven@narfation.org>

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 ee319368e5d6385458345731e519640889c177c4

Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
Based on next and fixed commit title

 ping.c       |    2 ++
 traceroute.c |    1 +
 2 files changed, 3 insertions(+)

diff --git a/ping.c b/ping.c
index 85b4137..b6199c6 100644
--- a/ping.c
+++ b/ping.c
@@ -174,6 +174,8 @@ int ping(char *mesh_iface, int argc, char **argv)
 		icmp_packet_out.rr_cur = 1;
 		memset(&icmp_packet_out.rr, 0, BATADV_RR_LEN * ETH_ALEN);
 		memset(last_rr, 0, BATADV_RR_LEN * ETH_ALEN);
+	} else {
+		((struct batadv_icmp_packet *)&icmp_packet_out)->reserved = 0;
 	}
 
 	printf("PING %s (%s) %zu(%zu) bytes of data\n", dst_string, mac_string,
diff --git a/traceroute.c b/traceroute.c
index 31f77b0..aae9fa7 100644
--- a/traceroute.c
+++ b/traceroute.c
@@ -125,6 +125,7 @@ int traceroute(char *mesh_iface, int argc, char **argv)
 	icmp_packet_out.header.packet_type = BATADV_ICMP;
 	icmp_packet_out.msg_type = BATADV_ECHO_REQUEST;
 	icmp_packet_out.seqno = 0;
+	icmp_packet_out.reserved = 0;
 
 	printf("traceroute to %s (%s), %d hops max, %zu byte packets\n",
 		dst_string, mac_string, TTL_MAX, sizeof(icmp_packet_out));
-- 
1.7.10


  reply	other threads:[~2012-06-28  9:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-27 20:28 [B.A.T.M.A.N.] [PATCH 1/2] batctl: Don't leak information through initialized packet fields Sven Eckelmann
2012-06-27 20:28 ` [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: " Sven Eckelmann
2012-06-28  9:56 ` [B.A.T.M.A.N.] [PATCHv2 1/1] batman-adv: Don't leak information through uninitialized " Sven Eckelmann
2012-06-28  9:56   ` Sven Eckelmann [this message]
2012-06-30 12:25     ` [B.A.T.M.A.N.] [PATCHv2 2/2] batctl: " Marek Lindner
2012-06-30 12:21   ` [B.A.T.M.A.N.] [PATCHv2 1/1] batman-adv: " Marek Lindner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1340877413-18434-2-git-send-email-sven@narfation.org \
    --to=sven@narfation.org \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox