Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751815AbdF2FhD (ORCPT ); Thu, 29 Jun 2017 01:37:03 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:36543 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751580AbdF2Fg4 (ORCPT ); Thu, 29 Jun 2017 01:36:56 -0400 Subject: Re: [PATCH] ib_isert: prevent NULL pointer dereference in isert_login_recv_done() To: Andrea Righi , "Nicholas A. Bellinger" Cc: Robert LeBlanc , Sean Jenkins , Doug Ledford , Sean Hefty , Hal Rosenstock , linux-rdma , target-devel , lkml , Christoph Hellwig References: <20170622223757.GC28955@Dell> <1498435084.26123.66.camel@haakon3.risingtidesystems.com> <20170628175354.GB1769@Dell> From: Sagi Grimberg Message-ID: Date: Thu, 29 Jun 2017 08:36:51 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <20170628175354.GB1769@Dell> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 613 Lines: 17 > Just tested this patch, I wasn't able to reproduce the NULL pointer > dereference or any other bugs, so this fix seems safe enough to me. > > Tested-by: Andrea Righi Can you test just the one liner fix below? >> @@ -1452,7 +1452,7 @@ >> isert_login_recv_done(struct ib_cq *cq, struct ib_wc *wc) >> { >> struct isert_conn *isert_conn = wc->qp->qp_context; >> - struct ib_device *ib_dev = isert_conn->cm_id->device; >> + struct ib_device *ib_dev = isert_conn->device->ib_device; >> >> if (unlikely(wc->status != IB_WC_SUCCESS)) { >> isert_print_wc(wc, "login recv");