[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20150206.152018.832752279014053975.davem@davemloft.net>
Date: Fri, 06 Feb 2015 15:20:18 -0800 (PST)
From: David Miller <davem@...emloft.net>
To: tgraf@...g.ch
Cc: ying.xue@...driver.com, netdev@...r.kernel.org,
herbert@...dor.apana.org.au
Subject: Re: [PATCH net-next] rhashtable: Fix remove logic to avoid cross
references between buckets
From: Thomas Graf <tgraf@...g.ch>
Date: Fri, 6 Feb 2015 16:08:43 +0000
> The remove logic properly searched the remaining chain for a matching
> entry with an identical hash but it did this while searching from both
> the old and new table. Instead in order to not leave stale references
> behind we need to:
>
> 1. When growing and searching from the new table:
> Search remaining chain for entry with same hash to avoid having
> the new table directly point to a entry with a different hash.
>
> 2. When shrinking and searching from the old table:
> Check if the element after the removed would create a cross
> reference and avoid it if so.
>
> These bugs were present from the beginning in nft_hash.
>
> Also, both insert functions calculated the hash based on the mask of
> the new table. This worked while growing. Wwhile shrinking, the mask
> of the inew table is smaller than the mask of the old table. This lead
> to a bit not being taken into account when selecting the bucket lock
> and thus caused the wrong bucket to be locked eventually.
>
> Fixes: 7e1e77636e36 ("lib: Resizable, Scalable, Concurrent Hash Table")
> Fixes: 97defe1ecf86 ("rhashtable: Per bucket locks & deferred expansion/shrinking")
> Reported-by: Ying Xue <ying.xue@...driver.com>
> Signed-off-by: Thomas Graf <tgraf@...g.ch>
Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists