linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: "David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org, Johannes Berg <johannes.berg@intel.com>,
	linux-wireless@vger.kernel.org
Subject: Buggy rhashtable walking
Date: Thu, 4 Aug 2016 15:18:47 +0800	[thread overview]
Message-ID: <20160804071846.GA773@gondor.apana.org.au> (raw)

Hi:

While working on rhashtable I noticed that wireless is walking
rhashtables by hand using rht_for_each_*.  You must not do that
as an rhashtable can entail multiple hash tables when resizing.
If you walk it by hand then you may end up missing entries.

The correct way to do it is to use the rhashtable walk interface.
However, even this comes with the caveat that a given entry may
show up multiple times.  So if you cannot handle that then you
must construct your own data structure outside of rhashtable, like
we do in IPsec.

So the question is can wireless handle seeing an entry multiple
times? In particular, __ieee80211_rx_handle_packet would appear
to process the same packet multiple times if this were to happen.

Cheers,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

             reply	other threads:[~2016-08-04  7:21 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-04  7:18 Herbert Xu [this message]
2016-08-04  7:45 ` Buggy rhashtable walking Herbert Xu
2016-08-05  6:16   ` Johannes Berg
2016-08-05 10:48     ` Herbert Xu
2016-08-05 10:50       ` Johannes Berg
2016-08-05 11:46         ` Ben Greear
2016-08-08 15:26           ` Herbert Xu
2016-09-18 13:50         ` [PATCH 0/2] rhashtable: rhashtable with duplicate objects Herbert Xu
2016-09-18 13:53           ` [PATCH 1/2] rhashtable: Add rhlist interface Herbert Xu
2016-09-18 13:54           ` [PATCH 2/2] mac80211: Use rhltable instead of rhashtable Herbert Xu
2016-09-19  8:20           ` [PATCH 0/2] rhashtable: rhashtable with duplicate objects Johannes Berg
2016-09-19  8:25             ` Johannes Berg
2016-09-19  8:35               ` Herbert Xu
2016-09-19  8:58                 ` Johannes Berg
2016-09-19  8:40           ` [v2 PATCH " Herbert Xu
2016-09-19  8:42             ` [v2 PATCH 1/2] rhashtable: Add rhlist interface Herbert Xu
2016-09-19  8:42             ` [v2 PATCH 2/2] mac80211: Use rhltable instead of rhashtable Herbert Xu
2016-09-19  9:15             ` [v2 PATCH 0/2] rhashtable: rhashtable with duplicate objects Johannes Berg
2016-09-19  9:17               ` Herbert Xu
2016-09-19  9:27                 ` Johannes Berg
2016-09-19  9:31                   ` Johannes Berg
2016-09-19  9:34                   ` Herbert Xu
2016-09-19  9:38                     ` Johannes Berg
2016-09-19  9:50                     ` Johannes Berg
2016-09-19  9:54                       ` Johannes Berg
2016-09-19 10:02                         ` Johannes Berg
2016-09-19 10:04                           ` Johannes Berg
2016-09-19 10:10                             ` Johannes Berg
2016-09-19 10:48                               ` Herbert Xu
2016-09-19 10:58                                 ` Johannes Berg
2016-09-19 10:58             ` [v3 " Herbert Xu
2016-09-19 11:00               ` [v3 PATCH 1/2] rhashtable: Add rhlist interface Herbert Xu
2016-09-19 21:16                 ` Thomas Graf
2016-09-20  1:52                   ` Herbert Xu
2016-09-19 11:00               ` [v3 PATCH 2/2] mac80211: Use rhltable instead of rhashtable Herbert Xu
2016-09-19 11:03               ` [v3 PATCH 0/2] rhashtable: rhashtable with duplicate objects Johannes Berg
2016-09-19 11:32                 ` Johannes Berg
2016-09-20  8:44                   ` David Miller

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=20160804071846.GA773@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=davem@davemloft.net \
    --cc=johannes.berg@intel.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@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).