Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1413832yba; Tue, 2 Apr 2019 08:25:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqxDZJ8A/ljmjvFxIlcU2GJJrnODM3H9Y0urRGNedl317f604AHxZg63zBSAT4e7vxF6BSiI X-Received: by 2002:a17:902:8d83:: with SMTP id v3mr13246340plo.283.1554218737715; Tue, 02 Apr 2019 08:25:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554218737; cv=none; d=google.com; s=arc-20160816; b=qrl2ficM+rh32tLfB460xPuiTpnJNcwZ4aSBqfABtVbfzqryG1eNZ2Xb8xnggET8hn cL8u0BA3vzeVi1FmT/qMft5vQ93WiqoRUOS8opLuqRXOHh51OgquwF9BHrLzQyinA7sl 6BmoPTneMOQizN3MO2ySiheUQkmyexsO0XmKl2+MIJ9CLbqb3/DCoD8NrPU+hK06YzSP W0GqGevLUUH88d59Mibfae9nNdQPD5eyVnQUo112JGfGkNQs3W8eBoqR6m9WgM7NSLqK iRbz5bUnCV9S6O2vPahRhILPoUGtDEWde/m/Bmgh+Qrpp+04BEPqrEAbNK8lqGnqnsCb 2mBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=0xxDu9K5tZRalBH5UXBe0ALMpdaWuHywQVDz3ckl7Ao=; b=Jo1keG0p2mQAFs3/wAPTzsfz3j79yFYtfs7Hi45no8cd4k0XsFAuxi4xno/LLFJL0t Rm24+UKJEIOGWDNsIhM+6YNr+11yQ3dI9/jbhTDz4sqMpX3iK/Y0SOH8Pb2j2VI8KYR4 TkXGwUMw/OImEYC9Ls9RZadlS4ltgd+AQekdCx81kFEncA017T3BcZ1VtumLliYlDSJ7 APQIhs82mKt8IUnPNS5p06WCsxtpETy0kxD4bkTNggc0PS8M2Z+yGnEucZ6IkKDPT8FK 4XCC65P6a8LlIlSuJ3cGklZz23HSCt3+p7ajMnMlhxAVUC0wtIyvxkQ4uc7TGiHqlr0O q/TA== 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 j1si11680028pgi.414.2019.04.02.08.25.21; Tue, 02 Apr 2019 08:25:37 -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 S1732076AbfDBNpE (ORCPT + 99 others); Tue, 2 Apr 2019 09:45:04 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:43412 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731468AbfDBNkI (ORCPT ); Tue, 2 Apr 2019 09:40:08 -0400 Received: from [167.98.27.226] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hBJe0-0002p6-J4; Tue, 02 Apr 2019 14:40:04 +0100 Received: from ben by deadeye with local (Exim 4.92) (envelope-from ) id 1hBJdx-0004x9-Oj; Tue, 02 Apr 2019 14:40:01 +0100 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, Denis Kirjanov , "Dominique Martinet" , "Hulk Robot" , "zhengbin" Date: Tue, 02 Apr 2019 14:38:28 +0100 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) X-Patchwork-Hint: ignore Subject: [PATCH 3.16 83/99] 9p/net: fix memory leak in p9_client_create In-Reply-To: X-SA-Exim-Connect-IP: 167.98.27.226 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.65-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: zhengbin commit bb06c388fa20ae24cfe80c52488de718a7e3a53f upstream. If msize is less than 4096, we should close and put trans, destroy tagpool, not just free client. This patch fixes that. Link: http://lkml.kernel.org/m/1552464097-142659-1-git-send-email-zhengbin13@huawei.com Fixes: 574d356b7a02 ("9p/net: put a lower bound on msize") Reported-by: Hulk Robot Signed-off-by: zhengbin Signed-off-by: Dominique Martinet Signed-off-by: Ben Hutchings --- net/9p/client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/9p/client.c +++ b/net/9p/client.c @@ -1066,7 +1066,7 @@ struct p9_client *p9_client_create(const p9_debug(P9_DEBUG_ERROR, "Please specify a msize of at least 4k\n"); err = -EINVAL; - goto free_client; + goto close_trans; } err = p9_client_version(clnt);