lkml.org 
[lkml]   [2024]   [Jan]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH net] ethtool: netlink: Add missing ethnl_ops_begin/complete
From
Date
On Mon, 2024-01-08 at 16:17 +0100, Ludvig Pärsson wrote:
> 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.
>

We need a suitable Fixes tag here

> Signed-off-by: Ludvig Pärsson <ludvig.parsson@axis.com>
> ---
> net/ethtool/features.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/net/ethtool/features.c b/net/ethtool/features.c
> index a79af8c25a07..b6cb101d7f19 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;

You should likely follow-up on net-next only converting
ethnl_set_features to ethnl_default_set_doit.

Cheers,

Paolo


\
 
 \ /
  Last update: 2024-01-11 12:31    [W:0.031 / U:0.464 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site