linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Denis Kenzior <denkenz@gmail.com>,
	Andrew Zaborowski <andrew.zaborowski@intel.com>,
	linux-wireless@vger.kernel.org
Subject: Re: [PATCH][RFC] cfg80211: NL80211_ATTR_SOCKET_OWNER support for CMD_CONNECT
Date: Wed, 07 Dec 2016 07:15:01 +0100	[thread overview]
Message-ID: <1481091301.4092.5.camel@sipsolutions.net> (raw)
In-Reply-To: <584730D7.2020708@gmail.com> (sfid-20161206_224249_092743_E8D41EDB)


> I'm afraid to consider what you're like when you _are_ 'super'
> against something :)

Why, that's easy, there wouldn't be a long discussion like that ;-)

> So here's a quick test, with the client triggering authenticate, then
> crashing:

> < Request: Authenticate (0x25) len 52
> [ack]                  362.339712

> [...]

>  > Event: Del Station (0x14) len
> 1144                         367.442024

> Pay attention to the time stamps.  The del station event comes in 5 
> seconds or so after our client has aborted.  So for 5 seconds we have
> an unmanaged link to some AP.

No, this is the part you didn't understand. Simply authenticating
doesn't actually create anything like a "link" to the AP. The only
reason we keep the station entry around for a few seconds is that it
*probably* will be used next to associate. But if you don't do that, or
authenticate to some other AP, or do whatever else - nothing stops you
from doing that. There's no connection, nothing really stays active
except for this 5 second grace period to associate.

So even if you crash here like in the example, there's nothing to clean
up, a subsequent authentication attempt to the same or another AP will
go through anyway.

Therefore, there's nothing to "own" with an authentication attempt,
since it doesn't actually keep any (permanent) state in the kernel, and
keeping the station entry around is just an optimisation.

I don't think it's worth trying to clean that up.

Also, consider that authentication doesn't block anything, so another
socket might immediately do another authentication/association, and you
don't want to kill that even when the first one dies. Corner case,
sure, but at least with association the second one would get "-EBUSY"
or so, whereas authentication keeps no state in the kernel.

johannes

  parent reply	other threads:[~2016-12-07  6:15 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-02 20:56 [PATCH][RFC] cfg80211: NL80211_ATTR_SOCKET_OWNER support for CMD_CONNECT Andrew Zaborowski
2016-12-05 13:51 ` Johannes Berg
2016-12-05 14:55   ` Denis Kenzior
2016-12-05 14:58     ` Johannes Berg
2016-12-05 15:05       ` Denis Kenzior
2016-12-05 15:14         ` Johannes Berg
2016-12-05 15:32           ` Denis Kenzior
2016-12-06  7:16             ` Johannes Berg
2016-12-06 21:42               ` Denis Kenzior
2016-12-07  1:40                 ` Andrew Zaborowski
2016-12-07  6:19                   ` Johannes Berg
2016-12-07  9:49                     ` Andrew Zaborowski
2016-12-07  6:15                 ` Johannes Berg [this message]
2016-12-07  6:40                   ` Denis Kenzior
2016-12-07  6:48                     ` Johannes Berg
2016-12-07  7:07                       ` Denis Kenzior
2016-12-07  7:38                         ` Johannes Berg
2016-12-05 15:40           ` Marcel Holtmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1481091301.4092.5.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=andrew.zaborowski@intel.com \
    --cc=denkenz@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).