lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a9868190-676e-40a4-93de-2a6f9978e89f@web.de>
Date: Fri, 10 May 2024 08:45:20 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: Ziwei Xiao <ziweixiao@...gle.com>, netdev@...r.kernel.org,
 kernel-janitors@...r.kernel.org
Cc: Jeroen de Borst <jeroendb@...gle.com>,
 Harshitha Ramamurthy <hramamurthy@...gle.com>,
 Praveen Kaligineedi <pkaligineedi@...gle.com>,
 Willem de Bruijn <willemb@...gle.com>, LKML <linux-kernel@...r.kernel.org>,
 "David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
 Jakub Kicinski <kuba@...nel.org>, John Fraker <jfraker@...gle.com>,
 Paolo Abeni <pabeni@...hat.com>, Peter Zijlstra <peterz@...radead.org>,
 Shailend Chand <shailend@...gle.com>, rushilg@...gle.com
Subject: Re: [PATCH net-next 5/5] gve: Add flow steering ethtool support

>> …
>>> +++ b/drivers/net/ethernet/google/gve/gve_ethtool.c
>> …
>>> +static int gve_get_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd, u32 *rule_locs)
>>> +{
>>> +     struct gve_priv *priv = netdev_priv(netdev);
>>> +     int err = 0;
>>> +
>>> +     dev_hold(netdev);
>>> +     rtnl_unlock();
>> …
>>> +out:
>>> +     rtnl_lock();
>>> +     dev_put(netdev);
>>> +     return err;
>>> +}
>> …
>>
>> How do you think about to increase the application of scope-based resource management
>> at such source code places?
>>
> Is the suggestion to combine dev_hold(netdev) together with
> rtnl_unlock()? If so, I think there might be different usages for
> using rtnl_unlock. For example, some drivers will call rtnl_unlock
> after dev_close(netdev). Please correct me if I'm wrong.

How much collateral evolution did you notice according to information from
an article like “Scope-based resource management for the kernel”
by Jonathan Corbet (from 2023-06-15)?
https://lwn.net/Articles/934679/

Would you become interested to extend the usage of resource guards accordingly?
https://elixir.bootlin.com/linux/v6.9-rc7/source/include/linux/cleanup.h#L124

Regards,
Markus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ