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

!13436 netfilter: br_netfilter: fix panic with metadata_dst skb

parents e291bdcc 7ce4e337
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@
#include <net/ip.h>
#include <net/ipv6.h>
#include <net/addrconf.h>
#include <net/dst_metadata.h>
#include <net/route.h>
#include <net/netfilter/br_netfilter.h>
#include <net/netns/generic.h>
@@ -865,6 +866,10 @@ static int br_nf_dev_queue_xmit(struct net *net, struct sock *sk, struct sk_buff
		return br_dev_queue_push_xmit(net, sk, skb);
	}

	/* Fragmentation on metadata/template dst is not supported */
	if (unlikely(!skb_valid_dst(skb)))
		goto drop;

	/* This is wrong! We should preserve the original fragment
	 * boundaries by preserving frag_list rather than refragmenting.
	 */