Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2957019imu; Mon, 19 Nov 2018 08:36:22 -0800 (PST) X-Google-Smtp-Source: AJdET5cAPXgu4KNnq67EYiTk5okgjQQPqhe6xMxlStg3VRK5Z2XrCL2qEFsuLbSRIMgmeZYyBjbe X-Received: by 2002:a63:36c4:: with SMTP id d187mr20306420pga.404.1542645382645; Mon, 19 Nov 2018 08:36:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542645382; cv=none; d=google.com; s=arc-20160816; b=XvEt7PVDdrY1W5UUZRv9eK5EwEyuZOm5WfhcZ/zUXQP0c2sWjrnpR1GkKQ/s1sJ/Fq VEjVcTdgelqbe41g6VJi+Zkp7QjeGixBulaEjwj4tGMIqr8sW9gre6cnJs3S88pT4cvq wIhitd0r2nsLh+6CHJCZoAVlroeBtG/Ur3xmSvvcn+PgjKqOI653lXv9vhJoLmypy0Q1 /gQU00uwyFPnwFtt98YhYjOpQ7TiuLgDYx5ILJUGrK68WWm1HlqqgNvDTBSiEPtZa1yR ckdzMNAvUjhiR5HY1Yd6G+hlimz+ozYPDyIDYe/B/lskiH9KUuHVP2MWwV/SJZb2wSiN 9y8w== 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=ZeZHZpcLF9cQYHWjAAcTs1eDCuuMy6tyj2qiChF8ENc=; b=as4Sdk409SOmIrFCFC417yPpa+Wp6jucLOhp5/zXmLm16YnFLOpetCIP5KhIJYS30i 97aMbcF+1+d8sibv+ifq8qNzPOuAzzQRwwxKd2zb2kdAR/HTYtIHjT/0Rdoq2qAcdtOp OGr8gCz7VuN80VPbRx0CkbF7scpxDF8xWmZUyKz/PKOB6qdsRiLDuu//ekThPV3bbVc2 0C93qZLouUli/I6XOs+SKfLBqcErSJHCoZHHhtBArlhTJlwcRKhyXQmaIt3byk0hh4MM qArV8y43hMkpesudyhOnExRchQX9NJKWoa/Ne4nDWuwdFpK300JCGv29nBMo3KvU84XG 82sA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=D1hkLdye; 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 i66-v6si43822939pfc.173.2018.11.19.08.36.07; Mon, 19 Nov 2018 08:36:22 -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=D1hkLdye; 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 S1731455AbeKTC6t (ORCPT + 99 others); Mon, 19 Nov 2018 21:58:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:57946 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730381AbeKTC6s (ORCPT ); Mon, 19 Nov 2018 21:58:48 -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 D706C2086A; Mon, 19 Nov 2018 16:34:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1542645281; bh=WTIjHzhxqyA2sdUTX9aUTheKmSc7cYKv7A2EWkFS1rY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D1hkLdyewq1jfv3VNEOjB+LzlVYRM/NnCpJP7SINInKErdsgXUsbizTxQy0dbSWJB +6iTkj58h4VrT2tLpBBQQ+nOmvYiy4jw60vfnvR4uaZCkxBZmYG9OCK5fHPT4Tq4/e t1vH5HxQ0ot0rznK9ojJqCcE/jjeKYDLchVcashg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miklos Szeredi , syzbot+ef054c4d3f64cd7f7cec@syzkaller.appspotmai Subject: [PATCH 4.19 067/205] fuse: set FR_SENT while locked Date: Mon, 19 Nov 2018 17:26:14 +0100 Message-Id: <20181119162629.039148297@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 4c316f2f3ff315cb48efb7435621e5bfb81df96d upstream. Otherwise fuse_dev_do_write() could come in and finish off the request, and the set_bit(FR_SENT, ...) could trigger the WARN_ON(test_bit(FR_SENT, ...)) in request_end(). Signed-off-by: Miklos Szeredi Reported-by: syzbot+ef054c4d3f64cd7f7cec@syzkaller.appspotmai Fixes: 46c34a348b0a ("fuse: no fc->lock for pqueue parts") Cc: # v4.2 Signed-off-by: Greg Kroah-Hartman --- fs/fuse/dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -1319,8 +1319,8 @@ static ssize_t fuse_dev_do_read(struct f } list_move_tail(&req->list, &fpq->processing); __fuse_get_request(req); - spin_unlock(&fpq->lock); set_bit(FR_SENT, &req->flags); + spin_unlock(&fpq->lock); /* matches barrier in request_wait_answer() */ smp_mb__after_atomic(); if (test_bit(FR_INTERRUPTED, &req->flags))