[PATCH -next] ext4: Fix access uninitialized 'retval' in kmmpd

Subsystems: ext4 file system, filesystems (vfs and infrastructure), the rest

STALE1879d LANDED

Landed in mainline as b66541422824 on 2021-07-23.

2 messages, 2 authors, 2021-07-23 · open the first message on its own page

[PATCH -next] ext4: Fix access uninitialized 'retval' in kmmpd

From: Ye Bin <hidden>
Date: 2021-07-13 02:26:02

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")
Signed-off-by: Ye Bin <redacted>
---
 fs/ext4/mmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/ext4/mmp.c b/fs/ext4/mmp.c
index bc364c119af6..cebea4270817 100644
--- a/fs/ext4/mmp.c
+++ b/fs/ext4/mmp.c
@@ -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);
-- 
2.31.1

Re: [PATCH -next] ext4: Fix access uninitialized 'retval' in kmmpd

From: "Theodore Ts'o" <tytso@mit.edu>
Date: 2021-07-23 11:32:05

On Tue, Jul 13, 2021 at 10:27:28AM +0800, Ye Bin wrote:
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")
Signed-off-by: Ye Bin <redacted>
Thanks, applied with a slightly fixed up commit description.

					- Ted
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help