]> git.baikalelectronics.ru Git - kernel.git/commit
f2fs: fix information leak in f2fs_move_inline_dirents()
authorEric Biggers <ebiggers@google.com>
Mon, 23 Jan 2023 07:04:14 +0000 (23:04 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 Mar 2023 15:43:59 +0000 (16:43 +0100)
commit08c244caf8a836427d006cbf4ccb945050442b28
tree8853d7fcaaa955bde1d04c2962e4b924aa1bb62d
parent1d8c04a1d6b8e92eba91322832cef2bbcdcf2666
f2fs: fix information leak in f2fs_move_inline_dirents()

commit 9a5571cff4ffcfc24847df9fd545cc5799ac0ee5 upstream.

When converting an inline directory to a regular one, f2fs is leaking
uninitialized memory to disk because it doesn't initialize the entire
directory block.  Fix this by zero-initializing the block.

This bug was introduced by commit 8c0c37f03ded ("f2fs: avoid unneeded
initializing when converting inline dentry"), which didn't consider the
security implications of leaking uninitialized memory to disk.

This was found by running xfstest generic/435 on a KMSAN-enabled kernel.

Fixes: 8c0c37f03ded ("f2fs: avoid unneeded initializing when converting inline dentry")
Cc: <stable@vger.kernel.org> # v4.3+
Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/f2fs/inline.c