Skip to contentSkip to conversation

macvlan: add cond_resched() during multicast processing

PATCH In review Mahesh Bandewar 3 participants 3 messages Mar 9, 2020 – Mar 10, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 macvlan: add cond_resched() during multicast processing

The Rx bound multicast packets are deferred to a workqueue and macvlan can also suffer from the same attack that was discovered by Syzbot for IPvlan. This solution is not as effective as in IPvlan. IPvlan defers all (Tx and Rx) multicast packet processing to a workqueue while macvlan does this way only for the Rx. This fix should address the Rx codition to certain extent.

Tx is still suseptible. Tx multicast processing happens when .ndo_start_xmit is called, hence we cannot add cond_resched(). However, it's not that severe since the user which is generating
/ flooding will be affected the most.

Fixes 412ca1550cbe ("macvlan: Move broadcasts into a work queue")
---
 drivers/net/macvlan.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/macvlan.c +2 -0
index 81aa7adf4801..e7289d67268f 100644
@@ -334,6 +334,8 @@ static void macvlan_process_broadcast(struct work_struct *w)
 		if (src)
 			dev_put(src->dev);
 		consume_skb(skb);
+
+		cond_resched();
 	}
 }
 
Signature · 1 line
2.25.1.481.gfbce0eb801-goog
maintainer
#1 lore raw

From: Mahesh Bandewar <[email protected]>
Date: Mon, 9 Mar 2020 15:57:07 -0700

Quoted 7 lines

The Rx bound multicast packets are deferred to a workqueue and macvlan can also suffer from the same attack that was discovered by Syzbot for IPvlan. This solution is not as effective as in IPvlan. IPvlan defers all (Tx and Rx) multicast packet processing to a workqueue while macvlan does this way only for the Rx. This fix should address the Rx codition to certain extent.

Quoted 7 lines

Tx is still suseptible. Tx multicast processing happens when .ndo_start_xmit is called, hence we cannot add cond_resched(). However, it's not that severe since the user which is generating
/ flooding will be affected the most.

Fixes 412ca1550cbe ("macvlan: Move broadcasts into a work queue")

Applied and queued up for -stable.

Reviewed-by on v1 1/1
#2 lore raw
In reply to Mahesh Bandewar
Quoted 6 lines · Mahesh Bandewar

The Rx bound multicast packets are deferred to a workqueue and macvlan can also suffer from the same attack that was discovered by Syzbot for IPvlan. This solution is not as effective as in IPvlan. IPvlan defers all (Tx and Rx) multicast packet processing to a workqueue while macvlan does this way only for the Rx. This fix should address the Rx codition to certain extent.

condition

Quoted 2 lines

Tx is still suseptible.

susceptible ? Not sure what you want to say here.

Tx multicast processing happens when

Quoted 7 lines

.ndo_start_xmit is called, hence we cannot add cond_resched(). However, it's not that severe since the user which is generating
/ flooding will be affected the most.

Fixes 412ca1550cbe ("macvlan: Move broadcasts into a work queue")