Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3337664imu; Sun, 11 Nov 2018 12:41:14 -0800 (PST) X-Google-Smtp-Source: AJdET5dhEwHHZ2lZ/7T3ibmKbHA6JVKQsPGoz+Pu9N8+fG1t6eOheuEChJnxzkaV/SiKC2NAiUkE X-Received: by 2002:a63:63c3:: with SMTP id x186mr15079342pgb.330.1541968874097; Sun, 11 Nov 2018 12:41:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541968874; cv=none; d=google.com; s=arc-20160816; b=p3D9WagrxMEX7BtZFXMAEtn3Nz6ghK8ZHbVccCDdBiRD4GVJlyY2jnnGJjEixwYRcL NsGPBATFnzUKF40kTUSSmIrPLlRNgR38nhCJelcxZtDDM9dGcdAx0Q6/AfNskqooELtL QzTAeDDdH2bvWeOz02PnZACZ729R/2JhCOv9FRU2cgR+Ue9L0pi0i+aGXZMBJc65/xta /uSAlj6NJRbkolh3YeLD3JsET/UEdHOp1/8iUFqRLPZUoWH4FN6G+kysNJpmKPHhFY2u i9mF14BRlel0kqTTHWPMi6aMTR5p7vKae+CIsywozQ+6fZtla6EFbaIt7vohQHyiyGp2 xaFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=yO59qUxP3DzMFrgfNltDgf2zSeD8zEcxL1NvT8QGmVQ=; b=jTdb2baWQwUD9IE4rLFvtF5vioixK5aRUUP+GvV4PaJGmokZ88h+fdM9OkIlKaH87G K1UXVWlBhE9s2uG/ROqy4axZeLsJ5a0i1Vxi1gj8h3hEESOjTk1hIAO4sytkc8qs8QUL p2dyoKU8pCLnv+cLoZIWGbHIJLxIheIXogGtlgiSswOKs+b2PzDhD4AwLEhChhtEpLc/ 5OxqHoBezaSbpZ7fK49t2S9dLtwqSEGSrzpEQWLS+w3EgIfXiZ04JC9WeiRhFdqvpZBt OV+LmqTwSDEPQpz1Qq02hq7ONcUN9fl2akZ2B7rll7LaR09AoNyXyw9Y2K8s7UIyOa5/ mJSw== ARC-Authentication-Results: i=1; mx.google.com; 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 p126si11836880pgp.529.2018.11.11.12.40.59; Sun, 11 Nov 2018 12:41:14 -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; 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 S1730267AbeKLG26 (ORCPT + 99 others); Mon, 12 Nov 2018 01:28:58 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:49568 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729532AbeKLFsI (ORCPT ); Mon, 12 Nov 2018 00:48:08 -0500 Received: from [192.168.4.242] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gLvsT-0000l8-AX; Sun, 11 Nov 2018 19:58:37 +0000 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1gLvsQ-0001Us-Nl; Sun, 11 Nov 2018 19:58:34 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Tetsuo Handa" , "Miklos Szeredi" , "syzbot" , "Anand Avati" , "Csaba Henk" , "John Muir" Date: Sun, 11 Nov 2018 19:49:05 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 101/366] fuse: don't keep dead fuse_conn at fuse_fill_super(). In-Reply-To: X-SA-Exim-Connect-IP: 192.168.4.242 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.61-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Tetsuo Handa commit 543b8f8662fe6d21f19958b666ab0051af9db21a upstream. syzbot is reporting use-after-free at fuse_kill_sb_blk() [1]. Since sb->s_fs_info field is not cleared after fc was released by fuse_conn_put() when initialization failed, fuse_kill_sb_blk() finds already released fc and tries to hold the lock. Fix this by clearing sb->s_fs_info field after calling fuse_conn_put(). [1] https://syzkaller.appspot.com/bug?id=a07a680ed0a9290585ca424546860464dd9658db Signed-off-by: Tetsuo Handa Reported-by: syzbot Fixes: 3b463ae0c626 ("fuse: invalidation reverse calls") Cc: John Muir Cc: Csaba Henk Cc: Anand Avati Signed-off-by: Miklos Szeredi Signed-off-by: Ben Hutchings --- fs/fuse/inode.c | 1 + 1 file changed, 1 insertion(+) --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c @@ -1125,6 +1125,7 @@ static int fuse_fill_super(struct super_ err_put_conn: fuse_bdi_destroy(fc); fuse_conn_put(fc); + sb->s_fs_info = NULL; err_fput: fput(file); err: