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] [day] [month] [year] [list]
Date:	Thu, 25 Oct 2007 17:40:57 +0200
From:	Patrick McHardy <kaber@...sh.net>
To:	panther@...abit.hu
CC:	David Miller <davem@...emloft.net>, netdev@...r.kernel.org
Subject: Re: [IFGROUPv4 2/3] Interface group: core (netlink) part

Laszlo Attila Toth wrote:
> Patrick McHardy írta:
>> Laszlo Attila Toth wrote:
>>> Interface groups let handle different interfaces together
>>> especially in netfilter modules.
>>> Modified net device structure and netlink interface.
>>>
>>> @@ -891,6 +895,13 @@ static int do_setlink(struct net_device *dev, 
>>> struct ifinfomsg *ifm,
>>>          }
>>>      }
>>>  
>>> +    if (tb[IFLA_IFGROUP]) {
>>> +        write_lock_bh(&dev_base_lock);
>>> +        dev->ifgroup = nla_get_u32(tb[IFLA_IFGROUP]);
>>> +        write_unlock_bh(&dev_base_lock);
>>> +        modified = 1;
>>> +    }
>>
>>
>> The locking looks unnecessary, the rtnl should be enough.
>> I'm not even sure why its used for operstate and linkmode,
>> AFAICS they are also protected by the rtnl.
>>
> 
> Hm, ok. In this case operstate and linkmode can be unprotected as code 
> cleanup, am I right? Or leave them unchanged?


There seems to be a single case where operstate is used without
the rtnl (under dev_base_lock), in dev_get_flags() invoked by
dev_ifsioc_locked(). But that looks like a bug, there are many
callers of dev_change_flags() that only take the rtnl. So this
would be more a fix than a cleanup.

> And notification is only needed if something was changed.

Yes.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ