Patch "macvlan: Don't propagate promisc change to lower dev in passthru" has been added to the 5.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    macvlan: Don't propagate promisc change to lower dev in passthru

to the 5.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     macvlan-don-t-propagate-promisc-change-to-lower-dev-.patch
and it can be found in the queue-5.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 0f25ed5e7730595969da5aa923e4d35f96b5df29
Author: Vlad Buslov <vladbu@xxxxxxxxxx>
Date:   Tue Nov 14 18:59:15 2023 +0100

    macvlan: Don't propagate promisc change to lower dev in passthru
    
    [ Upstream commit 7e1caeace0418381f36b3aa8403dfd82fc57fc53 ]
    
    Macvlan device in passthru mode sets its lower device promiscuous mode
    according to its MACVLAN_FLAG_NOPROMISC flag instead of synchronizing it to
    its own promiscuity setting. However, macvlan_change_rx_flags() function
    doesn't check the mode before propagating such changes to the lower device
    which can cause net_device->promiscuity counter overflow as illustrated by
    reproduction example [0] and resulting dmesg log [1]. Fix the issue by
    first verifying the mode in macvlan_change_rx_flags() function before
    propagating promiscuous mode change to the lower device.
    
    [0]:
    ip link add macvlan1 link enp8s0f0 type macvlan mode passthru
    ip link set macvlan1 promisc on
    ip l set dev macvlan1 up
    ip link set macvlan1 promisc off
    ip l set dev macvlan1 down
    ip l set dev macvlan1 up
    
    [1]:
    [ 5156.281724] macvlan1: entered promiscuous mode
    [ 5156.285467] mlx5_core 0000:08:00.0 enp8s0f0: entered promiscuous mode
    [ 5156.287639] macvlan1: left promiscuous mode
    [ 5156.288339] mlx5_core 0000:08:00.0 enp8s0f0: left promiscuous mode
    [ 5156.290907] mlx5_core 0000:08:00.0 enp8s0f0: entered promiscuous mode
    [ 5156.317197] mlx5_core 0000:08:00.0 enp8s0f0: promiscuity touches roof, set promiscuity failed. promiscuity feature of device might be broken.
    
    Fixes: efdbd2b30caa ("macvlan: Propagate promiscuity setting to lower devices.")
    Reviewed-by: Gal Pressman <gal@xxxxxxxxxx>
    Signed-off-by: Vlad Buslov <vladbu@xxxxxxxxxx>
    Reviewed-by: Jiri Pirko <jiri@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20231114175915.1649154-1-vladbu@xxxxxxxxxx
    Signed-off-by: Paolo Abeni <pabeni@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index 545d181453504..46398b06676c0 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -765,7 +765,7 @@ static void macvlan_change_rx_flags(struct net_device *dev, int change)
 	if (dev->flags & IFF_UP) {
 		if (change & IFF_ALLMULTI)
 			dev_set_allmulti(lowerdev, dev->flags & IFF_ALLMULTI ? 1 : -1);
-		if (change & IFF_PROMISC)
+		if (!macvlan_passthru(vlan->port) && change & IFF_PROMISC)
 			dev_set_promiscuity(lowerdev,
 					    dev->flags & IFF_PROMISC ? 1 : -1);
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux