Skip to contentSkip to conversation

batman-adv: Always initialize fragment header priority

PATCH Applied Sven Eckelmann 2 participants 2 messages Nov 29, 2017 – Dec 1, 2017 Batman advanced

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 batman-adv: Always initialize fragment header priority

From: Sven Eckelmann <[email protected]>

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 4f241fcea704 ("batman-adv: Include frame priority in fragment header")

---
Cc: Andrew Lunn <[email protected]>

---
 net/batman-adv/fragmentation.c | 2 ++
 1 file changed, 2 insertions(+)
net/batman-adv/fragmentation.c +2 -0
index a98cf1104a30a30e66fb6018bef59dea83dc4b7a..ebe6e38934e46ed5de4d30204e791dbe40285fcc 100644
@@ -499,6 +499,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);
maintainer Applied
#1 lore raw
Quoted 11 lines · On Mittwoch, 29. November 2017 10:25:02 CET Sven Eckelmann wrote:

From: Sven Eckelmann <[email protected]>

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 4f241fcea704 ("batman-adv: Include frame priority in fragment header")

---
Cc: Andrew Lunn <[email protected]>

Applied in e45a75c82fea [1]

Kind regards,
Sven

[1] https://git.open-mesh.org/batman-adv.git/commit/e45a75c82feae23a20d2744ccfde03780ccdafc7