Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3063496imm; Sun, 1 Jul 2018 11:23:08 -0700 (PDT) X-Google-Smtp-Source: AAOMgpegV0UbsSHX8noAE9HevKqMgzlG0j3NOcap12OAT62z863JtaW3nRjyz8weW6sNLOhcpbFn X-Received: by 2002:a65:4344:: with SMTP id k4-v6mr7874500pgq.409.1530469387988; Sun, 01 Jul 2018 11:23:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530469387; cv=none; d=google.com; s=arc-20160816; b=Y46ZTZJWNSOUnBZ+2gPT/JaoV2zvAbaatUXJ3TLOo0+u73JOdAFGHTeSaVhqqMGS8n g3gLbU6UUFiySgY2NqDJmx/RerHIszt+RFDh2rlQI0SC9AGXl3ubAiE58eX+KH0GUThL I5fhqRDghqApnLnYh7e9pqmTFkNgcIGtasHDwTMopryK88TTm/w1i9mVbhwQ1uT3hL80 Hyhv7Y0jDyuf84YGsmjsnGY/mvD0Kn4iLkM5mDBBq5YVEXUYPN5JxOR8HkCnhMG+mRx+ lWHcl/tIHBTcKtz0YTv+thXStT3pZJb+ZCZDUf5RolbUuZ/LqteUoVDdkse21lkiFyoF q8TQ== 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=Xf7HKjVW6E3GRsgzysFpHsYwSgGO1KlYdhZLPIBYLxA=; b=w8swM+V5OaWelcwsR1jcqLkZNWMFzIHdhGfidcdG6OIRB7KlrMG4r0k0IvXRVqt0J2 Emtr9i8HwiBg3kMLJy4lvsdFfDDQHhSHbJEiMjBJq3g1o+pCz9ZqeaBW+MG89CRXnuYp Rwi0vBptE6CM5LbLLsJPIhVu9aSLdPtfkZ3CdSfx7IOwscQ4Cd3GtwT4CsdI2k5k7Veg 3CkUOhkXMIawLjrP1GR3vcomnGZBBTNIaRzzMlhUOAqgbd3WkZTjlXGk/MvQSbvBuKoR chzs5C7OZqsoePijp66+qtyuLnC4JVgzQPvJ4R0HBxTuBNruJPD9CzXT4MsgnElelqfx hcWw== 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 n14-v6si1566503pgg.216.2018.07.01.11.22.53; Sun, 01 Jul 2018 11:23:07 -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 S965231AbeGASU5 (ORCPT + 99 others); Sun, 1 Jul 2018 14:20:57 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:33596 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933850AbeGAQY5 (ORCPT ); Sun, 1 Jul 2018 12:24:57 -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 0332AACD; Sun, 1 Jul 2018 16:24:56 +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.9 022/101] fuse: dont keep dead fuse_conn at fuse_fill_super(). Date: Sun, 1 Jul 2018 18:21:08 +0200 Message-Id: <20180701160758.029963454@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180701160757.138608453@linuxfoundation.org> References: <20180701160757.138608453@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.9-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 @@ -1184,6 +1184,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: