Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp452644yba; Wed, 15 May 2019 04:21:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqzqw6LlpaT89v3hU0CXY3E4NgAWov9jX6L1pgN0ls+yMp6qR/EocLiW/T4D8nIih+hQaJ7S X-Received: by 2002:a17:902:7406:: with SMTP id g6mr41913140pll.328.1557919295343; Wed, 15 May 2019 04:21:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557919295; cv=none; d=google.com; s=arc-20160816; b=cywwSrUN/tC0DOxijTtHQiy1PEVwh78EzGBhpNLUVzNY/wA8OuEke176gxywtdz5nV xnt52XljQIc+ilm6yUdwtqlnutg34WN48jYaSFpFSjrRwlFvHlIhjmRwjohJrtxyqlEk SiPwuu07fZEqbwJmuse05tZGv0MSvZDqucLi1DMkHmXoV/a0BpLXvQ6dvV0P6MxOPdJH fwWo2CTMi0nFGijeawUxNcBj9qs3rKWZf+S4bG23lEMAR3yTPsS/M65O7w1RDMrb0Xk+ t4NOs2Bmj2+hcUqDgrLb/WQc0Yb5owfoAfTzL6TH1XAkFbjAzXR6reznS8NRyELCNvzV u4Eg== 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=7P/+5E/pIWYsTznNFd/MwuHCNp/E57XbpBzXWDKiJUk=; b=B0Hf2kTd+TPPfKFyMxo1MQCwGjAgl7z5fhwJzvFAAFuaGnIZAKrJzNH4DRbvRqti+1 XBdo09eFPzlCh7Oo9z+5wbvI6GqLDSbI+bvQ9XtRVnhMwb1Zqhp6I/8TmPoTRzz41r+Q 7pDwD1XsH06EsUCwZCLkBq5sHlQrGK9b1J46qazf1dzV4y7mMo8vre4Om1qyd+ZUPfKI IjW45cV6FeqNeewQzSM4damv2j3VXGvKaGahaN5RwY0rruwTKkYzvEkT2oY26Oh5wBOI fCYNX9fs9blvzeAcZPIjbLGuomEYkgPW51JpVPgTBuIsLD+H2zpNlrhKs+ht7E8OrQdr PoVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OdQwYSdw; 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 61si1284676plq.398.2019.05.15.04.21.21; Wed, 15 May 2019 04:21:35 -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; dkim=pass header.i=@kernel.org header.s=default header.b=OdQwYSdw; 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 S1730887AbfEOLTH (ORCPT + 99 others); Wed, 15 May 2019 07:19:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:56660 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728336AbfEOLTD (ORCPT ); Wed, 15 May 2019 07:19:03 -0400 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 B7E0620843; Wed, 15 May 2019 11:19:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557919143; bh=fWiBpcA0mNflmgw9MMCsQMXAFnICxrrOYc/DvDCiKxU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OdQwYSdwW3sP+jbwukWCd5m+xZr+i2faXcpeqtp5C1I8xK0aFE0X6Z20R7V+1zoT1 Zil+MX0nMtGso9NZkJ3Ve3AqYOxkWc2XuJj+lXCwf9rjQxOz8SaEJuoI6ujJYZJJQL SgV54Ure+8tKOzs5nrYGk7vWw0/mSyKEbsIUeQ7Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ronnie Sahlberg , Pavel Shilovsky , Steve French , Sasha Levin Subject: [PATCH 4.14 082/115] cifs: fix memory leak in SMB2_read Date: Wed, 15 May 2019 12:56:02 +0200 Message-Id: <20190515090705.305124547@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190515090659.123121100@linuxfoundation.org> References: <20190515090659.123121100@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 [ Upstream commit 05fd5c2c61732152a6bddc318aae62d7e436629b ] Commit 088aaf17aa79300cab14dbee2569c58cfafd7d6e introduced a leak where if SMB2_read() returned an error we would return without freeing the request buffer. Cc: Stable Signed-off-by: Ronnie Sahlberg Reviewed-by: Pavel Shilovsky Signed-off-by: Steve French Signed-off-by: Sasha Levin --- fs/cifs/smb2pdu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index fd2d199dd413e..7936eac5a38a2 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -2699,6 +2699,7 @@ SMB2_read(const unsigned int xid, struct cifs_io_parms *io_parms, cifs_dbg(VFS, "Send error in read = %d\n", rc); } free_rsp_buf(resp_buftype, rsp_iov.iov_base); + cifs_small_buf_release(req); return rc == -ENODATA ? 0 : rc; } -- 2.20.1