]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
btrfs: zlib: zero-initialize zlib workspace
authorAlexander Potapenko <glider@google.com>
Tue, 24 Jan 2023 11:32:34 +0000 (12:32 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Feb 2023 16:22:22 +0000 (17:22 +0100)
commitf1fd16cd975397e8998660b4413d73280afabfe3
tree2c5416732593bf46fa68db99a2d1215eda25c91b
parenta1406d5aa39361b4f62edde1dfd8f86e1bdf1323
btrfs: zlib: zero-initialize zlib workspace

commit eadd7deca0ad8a83edb2b894d8326c78e78635d6 upstream.

KMSAN reports uses of uninitialized memory in zlib's longest_match()
called on memory originating from zlib_alloc_workspace().
This issue is known by zlib maintainers and is claimed to be harmless,
but to be on the safe side we'd better initialize the memory.

Link: https://zlib.net/zlib_faq.html#faq36
Reported-by: syzbot+14d9e7602ebdf7ec0a60@syzkaller.appspotmail.com
CC: stable@vger.kernel.org # 5.4+
Signed-off-by: Alexander Potapenko <glider@google.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/zlib.c