[PATCH v1] net: hsr: align sup_multicast_addr in struct hsr_priv to u16 boundary

Subsystems: hsr network protocol, networking [general], the rest

STALE2014d LANDED

Landed in mainline as 6c9f18f294c4 on 2021-02-02.

2 messages, 2 authors, 2021-02-02 · open the first message on its own page

[PATCH v1] net: hsr: align sup_multicast_addr in struct hsr_priv to u16 boundary

From: Andreas Oetken <hidden>
Date: 2021-02-02 10:00:52

From: Andreas Oetken <redacted>

sup_multicast_addr is passed to ether_addr_equal for address comparison
which casts the address inputs to u16 leading to an unaligned access.
Aligning the sup_multicast_addr to u16 boundary fixes the issue.

Signed-off-by: Andreas Oetken <redacted>
---
 net/hsr/hsr_main.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/net/hsr/hsr_main.h b/net/hsr/hsr_main.h
index 7dc92ce5a134..a9c30a608e35 100644
--- a/net/hsr/hsr_main.h
+++ b/net/hsr/hsr_main.h
@@ -217,7 +217,10 @@ struct hsr_priv {
 	u8 net_id;		/* for PRP, it occupies most significant 3 bits
 				 * of lan_id
 				 */
-	unsigned char		sup_multicast_addr[ETH_ALEN];
+	unsigned char		sup_multicast_addr[ETH_ALEN] __aligned(sizeof(u16));
+				/* Align to u16 boundary to avoid unaligned access
+				 * in ether_addr_equal
+				 */
 #ifdef	CONFIG_DEBUG_FS
 	struct dentry *node_tbl_root;
 #endif
-- 
2.30.0

Re: [PATCH v1] net: hsr: align sup_multicast_addr in struct hsr_priv to u16 boundary

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-02-02 17:03:20

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

On Tue,  2 Feb 2021 10:03:04 +0100 you wrote:
From: Andreas Oetken <redacted>

sup_multicast_addr is passed to ether_addr_equal for address comparison
which casts the address inputs to u16 leading to an unaligned access.
Aligning the sup_multicast_addr to u16 boundary fixes the issue.

Signed-off-by: Andreas Oetken <redacted>

[...]
Here is the summary with links:
  - [v1] net: hsr: align sup_multicast_addr in struct hsr_priv to u16 boundary
    https://git.kernel.org/netdev/net/c/6c9f18f294c4

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help