From: Sven Eckelmann Date: Mon, 16 Mar 2020 22:30:50 +0000 (+0100) Subject: batman-adv: Always initialize fragment header priority X-Git-Tag: v4.9.217~32 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ea40bc532c52ae43a7eaed389f04551a5d318ad4;p=platform%2Fkernel%2Flinux-amlogic.git batman-adv: Always initialize fragment header priority commit fe77d8257c4d838c5976557ddb87bd789f312412 upstream. The batman-adv unuicast fragment header contains 3 bits for the priority of the packet. These bits will be initialized when the skb->priority contains a value between 256 and 263. But otherwise, the uninitialized bits from the stack will be used. Fixes: c0f25c802b33 ("batman-adv: Include frame priority in fragment header") Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/batman-adv/fragmentation.c b/net/batman-adv/fragmentation.c index f3ad92b..fef21f7 100644 --- a/net/batman-adv/fragmentation.c +++ b/net/batman-adv/fragmentation.c @@ -484,6 +484,8 @@ int batadv_frag_send_packet(struct sk_buff *skb, */ if (skb->priority >= 256 && skb->priority <= 263) frag_header.priority = skb->priority - 256; + else + frag_header.priority = 0; ether_addr_copy(frag_header.orig, primary_if->net_dev->dev_addr); ether_addr_copy(frag_header.dest, orig_node->orig);