[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20191226224802.GR4203@ZenIV.linux.org.uk>
Date: Thu, 26 Dec 2019 22:48:02 +0000
From: Al Viro <viro@...iv.linux.org.uk>
To: Jia-Ju Bai <baijiaju1990@...il.com>
Cc: dwmw2@...radead.org, richard@....at, linux-mtd@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] fs: jffs2: fix possible sleep-in-atomic-context bugs
On Tue, Dec 17, 2019 at 09:51:43PM +0800, Jia-Ju Bai wrote:
> The filesystem may sleep while holding a spinlock.
> The function call path (from bottom to top) in Linux 4.19 is:
>
> fs/jffs2/malloc.c, 188:
> kmem_cache_alloc(GFP_KERNEL) in jffs2_alloc_refblock
> fs/jffs2/malloc.c, 221:
> jffs2_alloc_refblock in jffs2_prealloc_raw_node_refs
... gets called only if jeb->last_node is NULL. I've no idea
whether it is possible on those call chains and analysis is
certainly needed before applying that kind of patches.
It might very well be real, and certainly worth asking jffs2
folks to look into. But this kind of "defensive" fixes
is no good without understanding of the situation in the
code being (hopefully) fixed.
It's a good catch; even if there is a reason why we never
hit the blocking allocation in there, that reason should be
spelled out in the code. It isn't, and that can easily
grow into a bug even if it hasn't done so already.
Powered by blists - more mailing lists