netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] RDS: verify the underlying transport exists before creating a connection
@ 2015-09-04 16:43 Sasha Levin
  2015-09-04 17:32 ` santosh shilimkar
  2015-09-04 20:24 ` Sergei Shtylyov
  0 siblings, 2 replies; 5+ messages in thread
From: Sasha Levin @ 2015-09-04 16:43 UTC (permalink / raw)
  To: chien.yen, davem; +Cc: rds-devel, netdev, linux-kernel, Sasha Levin

There was no verification that an underlying transport exists when creating
a connection, this would cause dereferencing a NULL ptr.

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 net/rds/connection.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/net/rds/connection.c b/net/rds/connection.c
index a50e652..0218d81 100644
--- a/net/rds/connection.c
+++ b/net/rds/connection.c
@@ -189,6 +189,12 @@ new_conn:
 		}
 	}
 
+	if (trans == NULL) {
+		kmem_cache_free(rds_conn_slab, conn);
+		conn = ERR_PTR(-ENODEV);
+		goto out;
+	}
+
 	conn->c_trans = trans;
 
 	ret = trans->conn_alloc(conn, gfp);
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-09-04 21:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-04 16:43 [PATCH] RDS: verify the underlying transport exists before creating a connection Sasha Levin
2015-09-04 17:32 ` santosh shilimkar
2015-09-04 19:44   ` Sasha Levin
2015-09-04 21:12     ` santosh.shilimkar
2015-09-04 20:24 ` Sergei Shtylyov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).