* [B.A.T.M.A.N.] [RFC] batman-adv: Fix invalid stack access in batadv_dat_select_candidates
@ 2015-10-20 12:01 Sven Eckelmann
2015-10-28 9:10 ` Antonio Quartulli
0 siblings, 1 reply; 2+ messages in thread
From: Sven Eckelmann @ 2015-10-20 12:01 UTC (permalink / raw)
To: b.a.t.m.a.n; +Cc: Sven Eckelmann, Antonio Quartulli
From: Sven Eckelmann <sven@open-mesh.com>
batadv_dat_select_candidates provides an u32 to batadv_hash_dat but it
needs a batadv_dat_entry with at least ip and vid filled in.
Signed-off-by: Sven Eckelmann <sven@open-mesh.com>
Cc: Antonio Quartulli <antonio@open-mesh.com>
---
distributed-arp-table.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/distributed-arp-table.c b/distributed-arp-table.c
index b9efeba..935af1e 100644
--- a/net/batman-adv/distributed-arp-table.c
+++ b/net/batman-adv/distributed-arp-table.c
@@ -533,6 +533,7 @@ batadv_dat_select_candidates(struct batadv_priv *bat_priv, __be32 ip_dst)
int select;
batadv_dat_addr_t last_max = BATADV_DAT_ADDR_MAX, ip_key;
struct batadv_dat_candidate *res;
+ struct batadv_dat_entry dat;
if (!bat_priv->orig_hash)
return NULL;
@@ -541,7 +542,9 @@ batadv_dat_select_candidates(struct batadv_priv *bat_priv, __be32 ip_dst)
if (!res)
return NULL;
- ip_key = (batadv_dat_addr_t)batadv_hash_dat(&ip_dst,
+ dat.ip = ip_dst;
+ dat.vid = 0;
+ ip_key = (batadv_dat_addr_t)batadv_hash_dat(&dat,
BATADV_DAT_ADDR_MAX);
batadv_dbg(BATADV_DBG_DAT, bat_priv,
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-10-28 9:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-20 12:01 [B.A.T.M.A.N.] [RFC] batman-adv: Fix invalid stack access in batadv_dat_select_candidates Sven Eckelmann
2015-10-28 9:10 ` Antonio Quartulli
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox