Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp2153003ybm; Thu, 23 May 2019 12:13:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqyla/UGoH8qCa4nBsXqNa2NsATpdSqSCVxxA4izM2wSFqYS8/rEpVyTrsjPyYcBrEtf9cxi X-Received: by 2002:a63:7909:: with SMTP id u9mr94017374pgc.223.1558638837555; Thu, 23 May 2019 12:13:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558638837; cv=none; d=google.com; s=arc-20160816; b=eOp8O5AxyisXddY/Kt21B1g+X3Vgh1+4burkyeHDbYZJ9y7l6a7dAqocMVuapAsqGi hbpL8IogRLCx0Obqh+sjLfzuAVrQLr1MdkKJ3FnCdyOlWvhWnp2E/ngHPdLNIFVzwYLR fngzTxUpQvM6S30dvN43sspLds1dRlfGTViynmIYLtvl+cWhzF63zOmLiNcJnQ71OguL 7qSBboZYbHmjhmdjaFinhZZNW6XcAnPYeKcseALzRnsgL24X1X0LNmHMyyppyGohf6rj /MU3xlpsSP1T6D4YLWj5/pWVQC663ZPNYrF57GgA7dIZ/Rp88TzBsFknFDNQivla+dgi 2h1g== 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=jWhkCA5xjeGL6Uu8XXdj4OhFGMIFtBrcXeMSDRU4OgA=; b=f7SpTgSC66Cpyfr54F492UDNnWqXdUfydvU0ugr/lRwRkLA2c1mh5vU57Hr3+bzz8N 3Mpo0/IcXkPwiNDa8deH9qhZGGKkLlWw/q2TL20sJfb/SEibul77qMxjLFzOljj28XbL xi2ufGCNASmGEdRnbm9gIr2X8OsijV/dp51DHRqdVUgY8Fm7G354xwZwv/iZvbgrwNaZ gY01R8oWJ3jmvZFsbqMrcPkRc/izyaaz5UUOTgq1l7QkaihF7hpigI8vLo5jzLyflKiS CGvp1HgCV4hi1PDb4pmYtAL/n7sS3QiEjQH08R6xAK9fAjWTObIU2FfMCGi7lv0gTFo6 T2gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=A2Mm24P3; 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 q125si317178pfq.163.2019.05.23.12.13.42; Thu, 23 May 2019 12:13:57 -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=A2Mm24P3; 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 S2388338AbfEWTMA (ORCPT + 99 others); Thu, 23 May 2019 15:12:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:45574 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388313AbfEWTL7 (ORCPT ); Thu, 23 May 2019 15:11:59 -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 E0DB52186A; Thu, 23 May 2019 19:11:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558638718; bh=IfZLeQWRu8RqRyjidL5ftlvkVob/PoLcjw5qbPzYndg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A2Mm24P3PIOiseeAEXtWjC4wmRBa2D6VuylV5u7HbX6RR/njyC/xjGTjBY0ZozU+i 9N9jP3fR90sSlNBj1zUtmZm0q3RLD7NKj4cyhhkzmNdE1J4ZJQdtHEAZ3IdLlaQ0OM Bynwzy58RXRhhFnr8x11BZZk+CqJy37iAoYt4hTQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lars Persson , Ronnie Sahlberg , Pavel Shilovsky , Steve French , Sasha Levin Subject: [PATCH 4.14 22/77] Revert "cifs: fix memory leak in SMB2_read" Date: Thu, 23 May 2019 21:05:40 +0200 Message-Id: <20190523181723.408443846@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190523181719.982121681@linuxfoundation.org> References: <20190523181719.982121681@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: Greg Kroah-Hartman This reverts commit c54a881d793e3eea2a1b1460c5778b22128821ea which is commit 05fd5c2c61732152a6bddc318aae62d7e436629b upstream. Lars writes: This patch should not be in 4.14-stable because 088aaf17aa79300cab14dbee2569c58cfafd7d6e was for 4.18+. Now we have a double-free crash in SMB2_read because there are 2 calls to cifs_small_buf_release in the error path. It was a mistake to backport it this far, so let's revert it. Reported-by: Lars Persson Cc: Ronnie Sahlberg Cc: Pavel Shilovsky Cc: Steve French Cc: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- fs/cifs/smb2pdu.c | 1 - 1 file changed, 1 deletion(-) --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -2699,7 +2699,6 @@ SMB2_read(const unsigned int xid, struct 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; }