]> git.baikalelectronics.ru Git - kernel.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, 22 Feb 2023 11:50:30 +0000 (12:50 +0100)
commitc75222a475af4c9f2b1a6704b5e26e969cb9aa22
treed4a19142063502ab784e158294801fc58a27cf21
parent9253ed4be3df02bfc71bf9b467cb5f48b8e50b4d
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