Patch "ethtool: netlink: Add missing ethnl_ops_begin/complete" has been added to the 6.1-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

    ethtool: netlink: Add missing ethnl_ops_begin/complete

to the 6.1-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:
     ethtool-netlink-add-missing-ethnl_ops_begin-complete.patch
and it can be found in the queue-6.1 subdirectory.

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



commit bb504c21569e777288bf84a99c0fcbaa2724693a
Author: Ludvig Pärsson <ludvig.parsson@xxxxxxxx>
Date:   Wed Jan 17 13:03:14 2024 +0100

    ethtool: netlink: Add missing ethnl_ops_begin/complete
    
    [ Upstream commit f1172f3ee3a98754d95b968968920a7d03fdebcc ]
    
    Accessing an ethernet device that is powered off or clock gated might
    cause the CPU to hang. Add ethnl_ops_begin/complete in
    ethnl_set_features() to protect against this.
    
    Fixes: 0980bfcd6954 ("ethtool: set netdev features with FEATURES_SET request")
    Signed-off-by: Ludvig Pärsson <ludvig.parsson@xxxxxxxx>
    Link: https://lore.kernel.org/r/20240117-etht2-v2-1-1a96b6e8c650@xxxxxxxx
    Signed-off-by: Paolo Abeni <pabeni@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/ethtool/features.c b/net/ethtool/features.c
index 55d449a2d3fc..090e493f592e 100644
--- a/net/ethtool/features.c
+++ b/net/ethtool/features.c
@@ -234,17 +234,20 @@ int ethnl_set_features(struct sk_buff *skb, struct genl_info *info)
 	dev = req_info.dev;
 
 	rtnl_lock();
+	ret = ethnl_ops_begin(dev);
+	if (ret < 0)
+		goto out_rtnl;
 	ethnl_features_to_bitmap(old_active, dev->features);
 	ethnl_features_to_bitmap(old_wanted, dev->wanted_features);
 	ret = ethnl_parse_bitset(req_wanted, req_mask, NETDEV_FEATURE_COUNT,
 				 tb[ETHTOOL_A_FEATURES_WANTED],
 				 netdev_features_strings, info->extack);
 	if (ret < 0)
-		goto out_rtnl;
+		goto out_ops;
 	if (ethnl_bitmap_to_features(req_mask) & ~NETIF_F_ETHTOOL_BITS) {
 		GENL_SET_ERR_MSG(info, "attempt to change non-ethtool features");
 		ret = -EINVAL;
-		goto out_rtnl;
+		goto out_ops;
 	}
 
 	/* set req_wanted bits not in req_mask from old_wanted */
@@ -281,6 +284,8 @@ int ethnl_set_features(struct sk_buff *skb, struct genl_info *info)
 	if (mod)
 		netdev_features_change(dev);
 
+out_ops:
+	ethnl_ops_complete(dev);
 out_rtnl:
 	rtnl_unlock();
 	ethnl_parse_header_dev_put(&req_info);




[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