Skip to content

Commit

Permalink
ext4: fix potential uninitialized access to retval in kmmpd
Browse files Browse the repository at this point in the history
[ Upstream commit b665414 ]

if (!ext4_has_feature_mmp(sb)) then retval can be unitialized before
we jump to the wait_to_exit label.

Fixes: 61bb4a1 ("ext4: fix possible UAF when remounting r/o a mmp-protected file system")
Signed-off-by: Ye Bin <yebin10@huawei.com>
Link: https://lore.kernel.org/r/20210713022728.2533770-1-yebin10@huawei.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Ye Bin authored and gregkh committed Aug 12, 2021
1 parent b49b428 commit 71ecd71
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/ext4/mmp.c
Expand Up @@ -138,7 +138,7 @@ static int kmmpd(void *data)
unsigned mmp_check_interval;
unsigned long last_update_time;
unsigned long diff;
int retval;
int retval = 0;

mmp_block = le64_to_cpu(es->s_mmp_block);
mmp = (struct mmp_struct *)(bh->b_data);
Expand Down

0 comments on commit 71ecd71

Please sign in to comment.