Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2991616imu; Mon, 19 Nov 2018 09:04:55 -0800 (PST) X-Google-Smtp-Source: AJdET5cJzvT7eSxgoTP4qPpsMbOBGw3FHx5jVqlG6TYhBvbNycG86RGr33Xxxlis3/lAFrcgKnil X-Received: by 2002:a63:ea4f:: with SMTP id l15mr20373525pgk.102.1542647095216; Mon, 19 Nov 2018 09:04:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542647095; cv=none; d=google.com; s=arc-20160816; b=qEm4xy6keY91Gvi+dHx/aJNUfmnRMLBlfyIZ11P7nDoKxAIZjcVyh3J5YMCR7P9ei0 GcEharC5l7skyV2yRC+vteblHHMskgIURsP2MquBv2ByQCE81DgFEwwb5PyBtkcrH3Jd osnouicLpoAYGxIvG3HmQRPdJIfYNZrIGw930NCmTtvwRc2O5R5n/Gh49eWa2BhtuC58 QpEMmWK2KK3XohdGRodD21IxTNPS/Jh9NufR2iTHNAcfD45/M4Q3EqOzG4hLm1WFWrr0 r7fx/ySK5if6eqIq6iBrKLr+asz2HKSVNfUPyd10MoG0vpn+HBnkimXySIGkw+D55Wwf Tppg== 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=GbKNC+6Idbe5SOY6mlt3+SF9sjBBO1uX/igGdoMoSUc=; b=A1VUH/8AxKlH8LNBG58RVT+0t7Tkx1gCaMnPh7hSpM8fUbqoTO98eetpS7hqXwQEBx LXaeqpafz5KhH16KVGza80YT4I4sFL4FaJV2TaK7ZeIFJ/OyRFzgw0iHU3T8sTGCiEEv CYt3V/s52gJwYFiVF2mNxW9MqmFgwf8AIUpQi26E4HH8J0Am2ecL22UWPgwmL9VOI+t9 eOvUmfbpcLjgzMc7iBXftGHtBXYnx4JqG8ORHOP1vFrM3M/3gySna+ye9iD/JeWnwQ1K oDqgSP9rCgBtq9kGBTqgFwan/Pu3JnPI0ACNgRSFN+vw47U+Q2c9z2b3rC28S2G9AeaX WpNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DmR3NxcG; 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 k23si4160846pll.241.2018.11.19.09.04.38; Mon, 19 Nov 2018 09:04:55 -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=DmR3NxcG; 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 S2405919AbeKTD0g (ORCPT + 99 others); Mon, 19 Nov 2018 22:26:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:40190 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405038AbeKTD0g (ORCPT ); Mon, 19 Nov 2018 22:26:36 -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 764B92241B; Mon, 19 Nov 2018 17:02:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1542646939; bh=pUF9V3uKnBLp1+QeKt1ttjfiScepd20d/z2zoYDyM4M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DmR3NxcGgSmmHq5pqJN7sEw8nkcqjnq9PeAylfUjrgmTF8PMqAkYFnbLat6Z4+XpN iHASUMALjJt536g+ltI4qcHy/rq/tz/znMu1hp5NMulSdbYnxEdPIAqBs3XeVPxGGP 4iQgrXL8C6K5w9EOaOaJhQAfW5/9UibA3YD93EZE= 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.4 111/160] fuse: set FR_SENT while locked Date: Mon, 19 Nov 2018 17:29:10 +0100 Message-Id: <20181119162641.572153424@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181119162630.031306128@linuxfoundation.org> References: <20181119162630.031306128@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.4-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 @@ -1336,8 +1336,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))