Patch "net: dsa: refuse cross-chip mirroring operations" has been added to the 6.11-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

    net: dsa: refuse cross-chip mirroring operations

to the 6.11-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:
     net-dsa-refuse-cross-chip-mirroring-operations.patch
and it can be found in the queue-6.11 subdirectory.

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



commit 3fff6be07bbf51191c835cecf6b37455805d1b49
Author: Vladimir Oltean <vladimir.oltean@xxxxxxx>
Date:   Tue Oct 8 12:43:20 2024 +0300

    net: dsa: refuse cross-chip mirroring operations
    
    [ Upstream commit 8c924369cb56c3054dca504c2c9c3eb208272865 ]
    
    In case of a tc mirred action from one switch to another, the behavior
    is not correct. We simply tell the source switch driver to program a
    mirroring entry towards mirror->to_local_port = to_dp->index, but it is
    not even guaranteed that the to_dp belongs to the same switch as dp.
    
    For proper cross-chip support, we would need to go through the
    cross-chip notifier layer in switch.c, program the entry on cascade
    ports, and introduce new, explicit API for cross-chip mirroring, given
    that intermediary switches should have introspection into the DSA tags
    passed through the cascade port (and not just program a port mirror on
    the entire cascade port). None of that exists today.
    
    Reject what is not implemented so that user space is not misled into
    thinking it works.
    
    Fixes: f50f212749e8 ("net: dsa: Add plumbing for port mirroring")
    Signed-off-by: Vladimir Oltean <vladimir.oltean@xxxxxxx>
    Reviewed-by: Andrew Lunn <andrew@xxxxxxx>
    Link: https://patch.msgid.link/20241008094320.3340980-1-vladimir.oltean@xxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/dsa/user.c b/net/dsa/user.c
index f5adfa1d978a2..ac34d5d1deb09 100644
--- a/net/dsa/user.c
+++ b/net/dsa/user.c
@@ -1392,6 +1392,14 @@ dsa_user_add_cls_matchall_mirred(struct net_device *dev,
 	if (!dsa_user_dev_check(act->dev))
 		return -EOPNOTSUPP;
 
+	to_dp = dsa_user_to_port(act->dev);
+
+	if (dp->ds != to_dp->ds) {
+		NL_SET_ERR_MSG_MOD(extack,
+				   "Cross-chip mirroring not implemented");
+		return -EOPNOTSUPP;
+	}
+
 	mall_tc_entry = kzalloc(sizeof(*mall_tc_entry), GFP_KERNEL);
 	if (!mall_tc_entry)
 		return -ENOMEM;
@@ -1399,9 +1407,6 @@ dsa_user_add_cls_matchall_mirred(struct net_device *dev,
 	mall_tc_entry->cookie = cls->cookie;
 	mall_tc_entry->type = DSA_PORT_MALL_MIRROR;
 	mirror = &mall_tc_entry->mirror;
-
-	to_dp = dsa_user_to_port(act->dev);
-
 	mirror->to_local_port = to_dp->index;
 	mirror->ingress = ingress;
 




[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