Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp2984609imm; Sun, 1 Jul 2018 09:42:23 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJiRa4RoPakLqdtq9rceHBQbuIwIOcCYIPJuvsoOtnbnKWh1j3HmDVeb/4QDdTCqyxFtg57 X-Received: by 2002:a17:902:8601:: with SMTP id f1-v6mr22655366plo.196.1530463343115; Sun, 01 Jul 2018 09:42:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530463343; cv=none; d=google.com; s=arc-20160816; b=vw58Z5ERsoyb07dGiHXXbwU4omMrWYxC9PugyjtWKi9jMT1tnKDH9oL68SWsACMp2b yzj5aJoXcDJPxZFpD4++m261nHmRQCWWvX5yAvB3HD40/jctl8OW3a6dZTpANgGcmZeW zuFQsKYhrzh3grb/MrUw3iiCugkBT7eyKosIZ0kfMzIukuysZm5NdkDOxY0CJ8Axx2SK YPX1nee/AHkZKrqq4Abvf5XhTllYT/sFLawXaxPk3N3vWaOPEmCVivPBN7bwXt9A3B0r cCa9NR+Jrqz3l1aK8A8Q7k+2GzOzbavbECi/tDey0LzUJZ/mlgC+wSnqd2nkGKkN0lUs aQ4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=cqNEqvrrKZXBQ1SwFVHwjpop7x241NfRzc37N3lbTVU=; b=m+JdhgmbDOh4i+2Js2izcXLfumK8SNFhpIjoOIH3Q6Wf3K53Jb4s8n4JYQWg3OQro4 2Tg0kRA89BqtWnn37M4nAU1/KMHvuboXyTpu2MLGXDn5lsnPG7QLM1ocIsOlQL/NUk3Z UdWZNJFhQUNRL3DktjAq3WlKzgpjw/Ng6i6od5nZ0EDk/mFwheMUCBbjOyvgM9J5MPKS AMzG+9ksrfJq/Gov5FV+NEFH7btn58UGv2G5bML0ck8GwVKvqPKipD8sSCC8t2LLKvTp 8BZY0oHISWDiFZnN0UAulI0m65qsB4nmFSTNLLn5SNIBc5CPQ6eWtIB087esZaOvS7qZ Cp+A== 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 r3-v6si12603687pgo.606.2018.07.01.09.42.08; Sun, 01 Jul 2018 09:42:23 -0700 (PDT) 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 S1031862AbeGAQkJ (ORCPT + 99 others); Sun, 1 Jul 2018 12:40:09 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:37082 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031787AbeGAQkF (ORCPT ); Sun, 1 Jul 2018 12:40:05 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id AAFEBAA6; Sun, 1 Jul 2018 16:40:04 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tetsuo Handa , syzbot , John Muir , Csaba Henk , Anand Avati , Miklos Szeredi Subject: [PATCH 4.17 042/220] fuse: dont keep dead fuse_conn at fuse_fill_super(). Date: Sun, 1 Jul 2018 18:21:06 +0200 Message-Id: <20180701160910.085400391@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180701160908.272447118@linuxfoundation.org> References: <20180701160908.272447118@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.17-stable 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 Cc: # v2.6.31 Signed-off-by: Miklos Szeredi Signed-off-by: Greg Kroah-Hartman --- fs/fuse/inode.c | 1 + 1 file changed, 1 insertion(+) --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c @@ -1179,6 +1179,7 @@ static int fuse_fill_super(struct super_ fuse_dev_free(fud); err_put_conn: fuse_conn_put(fc); + sb->s_fs_info = NULL; err_fput: fput(file); err: