提交 d4018db8 编写于 作者: A Alexander Potapenko 提交者: sanglipeng

affs: initialize fsdata in affs_truncate()

stable inclusion
from stable-v5.10.166
commit 39ab0fc4984285851048716e7f85ef8b11cabf11
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7TH9O

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=39ab0fc4984285851048716e7f85ef8b11cabf11

--------------------------------

[ Upstream commit eef034ac ]

When aops->write_begin() does not initialize fsdata, KMSAN may report
an error passing the latter to aops->write_end().

Fix this by unconditionally initializing fsdata.

Fixes: f2b6a16e ("fs: affs convert to new aops")
Suggested-by: NEric Biggers <ebiggers@kernel.org>
Signed-off-by: NAlexander Potapenko <glider@google.com>
Reviewed-by: NDavid Sterba <dsterba@suse.com>
Signed-off-by: NDavid Sterba <dsterba@suse.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: Nsanglipeng <sanglipeng1@jd.com>
上级 d4badf84
...@@ -879,7 +879,7 @@ affs_truncate(struct inode *inode) ...@@ -879,7 +879,7 @@ affs_truncate(struct inode *inode)
if (inode->i_size > AFFS_I(inode)->mmu_private) { if (inode->i_size > AFFS_I(inode)->mmu_private) {
struct address_space *mapping = inode->i_mapping; struct address_space *mapping = inode->i_mapping;
struct page *page; struct page *page;
void *fsdata; void *fsdata = NULL;
loff_t isize = inode->i_size; loff_t isize = inode->i_size;
int res; int res;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册