]> git.baikalelectronics.ru Git - kernel.git/commit
RDMA/core: Add missing list deletion on freeing event queue
authorMichael Guralnik <michaelgur@mellanox.com>
Wed, 12 Feb 2020 07:26:31 +0000 (09:26 +0200)
committerJason Gunthorpe <jgg@mellanox.com>
Thu, 13 Feb 2020 13:44:49 +0000 (09:44 -0400)
commit35a003c01728ba4819d56c3c0e3d478b7656f0c7
tree10396e03665546e6466836195d37326da21d470c
parent2253e1ccbb875c90a4bbfa6e68111afc1dafc1ef
RDMA/core: Add missing list deletion on freeing event queue

When the uobject file scheme was revised to allow device disassociation
from the file it became possible for read() to still happen the driver
destroys the uobject.

The old clode code was not tolerant to concurrent read, and when it was
moved to the driver destroy it creates a bug.

Ensure the event_list is empty after driver destroy by adding the missing
list_del(). Otherwise read() can trigger a use after free and double
kfree.

Fixes: 733ef9ef418a ("RDMA/core: Simplify destruction of FD uobjects")
Link: https://lore.kernel.org/r/20200212072635.682689-6-leon@kernel.org
Signed-off-by: Michael Guralnik <michaelgur@mellanox.com>
Reviewed-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Reviewed-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/core/uverbs_std_types.c