Skip to contentSkip to conversation

ext4: Fix access uninitialized 'retval' in kmmpd

PATCH Applied Ye Bin 2 participants 2 messages Jul 13, 2021 – Jul 23, 2021 ext4 file system

lore
Share & tools
lore

Ye Bin

author
#0 lore raw

PATCH 1/1 ext4: Fix access uninitialized 'retval' in kmmpd

If (!ext4_has_feature_mmp(sb)) then goto 'wait_to_exit' label, but retval not be uninitialized.

Fixes 61bb4a1c417e ("ext4: fix possible UAF when remounting r/o a mmp-protected file system")
---
 fs/ext4/mmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ext4/mmp.c +1 -1
index bc364c119af6..cebea4270817 100644
@@ -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);
Signature · 1 line
2.31.1
maintainer Applied
#1 lore raw
Quoted 5 lines · Ye Bin

If (!ext4_has_feature_mmp(sb)) then goto 'wait_to_exit' label, but retval not be uninitialized.

Fixes 61bb4a1c417e ("ext4: fix possible UAF when remounting r/o a mmp-protected file system")

Thanks, applied with a slightly fixed up commit description.

- Ted