Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp715687rdb; Tue, 19 Sep 2023 08:10:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG9+7PpvmUqdybpJBikNJ5ZGbyP2R7S60uLbvXqKxC42NKOEJWRrHcAGPkjSHzTuXpUQxTR X-Received: by 2002:a05:6e02:1b8b:b0:346:f30:ad58 with SMTP id h11-20020a056e021b8b00b003460f30ad58mr100076ili.24.1695136250624; Tue, 19 Sep 2023 08:10:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695136250; cv=none; d=google.com; s=arc-20160816; b=IPUTN4dzQj4n4ZdC0uicigoi33eO/CsZccOpqyDxLIWOvIHgjmYxfOcxmY6cGkq07A 5qAPIisBmsMfofwpH6XMcxG+Wkwx4MvnznfMs8YVTXca8osA/JNitvB4D9oTrVfSvEfE uLGu08lFKy+wyk4Z9HnjA7ZX0q6N0/OgyYHqTe/i9CpQb/2G+BT+y+5+Ol1CEaZwO+dU GMbhj8Kc+6vsiP+GU3NrGJY817Jx4WZDUg0lADWEAYzxAVk+WlIZkcZM32/M8oADXTCN XT7pPPlAi1r3sr2VIgF+XZktQjyQazqmpZTtsnoJxdOSm03Ub1AU5920qvfY4h5UwQiu 9QYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=JLRivirvLdhDAeXVgmYFc+hQLslyGrE4IatkdcfmFZc=; fh=Jz7+7wwrCGu13E4UHTg4XzrFdXy3KqKeoMET5sMm3co=; b=pBFJ2gIQJj1UYzmqi4943Bt5b5xDMi28pOu5GEzHW+ai1/XWnuFcrS0DRc3KBO9UTS X5v7Z4oIf6EIrPZV5m3CDLCX4GelZXWWdLF9pRdBzPExJAwxtWw3192o8HIQNGuI1om2 9bQIT0HOWK47YmtbBIaRaQreFdIc5WzCgqH36QvKVCWIrjCDJXURUvcATdv8KK8hvO4n xUZLCiEDU7lIvI0XYRRnzhbGU4H+EDwDJCILFuACy2GoAkYmjz5ebDdXCMpzT5LJ1YWB 0bNU6mTGbQN7hUQTjXHK5Uxa6X1pFKGJFYQUD45YWGBQgNlyb0ZimxB29rntC/dHblSi yIfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=Isuvg5li; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id a35-20020a631a63000000b00573e6013bc4si9579183pgm.851.2023.09.19.08.10.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 08:10:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=Isuvg5li; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 99F11809B75F; Tue, 19 Sep 2023 00:27:10 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231660AbjISH1A (ORCPT + 99 others); Tue, 19 Sep 2023 03:27:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231728AbjISH06 (ORCPT ); Tue, 19 Sep 2023 03:26:58 -0400 Received: from m15.mail.163.com (m15.mail.163.com [45.254.50.220]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B1E3212C for ; Tue, 19 Sep 2023 00:26:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=JLRiv irvLdhDAeXVgmYFc+hQLslyGrE4IatkdcfmFZc=; b=Isuvg5liS42MLoH9y9qmP U5P8UDVhc9Fg+bbVIpw691F+1wsVWqiN5+WGZESLeJ5c0a6fovbgUYX33QFSP41t 6K46hUDM/NyitjgO8pYbmiOp3U0fYoZmLU93DLzh3B6jBAtlitqT2GUIeFWmqoPv MdhjPI4Q1WBzhg5JfeyY+E= Received: from icess-ProLiant-DL380-Gen10.. (unknown [183.174.60.14]) by zwqz-smtp-mta-g1-1 (Coremail) with SMTP id _____wC3xzwLTQll56jiCQ--.2751S4; Tue, 19 Sep 2023 15:26:11 +0800 (CST) From: Ma Ke To: jejb@linux.ibm.com, martin.petersen@oracle.com, kuba@kernel.org, bvanassche@acm.org, razor@blackwall.org, edumazet@google.com, make_ruc2021@163.com Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] scsi: iscsi: fix reference count leak in cxgbi_check_route() Date: Tue, 19 Sep 2023 15:26:01 +0800 Message-Id: <20230919072601.3498866-1-make_ruc2021@163.com> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: _____wC3xzwLTQll56jiCQ--.2751S4 X-Coremail-Antispam: 1Uf129KBjvdXoWrur47tw48tFy7uFWDCw1xZrb_yoW3trc_G3 929FW7Ar4qgrZ7Gw47Wan3XF9FvF9rZFy8uF4xtr9akr45XFWxGrykAFn8Z345Xw4DWFy5 Aw17Wr13CFnxWjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7xRKpBTDUUUUU== X-Originating-IP: [183.174.60.14] X-CM-SenderInfo: 5pdnvshuxfjiisr6il2tof0z/1tbiyAPuC1p7LzUeiAABsC X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 19 Sep 2023 00:27:10 -0700 (PDT) cxgbi_check_route() dont release the reference acquired by ip_dev_find() which introducing a reference count leak. We could remedy this by insuring the reference is released.ip_dev_find(). Signed-off-by: Ma Ke --- drivers/scsi/cxgbi/libcxgbi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c index abde60a50cf7..435056b27cba 100644 --- a/drivers/scsi/cxgbi/libcxgbi.c +++ b/drivers/scsi/cxgbi/libcxgbi.c @@ -670,6 +670,7 @@ cxgbi_check_route(struct sockaddr *dst_addr, int ifindex) "route to %pI4 :%u, ndev p#%d,%s, cdev 0x%p.\n", &daddr->sin_addr.s_addr, ntohs(daddr->sin_port), port, ndev->name, cdev); + dev_put(ndev); csk = cxgbi_sock_create(cdev); if (!csk) { -- 2.37.2