Skip to content

Commit 08c27f3

Browse files
Tetsuo Handadavem330
authored andcommitted
batman-adv: initialize "struct batadv_tvlv_tt_vlan_data"->reserved field
KMSAN found uninitialized value at batadv_tt_prepare_tvlv_local_data() [1], for commit ced7293 ("batman-adv: use CRC32C instead of CRC16 in TT code") inserted 'reserved' field into "struct batadv_tvlv_tt_data" and commit 7ea7b4a ("batman-adv: make the TT CRC logic VLAN specific") moved that field to "struct batadv_tvlv_tt_vlan_data" but left that field uninitialized. [1] https://syzkaller.appspot.com/bug?id=07f3e6dba96f0eb3cabab986adcd8a58b9bdbe9d Reported-by: syzbot <[email protected]> Tested-by: syzbot <[email protected]> Signed-off-by: Tetsuo Handa <[email protected]> Fixes: ced7293 ("batman-adv: use CRC32C instead of CRC16 in TT code") Fixes: 7ea7b4a ("batman-adv: make the TT CRC logic VLAN specific") Acked-by: Sven Eckelmann <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 22f69de commit 08c27f3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

net/batman-adv/translation-table.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -890,6 +890,7 @@ batadv_tt_prepare_tvlv_global_data(struct batadv_orig_node *orig_node,
890890
hlist_for_each_entry(vlan, &orig_node->vlan_list, list) {
891891
tt_vlan->vid = htons(vlan->vid);
892892
tt_vlan->crc = htonl(vlan->tt.crc);
893+
tt_vlan->reserved = 0;
893894

894895
tt_vlan++;
895896
}
@@ -973,6 +974,7 @@ batadv_tt_prepare_tvlv_local_data(struct batadv_priv *bat_priv,
973974

974975
tt_vlan->vid = htons(vlan->vid);
975976
tt_vlan->crc = htonl(vlan->tt.crc);
977+
tt_vlan->reserved = 0;
976978

977979
tt_vlan++;
978980
}

0 commit comments

Comments
 (0)