batman-adv: Fix invalid read while copying bat_iv.bcast_own
authorSven Eckelmann <sven@narfation.org>
Sun, 29 Nov 2015 00:48:57 +0000 (01:48 +0100)
committerAntonio Quartulli <a@unstable.cc>
Thu, 7 Jan 2016 06:24:05 +0000 (14:24 +0800)
commit13bbdd370f67aef3351ad7bbc2fb624e3c23f905
treeacd51cfcb64861c0a2e6c67e85eabeab0db36fea
parent51cb67c0b0fcb91581b15bd2e85f29af4d4b2df6
batman-adv: Fix invalid read while copying bat_iv.bcast_own

batadv_iv_ogm_orig_del_if removes a part of the bcast_own which previously
belonged to the now removed interface. This is done by copying all data
which comes before the removed interface and then appending all the data
which comes after the removed interface.

The address calculation for the position of the data which comes after the
removed interface assumed that the bat_iv.bcast_own is a pointer to a
single byte datatype. But it is a pointer to unsigned long and thus the
calculated position was wrong off factor sizeof(unsigned long).

Fixes: 83a8342678a0 ("more basic routing code added (forwarding packets /
bitarray added)")

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <a@unstable.cc>
net/batman-adv/bat_iv_ogm.c