Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2959483imu; Mon, 19 Nov 2018 08:38:33 -0800 (PST) X-Google-Smtp-Source: AJdET5eAnsAdLHrSwZb0Yt3baXhKTI/w8tPUn34XGXDpO70Mvf2sieOKOYpTGy2/AfGhmabw6RbA X-Received: by 2002:a17:902:15a8:: with SMTP id m37-v6mr23037416pla.256.1542645513750; Mon, 19 Nov 2018 08:38:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542645513; cv=none; d=google.com; s=arc-20160816; b=PwHDPnkI8EyUoWeRLYoreaHN28EGiDiQAhWe6QjnSXdkYsTpOp++lWX0pEMUnzwJ3y NksCdqR0Zn5MLEP3jFJdU91RvO2rNne8KiXK68TksvdJJJbOOptcI8IVb3rgnAwQxDrs y658BUXBy7vHud6eG05pDUoDbUomdDuw8bvCLTKRnoKMF7s00JJ+u+j1pIfdvUfjLNGn uNaR5o4ezw3UE5vEw94B0QngxT4sXrxituIUSNnoAC+9g8mgQnfmEExR1V53qcHosuwh OA9AL/tzWiz333U3hKF4hvFnQMEdyUghNuSrMDw62w0B1uoRd+4hY4Sf/ydWJ1eJi9qo lKeA== 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=AEsszuzIaqcFMdCga/Vw1MaFS159wRBKW2+WjofoByI=; b=XWU4vvblh0tsLByke+27bQfb9HI4fY0kBLErlTRC+307kbjLFRVr0RoSWQW1lcNEVR eo8NqVn3LeuROPTxNE3iH+u88JjZbmjZ8ANo+ffbsYmV5MfiChUC1erTa4FJabox/7aM Ckr0nuhpAE6t+nW701wfBU6mbjTjXPabygriK4939A2ux48T9YCfiw74RjhmpoTgNluX 2k55dz779slVZziTUHONwIXG/3ByFn9AWSPyRE9kRpmWYtXn44Yo32fpgnquM/WXfy81 DLU4gW+lPDck9SS5dssY8E8QKaUZ+VnVEqu6thtZlwzWS57GKfyWWJC1t7uINcMhZNRn xeYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vNRbiNsG; 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 a2si39636015pgm.154.2018.11.19.08.38.19; Mon, 19 Nov 2018 08:38:33 -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=vNRbiNsG; 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 S1732129AbeKTDBU (ORCPT + 99 others); Mon, 19 Nov 2018 22:01:20 -0500 Received: from mail.kernel.org ([198.145.29.99]:33158 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730931AbeKTDBS (ORCPT ); Mon, 19 Nov 2018 22:01:18 -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 CAFD0206BA; Mon, 19 Nov 2018 16:37:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1542645430; bh=7kwlrRNCPih4Fwy5TEizYLPQViIE3ddBDSew9eOq2J4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vNRbiNsGw1dYA1DkHp3K4XzGALVrKH+IBP6Dvsx5TRyFwbEGaj7Nes4Ts8IdydUHD 7zplYQoUXlec2WZNxPkvYywuCmbeIv5VEygGVnvx65TpEAur5GS6MeACJd18NL/F5G 1bjJK/NlHvf4rv+OrOmlaeg9wHgDTFEPXickSv/Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miklos Szeredi Subject: [PATCH 4.19 160/205] fuse: fix leaked notify reply Date: Mon, 19 Nov 2018 17:27:47 +0100 Message-Id: <20181119162639.541601183@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181119162616.586062722@linuxfoundation.org> References: <20181119162616.586062722@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.19-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 @@ -1724,8 +1724,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; }