[rds-devel] [PATCH v2 net 2/2] net/rds: Fix MR reference counting problem
David Miller
davem at davemloft.net
Thu Apr 9 10:22:23 PDT 2020
From: Ka-Cheong Poon <ka-cheong.poon at oracle.com>
Date: Wed, 8 Apr 2020 03:21:02 -0700
> In rds_free_mr(), it calls rds_destroy_mr(mr) directly. But this
> defeats the purpose of reference counting and makes MR free handling
> impossible. It means that holding a reference does not guarantee that
> it is safe to access some fields. For example, In
> rds_cmsg_rdma_dest(), it increases the ref count, unlocks and then
> calls mr->r_trans->sync_mr(). But if rds_free_mr() (and
> rds_destroy_mr()) is called in between (there is no lock preventing
> this to happen), r_trans_private is set to NULL, causing a panic.
> Similar issue is in rds_rdma_unuse().
>
> Reported-by: zerons <sironhide0null at gmail.com>
> Signed-off-by: Ka-Cheong Poon <ka-cheong.poon at oracle.com>
> Acked-by: Santosh Shilimkar <santosh.shilimkar at oracle.com>
Applied.
More information about the rds-devel
mailing list