Re: [syzbot] [net?] KMSAN: uninit-value in hsr_get_node (2)

From: Edward Adam Davis
Date: Mon Jan 15 2024 - 07:58:51 EST


please test uninit-value in hsr_get_node

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 9f8413c4a66f

diff --git a/net/hsr/hsr_framereg.c b/net/hsr/hsr_framereg.c
index 6d14d935ee82..280dca33ec4f 100644
--- a/net/hsr/hsr_framereg.c
+++ b/net/hsr/hsr_framereg.c
@@ -209,6 +209,8 @@ struct hsr_node *hsr_get_node(struct hsr_port *port, struct list_head *node_db,
return NULL;

ethhdr = (struct ethhdr *)skb_mac_header(skb);
+ if (!is_valid_ether_addr(ethhdr->h_source))
+ eth_zero_addr(ethhdr->h_source);

list_for_each_entry_rcu(node, node_db, mac_list) {
if (ether_addr_equal(node->macaddress_A, ethhdr->h_source)) {