OSDN Git Service

net/rds: Fix error handling in rds_ib_add_one()
authorDotan Barak <dotanb@dev.mellanox.co.il>
Tue, 1 Oct 2019 17:21:02 +0000 (10:21 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 Oct 2019 19:01:06 +0000 (21:01 +0200)
commitfc9752bceab7c82eedda865f71bca220498294cb
tree3616f28757c5a8214a86c7e66967ee25633102de
parentac37c4e04728a947e40f499fc648af16ea3c5bab
net/rds: Fix error handling in rds_ib_add_one()

[ Upstream commit d64bf89a75b65f83f06be9fb8f978e60d53752db ]

rds_ibdev:ipaddr_list and rds_ibdev:conn_list are initialized
after allocation some resources such as protection domain.
If allocation of such resources fail, then these uninitialized
variables are accessed in rds_ib_dev_free() in failure path. This
can potentially crash the system. The code has been updated to
initialize these variables very early in the function.

Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
Signed-off-by: Sudhakar Dindukurti <sudhakar.dindukurti@oracle.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/rds/ib.c