]> git.baikalelectronics.ru Git - kernel.git/commit
IB/cm: Fix rb-tree duplicate free and use-after-free
authorDoron Tsur <doront@mellanox.com>
Sun, 11 Oct 2015 12:58:17 +0000 (15:58 +0300)
committerDoug Ledford <dledford@redhat.com>
Wed, 21 Oct 2015 19:43:12 +0000 (15:43 -0400)
commit979c177832af570c77df1a47ffd21c41d9902182
tree4831bbc2111ad328b50563b827936a1022d25dd4
parentfc02abe475123931370972d7cc1b3f006a8a9ac6
IB/cm: Fix rb-tree duplicate free and use-after-free

ib_send_cm_sidr_rep could sometimes erase the node from the sidr
(depending on errors in the process). Since ib_send_cm_sidr_rep is
called both from cm_sidr_req_handler and cm_destroy_id, cm_id_priv
could be either erased from the rb_tree twice or not erased at all.
Fixing that by making sure it's erased only once before freeing
cm_id_priv.

Fixes: bd2bd442219d ('[PATCH] IB: Add the kernel CM implementation')
Signed-off-by: Doron Tsur <doront@mellanox.com>
Signed-off-by: Matan Barak <matanb@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/core/cm.c