Search Linux Wireless

Re: [PATCH] wext: fix get_wireless_stats locking

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

 



On Mon, 2009-05-11 at 08:54 -0400, John W. Linville wrote:
> On Sun, May 10, 2009 at 01:00:17PM +0200, Johannes Berg wrote:
> > Currently, get_wireless_stats is racy by _design_. This is
> > because it returns a buffer, which needs to be statically
> > allocated since it cannot be freed if it was allocated
> > dynamically. Also, SIOCGIWSTATS and /proc/net/wireless use
> > no common lock, and /proc/net/wireless accesses are not
> > synchronised against each other. This is a design flaw in
> > get_wireless_stats since the beginning.
> > 
> > This patch fixes it by wrapping /proc/net/wireless accesses
> > with the RTNL so they are protected against each other and
> > SIOCGIWSTATS. The more correct method of fixing this would
> > be to pass in the buffer instead of returning it and have
> > the caller take care of synchronisation of the buffer, but
> > even then most drivers probably assume that their callback
> > is protected by the RTNL like all other wext callbacks.
> > 
> > Signed-off-by: Johannes Berg <johannes@xxxxxxxxxxxxxxxx>
> 
> Is it acceptable to hold rtnl between ->open and ->release?

Hmm. It worked for me, but now I'm having doubts. This stuff confuses
me. I'll check it out.

johannes

Attachment: signature.asc
Description: This is a digitally signed message part


[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