Re: [PATCH net-next v5 19/22] ethtool: provide WoL information in GET_SETTINGS request

Michal Kubecek
2019-03-28T10:10:58Z

On Wed, Mar 27, 2019 at 08:42:26PM -0700, Florian Fainelli wrote:
> On 3/25/2019 10:08 AM, Michal Kubecek wrote:
> >
> > + data->privileged = ethnl_is_privileged(skb);
>
> Is not this potentially creating a time of check/time of use issue? Can
> you check for ethnl_is_privileged() at the time where you fill in the
> reply skb?

I'm not sure what kind of race you have in mind but if this is a
problem, we might have even bigger one for any "SET" request where the
privilege check is performed even earlier by the genetlink dispatcher
(by setting GENL_UNS_ADMIN_PERM or GENL_ADMIN_PERM flag in genl_ops).

Michal