Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1423070AbaDKQQR (ORCPT ); Fri, 11 Apr 2014 12:16:17 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:56811 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754296AbaDKQJb (ORCPT ); Fri, 11 Apr 2014 12:09:31 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sasha Levin , "David S. Miller" Subject: [PATCH 3.14 16/23] rds: prevent dereference of a NULL device in rds_iw_laddr_check Date: Fri, 11 Apr 2014 09:12:05 -0700 Message-Id: <20140411161202.475523963@linuxfoundation.org> X-Mailer: git-send-email 1.9.0 In-Reply-To: <20140411161200.236939691@linuxfoundation.org> References: <20140411161200.236939691@linuxfoundation.org> User-Agent: quilt/0.60-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sasha Levin [ Upstream commit bf39b4247b8799935ea91d90db250ab608a58e50 ] Binding might result in a NULL device which is later dereferenced without checking. Signed-off-by: Sasha Levin Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/rds/iw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/net/rds/iw.c +++ b/net/rds/iw.c @@ -239,7 +239,8 @@ static int rds_iw_laddr_check(__be32 add ret = rdma_bind_addr(cm_id, (struct sockaddr *)&sin); /* due to this, we will claim to support IB devices unless we check node_type. */ - if (ret || cm_id->device->node_type != RDMA_NODE_RNIC) + if (ret || !cm_id->device || + cm_id->device->node_type != RDMA_NODE_RNIC) ret = -EADDRNOTAVAIL; rdsdebug("addr %pI4 ret %d node type %d\n", -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/