Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp6467436ybx; Mon, 11 Nov 2019 09:33:47 -0800 (PST) X-Google-Smtp-Source: APXvYqyj4R5/6rh7jFc9ihFERs5u8pDPOR/8OmsAImY7H7O6nM93AzUZM3LN1SvL8c7IYqnoS//K X-Received: by 2002:a05:6402:205c:: with SMTP id bc28mr27135828edb.124.1573493627248; Mon, 11 Nov 2019 09:33:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573493627; cv=none; d=google.com; s=arc-20160816; b=M+0Wn1XH/zLUykCf19k04aGtWvQDk0o/z1nBoRqFadVHFRLOIZjLwfHz2olpWzSDKY V2qdBle92xGryxN9DQU1nbcLdCFTewrqeyfA+RfKLjaE6W9XtwS8+CZSa/P9fI8r9h7D u3lv4cS8zqtk4rrL2SO/C2wo6V+DwrAN82P/W9hZy0UXDmWS7bqIYbcN7jqOxqd+25EQ DIZoBm4lkOcwEeBcFJrTkkb8CeqwqBSKhwiBDwIKdPRYrvAGMc/qT+Na3Vjn/pYGJIk2 KAxQlpU3WvBJCDko7UEwMk0FV5lvY7LMgsG7Abxoaelqt4gJEDzr3iznay611LfNWdfs +1gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=MDbKWVLZ9+qC3USz/pzE6sGos1wyTVbbJadNGGofD5s=; b=R50egK5LCt/ozMpdTOX0z+TdTgl8r84llOxyUfliB1SVDgG9CAB9Tvz7LCLhOp2Len 9y0SHjKrL9OkcJ2Av6/ihVgaDQBDevGh4ialPoXKoBxQIK7Vf+HwQRUcqf7xd70idlLj z0dXWzvYXSLupGjhlk8liqYqdSToGWzoMird6ejkRu4NnKShg9Dz/JYtQj/1Ujb/eiAJ rPAQcYlw4mFsQn3Yd05RbmXb/GvIyIkp9PAYjf412rKQe1TASCRMhzPOxeoLRToFC9rV K+l08lLap7MDnVMZEGABLnolRAbooSKv7T6WvOmLqfBJTQ5uSNY4WlEQxMQinLx0YWnl k79w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yadro.com header.s=mta-01 header.b=SqCK8jYB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yadro.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b13si3376675eja.112.2019.11.11.09.33.22; Mon, 11 Nov 2019 09:33:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@yadro.com header.s=mta-01 header.b=SqCK8jYB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yadro.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726950AbfKKRcX (ORCPT + 99 others); Mon, 11 Nov 2019 12:32:23 -0500 Received: from mta-02.yadro.com ([89.207.88.252]:45160 "EHLO mta-01.yadro.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726763AbfKKRcW (ORCPT ); Mon, 11 Nov 2019 12:32:22 -0500 Received: from localhost (unknown [127.0.0.1]) by mta-01.yadro.com (Postfix) with ESMTP id 2C135411D9; Mon, 11 Nov 2019 17:32:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yadro.com; h= user-agent:in-reply-to:content-disposition:content-type :content-type:mime-version:references:message-id:subject:subject :from:from:date:date:received:received:received; s=mta-01; t= 1573493539; x=1575307940; bh=VRbk039SuTyl94+al1WLDW44hs3Kd0uQqm/ zaMNHqos=; b=SqCK8jYBhb6h98cBYZ9U8j9u5iXzqtosqapnq9sQ8ZOmvXfHd0c bVitVXXpI0v88gK/izOeK98vTPmt0CycRFF1Xq1TeHhYeIzpbPaW3JhzqIETLxTf QA20NwGrsRa8mTMC1IYQnMqnWGPWvLFBK/Bdd0qvjMIeE7kaZuFZoNe8= X-Virus-Scanned: amavisd-new at yadro.com Received: from mta-01.yadro.com ([127.0.0.1]) by localhost (mta-01.yadro.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tyIsa3l5oh_q; Mon, 11 Nov 2019 20:32:19 +0300 (MSK) Received: from T-EXCH-02.corp.yadro.com (t-exch-02.corp.yadro.com [172.17.10.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mta-01.yadro.com (Postfix) with ESMTPS id 130E9404CF; Mon, 11 Nov 2019 20:32:18 +0300 (MSK) Received: from localhost (172.17.128.60) by T-EXCH-02.corp.yadro.com (172.17.10.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.32; Mon, 11 Nov 2019 20:32:17 +0300 Date: Mon, 11 Nov 2019 20:32:15 +0300 From: Roman Bolshakov To: Thomas Abraham CC: , , , , , Subject: Re: [PATCH] scsi: qla2xxx: avoid crash in qlt_handle_abts_completion() if mcmd == NULL Message-ID: <20191111173215.a35ffurfmfy7ffbz@SPB-NB-133.local> References: <20191104181803.5475-1-tabraham@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20191104181803.5475-1-tabraham@suse.com> User-Agent: NeoMutt/20180716 X-Originating-IP: [172.17.128.60] X-ClientProxiedBy: T-EXCH-01.corp.yadro.com (172.17.10.101) To T-EXCH-02.corp.yadro.com (172.17.10.102) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Thomas, The fix for the issue was sent earlier: https://patchwork.kernel.org/patch/11141981/ It's not important to me what fixes goes into tree but I'd like to keep the commit message because it covers how the situation arises. Also, the cover letter of the patch series points out another issue not covered in either of the fixes (lack of explicit LOGO instead of BA_RJT). Thank you, Roman On Mon, Nov 04, 2019 at 01:18:03PM -0500, Thomas Abraham wrote: > qlt_ctio_to_cmd() will return a NULL mcmd if h == QLA_TGT_SKIP_HANDLE. If > the error subcodes don't match the exact codes checked a crash will occur > when calling free_mcmd on the null mcmd > > Signed-off-by: Thomas Abraham > --- > drivers/scsi/qla2xxx/qla_target.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c > index a06e56224a55..611ab224662f 100644 > --- a/drivers/scsi/qla2xxx/qla_target.c > +++ b/drivers/scsi/qla2xxx/qla_target.c > @@ -5732,7 +5732,8 @@ static void qlt_handle_abts_completion(struct scsi_qla_host *vha, > vha->vp_idx, entry->compl_status, > entry->error_subcode1, > entry->error_subcode2); > - ha->tgt.tgt_ops->free_mcmd(mcmd); > + if (mcmd) > + ha->tgt.tgt_ops->free_mcmd(mcmd); > } > } else if (mcmd) { > ha->tgt.tgt_ops->free_mcmd(mcmd); > -- > 2.16.4 >