Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2169834imm; Mon, 3 Sep 2018 21:59:09 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaX3DdulGco5FQkbW2TxZDsXbFkSievXkl0GVVNfnjH2bxDBS7xhJoenzb6zwQPgQG9vuPW X-Received: by 2002:a17:902:7e09:: with SMTP id b9-v6mr3364385plm.221.1536037149132; Mon, 03 Sep 2018 21:59:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536037149; cv=none; d=google.com; s=arc-20160816; b=U0ka57bPauOZp3TuYft8EB5GeMoY+3WpOwBoY2viCY6oLMMr1hHr2uexQHmEAU6++U YThSnvvZfzlnMTTHYiSV7/KI5USJ69KgnCE6TDDuU+6SMrcymsYHFthp4eJ5hvqYM+2/ aRDjj1f5Lf2iv/Swo6ElwYb1iKDx2WpKC4ScWkcTgLJAWGy2L91GOpfE3RFIZJKLv+F6 IA4+A/erbzhDer9rXSYCvTdGIE/z28M4KSgLcIgONlqrwDExG0WZRgjyyhOtfHwVOCiC Ni3/a71i2Hj4D4kqk8DiLm9k6fMots62G5lPkC/qwczApe7gLz7ZqdtLeuT10T0evtzN SYng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=Ib2LGoxhCCoINn0ou1wxqrPgfPygOrghGnncyJYzVOE=; b=Tx4GVtwDxDu+XP7SrNM9vsSF5rQNSfmP8JB5qQEKA6eUrReO4L12Ja6Q75h2bZ42Lr 0mJc41046+07lgRgdH5yAdnFvjXxYrbnuXo/h3MvaqCWIP21QgkSz197aA/S+ShUMqUT NWh22pHygyGtjOKrsnKRd4T96WmZYFlamg/ujq7nqKJyomvARx+jPJZ7eDq57FiQ747W CWTRXqW03rGx8FCPmpJ6VZRI5OhYNnAgnnJewlCIWuUV/YlKFuJPsQ169jmWHb8IWXe0 Wr3ESBrU7qw09/FTmD2Ldruy6BstFmKJJtMre9212bY8LgDoYXlUVsLpNpjsnJUvThpm PXoQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a93-v6si21508848pla.277.2018.09.03.21.58.53; Mon, 03 Sep 2018 21:59:09 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727319AbeIDJVJ (ORCPT + 99 others); Tue, 4 Sep 2018 05:21:09 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:44680 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726093AbeIDJVJ (ORCPT ); Tue, 4 Sep 2018 05:21:09 -0400 Received: from localhost (ip-213-127-74-90.ip.prioritytelecom.net [213.127.74.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 84361BA2; Tue, 4 Sep 2018 04:57:47 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johannes Thumshirn , Hannes Reinecke , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 4.14 079/165] scsi: fcoe: drop frames in ELS LOGO error path Date: Mon, 3 Sep 2018 18:56:05 +0200 Message-Id: <20180903165659.046976020@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180903165655.003605184@linuxfoundation.org> References: <20180903165655.003605184@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Johannes Thumshirn [ Upstream commit 63d0e3dffda311e77b9a8c500d59084e960a824a ] Drop the frames in the ELS LOGO error path instead of just returning an error. This fixes the following kmemleak report: unreferenced object 0xffff880064cb1000 (size 424): comm "kworker/0:2", pid 24, jiffies 4294904293 (age 68.504s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<(____ptrval____)>] _fc_frame_alloc+0x2c/0x180 [libfc] [<(____ptrval____)>] fc_lport_enter_logo+0x106/0x360 [libfc] [<(____ptrval____)>] fc_fabric_logoff+0x8c/0xc0 [libfc] [<(____ptrval____)>] fcoe_if_destroy+0x79/0x3b0 [fcoe] [<(____ptrval____)>] fcoe_destroy_work+0xd2/0x170 [fcoe] [<(____ptrval____)>] process_one_work+0x7ff/0x1420 [<(____ptrval____)>] worker_thread+0x87/0xef0 [<(____ptrval____)>] kthread+0x2db/0x390 [<(____ptrval____)>] ret_from_fork+0x35/0x40 [<(____ptrval____)>] 0xffffffffffffffff which can be triggered by issuing echo eth0 > /sys/bus/fcoe/ctlr_destroy Signed-off-by: Johannes Thumshirn Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/fcoe/fcoe_ctlr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/scsi/fcoe/fcoe_ctlr.c +++ b/drivers/scsi/fcoe/fcoe_ctlr.c @@ -754,9 +754,9 @@ int fcoe_ctlr_els_send(struct fcoe_ctlr case ELS_LOGO: if (fip->mode == FIP_MODE_VN2VN) { if (fip->state != FIP_ST_VNMP_UP) - return -EINVAL; + goto drop; if (ntoh24(fh->fh_d_id) == FC_FID_FLOGI) - return -EINVAL; + goto drop; } else { if (fip->state != FIP_ST_ENABLED) return 0;