Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2982285imu; Mon, 19 Nov 2018 08:58:01 -0800 (PST) X-Google-Smtp-Source: AJdET5f3mL/pbdIE7H26BwL1X7vgi+go26ytjhr7aWizyXyMZEWyJLsWjXy9Vr3CdvC5fJRvmSRL X-Received: by 2002:a63:f547:: with SMTP id e7mr21141660pgk.182.1542646681230; Mon, 19 Nov 2018 08:58:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542646681; cv=none; d=google.com; s=arc-20160816; b=yA2O/Mrs8SNyp1uSoFjnjCwcdl3Mv7YwUm3W5H99aHwjA/xc5jDgMMIY8Dfr5FY8Xm iAfOvyR0uqja2Zhv0tL7cvpp/OyJk9uVv4oJ1gaT9sGCNYdTsL63iuQcJBIO7Lcholsx 8XtT5knDg8SvRhG65LRwdIhkLVVC8dAvp4hDDIIG2CRfOxKqe2N1gqpxwhT9WiVU0vMY q3gt3y6Lw68O2XVpfLCXKrHKB31tHN2ZqBPMomPxni1CQ/ejVvi7lEK8jUfiB1kd9dnG D+1YKKFV6eFIR6sgeiIzgNYBk/hIUwNYqRlGV11zlCoL1tdI05vSU4RQUIpGjI//nArQ kT4w== 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=tzKg9+TnMK5oxR5V8DdW9mxgAebD06Ws3BLfP+FRleY=; b=m+koyTac+hUVNH+s+2vV9Hxr35qy6u1t58963wqKAvyxQMmuWLYnQw+CXcERs2knW1 LLMQZls6eZljNjSSCygpBk5FiHksHwa1RuHImJySwtbcuhBNHwscQ63P/qemX4zIXBQp JgOaV7pwr+R3jE1txECdPn9aWRhxCIf8CRFm5wsCOrCPPKT8EI2hyhwMtnEDJt4A5Xnd ENbsYmFCva7cVmaGdTTRqXEj2eWZ5Gn+u1D9eq2TtHVJuu4kfCPBnIJlp97Ut+Sm8AW5 K3FF6hNsuvXJidCjdHzebuznag+JnHPBHKHz8Nh7zoYGdXiqzy5E7nPMhCfxsdDSTFuI V0FQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=t4TMeJzn; 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 h4-v6si3384053plt.315.2018.11.19.08.57.46; Mon, 19 Nov 2018 08:58:01 -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=t4TMeJzn; 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 S2391124AbeKTDUJ (ORCPT + 99 others); Mon, 19 Nov 2018 22:20:09 -0500 Received: from mail.kernel.org ([198.145.29.99]:59410 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390603AbeKTDUJ (ORCPT ); Mon, 19 Nov 2018 22:20:09 -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 11035206BA; Mon, 19 Nov 2018 16:55:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1542646554; bh=0LcDtZ1VeJdiB+DoFh1WwIj0P0syH0NMRW4XFMqxGGQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t4TMeJznKwN5hdu9Y2E6UwZjepvNcWTLW0ZuXAQ0YH1GEgHHlX82ZnnHaZQ+r1xyn GrxFRbZQr3FGdAMJnRBqq59GGxWuVOXeyBApkq13YJiiS2IGEoGDTHqb/3hmeVgv6x RQhrLytI7vf4bRhERjADmGPa2PTUUhDowwylhF9I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miklos Szeredi Subject: [PATCH 4.9 73/83] fuse: fix leaked notify reply Date: Mon, 19 Nov 2018 17:29:39 +0100 Message-Id: <20181119162626.236220048@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181119162612.046511542@linuxfoundation.org> References: <20181119162612.046511542@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 4.9-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 @@ -1715,8 +1715,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; }