Search Linux Wireless

Re: [PATCH] mac80211: check for existance sta before adding it

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jun 2, 2009 at 1:35 PM, Johannes Berg <johannes@xxxxxxxxxxxxxxxx> wrote:
> On Tue, 2009-06-02 at 16:30 -0400, Luis R. Rodriguez wrote:
>> Lets just check for the STA before its addition through
>> sta_info_insert() and make this mandatory. It simpifies
>> code.
>>
>> In our mac80211 cfg80211 callback for device addition we
>> also can simplify the code by first checking for the STA
>> before trying to add it and then checking for -EEXIST which
>> we were not doing. If that actualy would happen we could
>> end up potentially with a stale sta and the rate info was
>> never updated. We should now be updating accordingly.
>>
>> Since we are making part of the API to check for the STA
>> prior to addition lets warn in sta_info_insert() if the
>> sta does already exist instead of passing an -EEXIST.
>>
>> Signed-off-by: Luis R. Rodriguez <lrodriguez@xxxxxxxxxxx>
>> ---
>>
>> johill, this is what I meant. Still not the right approach?
>
> This may sound flippy, but you do need to understand RCU first. This is
> simply not correct, even with rcu_read_lock() the sta info might be
> unlinked from the list, your pointer will just point to something no
> longer on the list.

Thanks, yeah I see where I was making an incorrect assumption here.

There still is a case here where userpsace can try to add a sta twice
and the second parameters passed would be ignored.

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

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux