Unverified Commit eed56ce0 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!14803 net: hsr: avoid potential out-of-bound access in fill_frame_info()

parents ef9b72ca d688f188
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -525,6 +525,8 @@ static int fill_frame_info(struct hsr_frame_info *frame,
		frame->is_vlan = true;

	if (frame->is_vlan) {
		if (skb->mac_len < offsetofend(struct hsr_vlan_ethhdr, vlanhdr))
			return -EINVAL;
		vlan_hdr = (struct hsr_vlan_ethhdr *)ethhdr;
		proto = vlan_hdr->vlanhdr.h_vlan_encapsulated_proto;
		/* FIXME: */