[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <7156e8d9-4c4a-1a98-2767-3508b9b3798f@kernel.dk>
Date: Thu, 3 May 2018 09:36:56 -0600
From: Jens Axboe <axboe@...nel.dk>
To: Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>,
syzbot <syzbot+db48ce201b524603190a@...kaller.appspotmail.com>,
syzkaller-bugs@...glegroups.com,
weiping zhang <zhangweiping@...ichuxing.com>,
Jan Kara <jack@...e.cz>
Cc: gregkh@...uxfoundation.org, linux-kernel@...r.kernel.org
Subject: Re: KASAN: use-after-free Read in debugfs_remove (2)
On 4/23/18 4:34 AM, Tetsuo Handa wrote:
> From be88e559ec13f49b1c3aec2457c14c70f6b1926a Mon Sep 17 00:00:00 2001
> From: Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>
> Date: Mon, 23 Apr 2018 11:21:03 +0900
> Subject: [PATCH] bdi: Fix use after free bug in debugfs_remove()
>
> syzbot is reporting use after free bug in debugfs_remove() [1].
>
> This is because fault injection made memory allocation for
> debugfs_create_file() from bdi_debug_register() from bdi_register_va()
> fail and continued with setting WB_registered. But when debugfs_remove()
> is called from debugfs_remove(bdi->debug_dir) from bdi_debug_unregister()
> from bdi_unregister() from release_bdi() because WB_registered was set
> by bdi_register_va(), IS_ERR_OR_NULL(bdi->debug_dir) == false despite
> debugfs_remove(bdi->debug_dir) was already called from bdi_register_va().
>
> Fix this by making IS_ERR_OR_NULL(bdi->debug_dir) == true.
>
> [1] https://syzkaller.appspot.com/bug?id=5ab4efd91a96dcea9b68104f159adf4af2a6dfc1
Applied for 4.17, thanks.
--
Jens Axboe
Powered by blists - more mailing lists