Skip to content

Commit 34673c2

Browse files
ecsvgregkh
authored andcommitted
batman-adv: Avoid probe ELP information leak
commit 88d0895 upstream. The probe ELPs for WiFi interfaces are expanded to contain at least BATADV_ELP_MIN_PROBE_SIZE bytes. This is usually a lot more than the number of bytes which the template ELP packet requires. These extra padding bytes were not initialized and thus could contain data which were previously stored at the same location. It is therefore required to set it to some predefined or random values to avoid leaking private information from the system transmitting these kind of packets. Fixes: e4623c913508 ("batman-adv: Avoid probe ELP information leak") Signed-off-by: Sven Eckelmann <[email protected]> Acked-by: Antonio Quartulli <[email protected]> Signed-off-by: Simon Wunderlich <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 3c6ed31 commit 34673c2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

net/batman-adv/bat_v_elp.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ batadv_v_elp_wifi_neigh_probe(struct batadv_hardif_neigh_node *neigh)
191191
struct sk_buff *skb;
192192
int probe_len, i;
193193
int elp_skb_len;
194+
void *tmp;
194195

195196
/* this probing routine is for Wifi neighbours only */
196197
if (!batadv_is_wifi_netdev(hard_iface->net_dev))
@@ -222,7 +223,8 @@ batadv_v_elp_wifi_neigh_probe(struct batadv_hardif_neigh_node *neigh)
222223
* the packet to be exactly of that size to make the link
223224
* throughput estimation effective.
224225
*/
225-
skb_put(skb, probe_len - hard_iface->bat_v.elp_skb->len);
226+
tmp = skb_put(skb, probe_len - hard_iface->bat_v.elp_skb->len);
227+
memset(tmp, 0, probe_len - hard_iface->bat_v.elp_skb->len);
226228

227229
batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
228230
"Sending unicast (probe) ELP packet on interface %s to %pM\n",

0 commit comments

Comments
 (0)