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: <1413480005.16330.15.camel@umadbro>
Date:	Thu, 16 Oct 2014 19:20:05 +0200
From:	Rostislav Lisovy <lisovy@...il.com>
To:	Johannes Berg <johannes@...solutions.net>
Cc:	linux-wireless@...r.kernel.org, linux-kernel@...r.kernel.org,
	Michal Sojka <sojkam1@....cvut.cz>, s.sander@...dsys.de,
	jan-niklas.meier@...kswagen.de, burak.simsek@...kswagen.de,
	Emmanuel Thierry <emmanuel.thierry@...oko.fr>,
	laszlo.virag@...msignia.com,
	Rostislav Lisovy <rostislav.lisovy@....cvut.cz>
Subject: Re: [PATCH 1/4] mac80211: OCB mode + join and leave handling

On Thu, 2014-10-16 at 18:33 +0200, Rostislav Lisovy wrote:
> > > +   mutex_lock(&sdata->local->mtx);
> > > +   ieee80211_vif_release_channel(sdata);
> > > +   mutex_unlock(&sdata->local->mtx);
> > > +
> > > +   skb_queue_purge(&sdata->skb_queue);
> > > +
> > > +   del_timer_sync(&sdata->u.ocb.housekeeping_timer);
> > 
> > That might call the timer - is it safe if that happens here? Looks like
> > maybe the housekeeping would still get triggered or so.
> 
> You are right. I hope the following is a reasonable solution (in form of
> a patch to my previous patch; comment stolen from some prehistoric
> version of mesh.c):
> 
> @@ -127,6 +127,9 @@ void ieee80211_ocb_work(struct ieee80211_sub_if_data *sdata)
>         struct ieee80211_if_ocb *ifocb = &sdata->u.ocb;
>         struct sta_info *sta;
>  
> +       if (!netif_running(sdata->dev))
> +               return;
> +
>         sdata_lock(sdata);
>  
>         spin_lock_bh(&ifocb->incomplete_lock);
> @@ -229,6 +232,13 @@ int ieee80211_ocb_leave(struct ieee80211_sub_if_data *sdata)
>         skb_queue_purge(&sdata->skb_queue);
>  
>         del_timer_sync(&sdata->u.ocb.housekeeping_timer);
> +       /*
> +        * If the timer fired while we waited for it, it will have
> +        * requeued the work. Now the work will be running again
> +        * but will not rearm the timer again because it checks
> +        * whether the interface is running, which, at this point,
> +        * it no longer is.
> +        */
>  
>         return 0;
>  }

Now I realized it is not that easy (and I confused "interface running"
and being "connected to the network"). There seems not to be a solid
indication that we are no longer "connected" to the network.
I think a field
	enum {
		IEEE80211_OCB_STOPPED,
		IEEE80211_OCB_JOINED,
	} state;
in struct ieee80211_if_ocb seems to be appropriate.

Best regards;
Rostislav

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ