]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
macvlan: add cond_resched() during multicast processing
authorMahesh Bandewar <maheshb@google.com>
Mon, 9 Mar 2020 22:57:07 +0000 (15:57 -0700)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Tue, 7 Apr 2020 08:51:50 +0000 (10:51 +0200)
BugLink: https://bugs.launchpad.net/bugs/1869732
[ Upstream commit ce9a4186f9ac475c415ffd20348176a4ea366670 ]

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")
Signed-off-by: Mahesh Bandewar <maheshb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/net/macvlan.c

index ab0f3dd40f5f9eeed3ffc0359d2d7ed63a6e307f..fabf3d469bde209f63c1ad6ccfede55059facbf3 100644 (file)
@@ -338,6 +338,8 @@ static void macvlan_process_broadcast(struct work_struct *w)
                if (src)
                        dev_put(src->dev);
                kfree_skb(skb);
+
+               cond_resched();
        }
 }