Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp5998949ybc; Wed, 27 Nov 2019 13:09:27 -0800 (PST) X-Google-Smtp-Source: APXvYqxkp6/DEI15NcSDSpdh8szMkP/1zA65pulWYSZVNGaxHvIozrbcq6c+C6SxiIjRtE+WMCdD X-Received: by 2002:a17:906:4e96:: with SMTP id v22mr24861270eju.219.1574888967752; Wed, 27 Nov 2019 13:09:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574888967; cv=none; d=google.com; s=arc-20160816; b=mHc6whvWSTfnG1lH8kHz6qq/QLLlB/Pf2rIoolq1wbP7q6FS8FmTETiEYIyKWylZF+ QgKb0u/JKEn30hw8Dy9UyswawGJmPURj2UQO14W8c0+COBXWtpfsGhYAGC/F/Suh+NWs WuWqGI40aj/W/h4mxnENnDEgOIrhJX3vbvTv0qd/8QQXizWN+L8JZKysWtiz6E0tdtHD 9z7jt8U707lU3lQDAVy7ANyjYblrb1etND4p8TZPW0QvtO9923EehW9mPepgTs3IP5Ta Rynb4OKjp4QphctJRc/wQMIMMzklhJAvS8G30JfpFfzieeM/+hBM9XzskdbHIUo1lnzB T76A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=NKmVMQ15EBlpxaQVVIo96BfJP9Aeeso6upJecFbmvXM=; b=RvNNrA/m818rML0QtFRvAvMhkCNdrBkbo1ouv8sZNAQqyv6oMTx6m8qPzRge+ej8kP Ecv/b/QXIvIcRcvHDTc6g35vc6LWb3fw8xwGVM+b8VaAjbG9ol4oWXfs4M0Qj4Diu/qD cfE77EwExik1tzpeOIOwOnM5bxlaOQnS1rmnkQ84uQOrXefcPSRZiuBaG9V5Bvv0D97o 1vKZHUtMM81+MlAxR4w1c69zueDj2B6veA3+zjstqXibyVDNqJZ98HsjcYKF6ojxtzE0 n2YR7qzRsHak87Hia316s7DL+ux5/pg5NrImZe77OSIueWE67TwMuacZw0CFEjPyEeOd EB8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DC90ol6h; 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 s24si11046712edx.223.2019.11.27.13.09.04; Wed, 27 Nov 2019 13:09:27 -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=@kernel.org header.s=default header.b=DC90ol6h; 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 S1732611AbfK0VH2 (ORCPT + 99 others); Wed, 27 Nov 2019 16:07:28 -0500 Received: from mail.kernel.org ([198.145.29.99]:33572 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732244AbfK0VH0 (ORCPT ); Wed, 27 Nov 2019 16:07:26 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3386A2086A; Wed, 27 Nov 2019 21:07:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574888845; bh=5W9Egi4zKehIZf+zXK06b5qupqNkKPfecanbW4wj9z8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DC90ol6hgwCfuQvuUPCysAHOFoK2NB7j24C31EAqJCv0dPwDXeqFWDWJNO/PFqCc7 5kw0MCaFO2AAGF9iGlbz/lfYAu7JxYr0jHCg72j0G7tZnM3OSQrxT8Vl4H/F941jQn JIPMzwg7JfD8p3gaGLUcqaCeH55aciKi57SmJu1Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hewenliang Subject: [PATCH 4.19 293/306] usbip: tools: fix fd leakage in the function of read_attr_usbip_status Date: Wed, 27 Nov 2019 21:32:23 +0100 Message-Id: <20191127203136.156881270@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127203114.766709977@linuxfoundation.org> References: <20191127203114.766709977@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hewenliang commit 26a4d4c00f85cb844dd11dd35e848b079c2f5e8f upstream. We should close the fd before the return of read_attr_usbip_status. Fixes: 3391ba0e2792 ("usbip: tools: Extract generic code to be shared with vudc backend") Signed-off-by: Hewenliang Cc: stable Link: https://lore.kernel.org/r/20191025043515.20053-1-hewenliang4@huawei.com Signed-off-by: Greg Kroah-Hartman --- tools/usb/usbip/libsrc/usbip_host_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/tools/usb/usbip/libsrc/usbip_host_common.c +++ b/tools/usb/usbip/libsrc/usbip_host_common.c @@ -69,7 +69,7 @@ static int32_t read_attr_usbip_status(st } value = atoi(status); - + close(fd); return value; }