From: Johannes Berg <johannes@sipsolutions.net>
To: Eliad Peller <eliad@wizery.com>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH] mac80211: handle hw roc cancel vs. expiration race
Date: Mon, 09 Mar 2015 13:52:48 +0100 [thread overview]
Message-ID: <1425905568.1928.7.camel@sipsolutions.net> (raw)
In-Reply-To: <1425902001-3163-1-git-send-email-eliad@wizery.com> (sfid-20150309_125330_250339_ED541C0C)
On Mon, 2015-03-09 at 13:53 +0200, Eliad Peller wrote:
> Fix it by cancelling hw_roc_done on roc cancel.
> Since hw_roc_done takes local->mtx, temporarily
> release it (before re-acquiring it and starting
> the next roc if needed).
I can't say I like this, and I'm not even sure it doesn't leave a race?
After all, the work will not take the RTNL.
Also, I think the whole concept is racy because you acquire "found"
before the unlock, but use it after the unlock, so if the work actually
ran (_sync, perhaps it already started) it may have freed the "found"
pointer.
I think the only way to really fix that is to make the driver return the
roc pointer or so and then we can either queue a work struct per roc
struct, or at least mark the roc struct as driver-destroyed and
double-check that in the work function?
Or perhaps we could flush the work before we even take the lock, but
then it might still race with the driver trying to cancel just after we
flushed I guess.
johannes
next prev parent reply other threads:[~2015-03-09 12:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-09 11:53 [PATCH] mac80211: handle hw roc cancel vs. expiration race Eliad Peller
2015-03-09 12:52 ` Johannes Berg [this message]
2015-03-09 13:59 ` Eliad Peller
2015-05-06 13:15 ` Johannes Berg
2015-05-07 9:58 ` Eliad Peller
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=1425905568.1928.7.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=eliad@wizery.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).