]> git.baikalelectronics.ru Git - kernel.git/commit
rhashtable: rhashtable_remove() must unlink in both tbl and future_tbl
authorThomas Graf <tgraf@suug.ch>
Wed, 21 Jan 2015 11:54:01 +0000 (11:54 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 26 Jan 2015 19:56:34 +0000 (11:56 -0800)
commit7bdc43a66f67659042333d7d51007a07e3bd2605
tree77f06c370e355b2a1ec6c04ea104983625bd8d7b
parentd2ddff8cd9117d86c7f99eaa8e3f1bf3943ddb6c
rhashtable: rhashtable_remove() must unlink in both tbl and future_tbl

As removals can occur during resizes, entries may be referred to from
both tbl and future_tbl when the removal is requested. Therefore
rhashtable_remove() must unlink the entry in both tables if this is
the case. The existing code did search both tables but stopped when it
hit the first match.

Failing to unlink in both tables resulted in use after free.

Fixes: b5e8a412baef ("rhashtable: Per bucket locks & deferred expansion/shrinking")
Reported-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
lib/rhashtable.c