Message ID | 1441724020-19035-1-git-send-email-sasha.levin@oracle.com |
---|---|
State | Accepted, archived |
Delegated to: | David Miller |
Headers | show |
From: Sasha Levin <sasha.levin@oracle.com> Date: Tue, 8 Sep 2015 10:53:40 -0400 > There was no verification that an underlying transport exists when creating > a connection, this would cause dereferencing a NULL ptr. > > It might happen on sockets that weren't properly bound before attempting to > send a message, which will cause a NULL ptr deref: ... > Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com> > Signed-off-by: Sasha Levin <sasha.levin@oracle.com> Applied. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
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);