]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commit
f2fs: fix to use kvfree instead of kzfree
authorChao Yu <yuchao0@huawei.com>
Tue, 5 Mar 2019 09:52:33 +0000 (17:52 +0800)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 2 Jul 2019 10:07:53 +0000 (12:07 +0200)
commit3fc5edd8f42834ed496772c1184a09b7e41da672
tree472239f906206343518dc1883329644f64c0a931
parentdb06e4ab8d813c79f5e5ea4bd6f0f2256ae24a8f
f2fs: fix to use kvfree instead of kzfree

BugLink: https://bugs.launchpad.net/bugs/1830906
[ Upstream commit 2a6a7e722e7a78d774ce02b847c5b183a3ff2672 ]

As Jiqun Li reported in bugzilla:

https://bugzilla.kernel.org/show_bug.cgi?id=202747

System can panic due to using wrong allocate/free function pair
in xattr interface:
- use kvmalloc to allocate memory
- use kzfree to free memory

Let's fix to use kvfree instead of kzfree, BTW, we are safe to
get rid of kzfree, since there is no such confidential data stored
as xattr, we don't need to zero it before free memory.

Fixes: 5222595d093e ("f2fs: use kvmalloc, if kmalloc is failed")
Reported-by: Jiqun Li <jiqun.li@unisoc.com>
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
fs/f2fs/xattr.c