Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2998570imu; Mon, 19 Nov 2018 09:09:58 -0800 (PST) X-Google-Smtp-Source: AJdET5eFmZr1mpo1UqC3EJjFlp+S20sBE3Czvq+QbalVxBRmvzOhAhA7isDkWh797yoLSgvu9vlg X-Received: by 2002:a65:5286:: with SMTP id y6mr20745017pgp.439.1542647398359; Mon, 19 Nov 2018 09:09:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542647398; cv=none; d=google.com; s=arc-20160816; b=YUAEN1xteZ8z7fHmSPWoisFQOK3i6Po2Imy0+7eQs7mzbMUkiWDhCcoMCfxSSSQSCJ Rf1fKE6J3ypESs1m6gM1jTjtm5UwEC6/ZglGhyoOcRihvTzrSZ+qUkZ0h3k6zx4Ey6Uy ayeaVMKwX4Ym0G8m4lV7g124JeJXGpR6FX4vhpMTx8bAT/6wjsWWKQ4UGEAFmUCPpJty +MqyNsyuf8FCR8UjuD2HSaw9XaRGaiS2w/PXW2a4VoHv0Bg9cgG6zQfBtD4h1qxc9nlS o4PZ1s/YKCKXiFHZ/uDyaCi/k7Y4ArSXpBm62QzBGAl8uKnbltAsMyNOfAzTSGKmD/Yl kE7w== 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=xbDUUI2P01gXqkP60pQXjeK3cQvRni/EFY2BODq6mrs=; b=Iv2yY7VjQJ2aSUbELb+P/O30UPgWADY7vf9/av+gSECflhJ4+w/kNwOpRp4lhgOa+A NcxOfHReT3Ts7NJnZrQr2Ffm7GKJdZxbhJWaBU+smi/7x4guW/AikVa7IcIU9PfyuSWK V5L6hM3eJUVcX4OjEEcM67vqPJGt9Tgh+al2H9S8Rtlb2V87OT3EHIh0wO4Yv5bDqJPJ foY/CI+aMsDqnhYCxHkneFbwpUVpS4lNNIG/3FXLVU8rM6lKHoPMj9X7/2xamcAOIKJM heCG3eZCnOCyZhoY896wAGnoZAvnh7nn1/mNT9VTdKnpDHZy+44OuL2HGGqM3WGQ0kKQ QhlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wTQJ36fM; 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 m7si7504611pfc.118.2018.11.19.09.09.40; Mon, 19 Nov 2018 09:09:58 -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=wTQJ36fM; 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 S2436465AbeKTDa5 (ORCPT + 99 others); Mon, 19 Nov 2018 22:30:57 -0500 Received: from mail.kernel.org ([198.145.29.99]:46158 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405988AbeKTDa4 (ORCPT ); Mon, 19 Nov 2018 22:30:56 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.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 79803214D9; Mon, 19 Nov 2018 17:06:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1542647198; bh=T5LFx8u3YdCNYpwlPHl0U+RneNsi+Vq1AqGnhle3tB4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wTQJ36fM4ViSXY0uOp+OqQDSWfm/Om8d7Bp0XlrYt42PJl2MLq3LOitckJWGt6q/0 RH2MkgHsWODCBuvUskhDQ6BGhgnL/9ETBv/Bl2Yf7ve375OHOUZL6bMhuzGUh/ttba cZI7tSIC2OTKa++/7NGMrzPqnIze4EFJgq+gKeNs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miklos Szeredi Subject: [PATCH 3.18 88/90] fuse: fix leaked notify reply Date: Mon, 19 Nov 2018 17:30:10 +0100 Message-Id: <20181119162633.905041894@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181119162620.585061184@linuxfoundation.org> References: <20181119162620.585061184@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Miklos Szeredi commit 7fabaf303458fcabb694999d6fa772cc13d4e217 upstream. fuse_request_send_notify_reply() may fail if the connection was reset for some reason (e.g. fs was unmounted). Don't leak request reference in this case. Besides leaking memory, this resulted in fc->num_waiting not being decremented and hence fuse_wait_aborted() left in a hanging and unkillable state. Fixes: 2d45ba381a74 ("fuse: add retrieve request") Fixes: b8f95e5d13f5 ("fuse: umount should wait for all requests") Reported-and-tested-by: syzbot+6339eda9cb4ebbc4c37b@syzkaller.appspotmail.com Signed-off-by: Miklos Szeredi Cc: #v2.6.36 Signed-off-by: Greg Kroah-Hartman --- fs/fuse/dev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -1675,8 +1675,10 @@ static int fuse_retrieve(struct fuse_con req->in.args[1].size = total_len; err = fuse_request_send_notify_reply(fc, req, outarg->notify_unique); - if (err) + if (err) { fuse_retrieve_end(fc, req); + fuse_put_request(fc, req); + } return err; }