From: Murali Karicheri <m-karicheri2@ti.com>
To: <davem@davemloft.net>, <kuba@kernel.org>,
<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<nsekhar@ti.com>, <grygorii.strashko@ti.com>,
<vinicius.gomes@intel.com>
Subject: [PATCH 2/2 v2] net: hsr: validate address B before copying to skb
Date: Fri, 17 Jul 2020 10:55:10 -0400 [thread overview]
Message-ID: <20200717145510.30433-2-m-karicheri2@ti.com> (raw)
In-Reply-To: <20200717145510.30433-1-m-karicheri2@ti.com>
Validate MAC address before copying the same to outgoing frame
skb destination address. Since a node can have zero mac
address for Link B until a valid frame is received over
that link, this fix address the issue of a zero MAC address
being in the packet.
Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
---
Removing prp prefix from subject line.
Sending this bug fix ahead of PRP patch series as per comment
net/hsr/hsr_framereg.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/hsr/hsr_framereg.c b/net/hsr/hsr_framereg.c
index 03b891904314..530de24b1fb5 100644
--- a/net/hsr/hsr_framereg.c
+++ b/net/hsr/hsr_framereg.c
@@ -325,7 +325,8 @@ void hsr_addr_subst_dest(struct hsr_node *node_src, struct sk_buff *skb,
if (port->type != node_dst->addr_B_port)
return;
- ether_addr_copy(eth_hdr(skb)->h_dest, node_dst->macaddress_B);
+ if (is_valid_ether_addr(node_dst->macaddress_B))
+ ether_addr_copy(eth_hdr(skb)->h_dest, node_dst->macaddress_B);
}
void hsr_register_frame_in(struct hsr_node *node, struct hsr_port *port,
--
2.17.1
next prev parent reply other threads:[~2020-07-17 14:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-17 14:55 [PATCH 1/2 v2] net: hsr: fix incorrect lsdu size in the tag of HSR frames for small frames Murali Karicheri
2020-07-17 14:55 ` Murali Karicheri [this message]
2020-07-18 1:54 ` [PATCH 2/2 v2] net: hsr: validate address B before copying to skb David Miller
2020-07-17 17:39 ` [PATCH 1/2 v2] net: hsr: fix incorrect lsdu size in the tag of HSR frames for small frames Grygorii Strashko
2020-07-20 14:08 ` Murali Karicheri
2020-07-20 15:25 ` Murali Karicheri
2020-07-18 1:54 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200717145510.30433-2-m-karicheri2@ti.com \
--to=m-karicheri2@ti.com \
--cc=davem@davemloft.net \
--cc=grygorii.strashko@ti.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nsekhar@ti.com \
--cc=vinicius.gomes@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®