]> git.ipfire.org Git - thirdparty/grub.git/commit
fs/jfs: Catch infinite recursion
authorDaniel Axtens <dja@axtens.net>
Mon, 18 Jan 2021 04:47:24 +0000 (15:47 +1100)
committerDaniel Kiper <daniel.kiper@oracle.com>
Tue, 2 Mar 2021 14:54:18 +0000 (15:54 +0100)
commit223120dd83745126cb232a0248c9a8901d7e350d
treea452c058e1f8bab9cb72d6c032618d8ce7379208
parentbd0cf8148ccf721f6e39ffbd70f8abad0c8897f0
fs/jfs: Catch infinite recursion

It's possible with a fuzzed filesystem for JFS to keep getblk()-ing
the same data over and over again, leading to stack exhaustion.

Check if we'd be calling the function with exactly the same data as
was passed in, and if so abort.

I'm not sure what the performance impact of this is and am open to
better ideas.

Signed-off-by: Daniel Axtens <dja@axtens.net>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/fs/jfs.c