]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
maple_tree: fix freeing of nodes in rcu mode
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Tue, 11 Apr 2023 15:10:51 +0000 (11:10 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Apr 2023 15:02:58 +0000 (17:02 +0200)
commitbc5ab3677b2bd17b127dd9a5a9c2c81799b092ef
tree98edd4d074d4000056835bae64aa6b447a8ea641
parent237a5a21293e52d2085670ed666291c87eafae59
maple_tree: fix freeing of nodes in rcu mode

commit 2e5b4921f8efc9e845f4f04741797d16f36847eb upstream.

The walk to destroy the nodes was not always setting the node type and
would result in a destroy method potentially using the values as nodes.
Avoid this by setting the correct node types.  This is necessary for the
RCU mode of the maple tree.

Link: https://lkml.kernel.org/r/20230227173632.3292573-4-surenb@google.com
Cc: <Stable@vger.kernel.org>
Fixes: 54a611b60590 ("Maple Tree: add new data structure")
Signed-off-by: Liam Howlett <Liam.Howlett@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
lib/maple_tree.c