Patch "ext4: fix leaking uninitialized memory in fast-commit journal" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    ext4: fix leaking uninitialized memory in fast-commit journal

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     ext4-fix-leaking-uninitialized-memory-in-fast-commit-journal.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From 594bc43b410316d70bb42aeff168837888d96810 Mon Sep 17 00:00:00 2001
From: Eric Biggers <ebiggers@xxxxxxxxxx>
Date: Sun, 6 Nov 2022 14:48:37 -0800
Subject: ext4: fix leaking uninitialized memory in fast-commit journal

From: Eric Biggers <ebiggers@xxxxxxxxxx>

commit 594bc43b410316d70bb42aeff168837888d96810 upstream.

When space at the end of fast-commit journal blocks is unused, make sure
to zero it out so that uninitialized memory is not leaked to disk.

Fixes: aa75f4d3daae ("ext4: main fast-commit commit path")
Cc: <stable@xxxxxxxxxxxxxxx> # v5.10+
Signed-off-by: Eric Biggers <ebiggers@xxxxxxxxxx>
Link: https://lore.kernel.org/r/20221106224841.279231-4-ebiggers@xxxxxxxxxx
Signed-off-by: Theodore Ts'o <tytso@xxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 fs/ext4/fast_commit.c |    5 +++++
 1 file changed, 5 insertions(+)

--- a/fs/ext4/fast_commit.c
+++ b/fs/ext4/fast_commit.c
@@ -737,6 +737,9 @@ static u8 *ext4_fc_reserve_space(struct
 		*crc = ext4_chksum(sbi, *crc, tl, EXT4_FC_TAG_BASE_LEN);
 	if (pad_len > 0)
 		ext4_fc_memzero(sb, tl + 1, pad_len, crc);
+	/* Don't leak uninitialized memory in the unused last byte. */
+	*((u8 *)(tl + 1) + pad_len) = 0;
+
 	ext4_fc_submit_bh(sb, false);
 
 	ret = jbd2_fc_get_buf(EXT4_SB(sb)->s_journal, &bh);
@@ -793,6 +796,8 @@ static int ext4_fc_write_tail(struct sup
 	dst += sizeof(tail.fc_tid);
 	tail.fc_crc = cpu_to_le32(crc);
 	ext4_fc_memcpy(sb, dst, &tail.fc_crc, sizeof(tail.fc_crc), NULL);
+	dst += sizeof(tail.fc_crc);
+	memset(dst, 0, bsize - off); /* Don't leak uninitialized memory. */
 
 	ext4_fc_submit_bh(sb, true);
 


Patches currently in stable-queue which might be from ebiggers@xxxxxxxxxx are

queue-6.1/fs-ext4-initialize-fsdata-in-pagecache_write.patch
queue-6.1/ext4-fix-unaligned-memory-access-in-ext4_fc_reserve_space.patch
queue-6.1/ext4-disable-fast-commit-of-encrypted-dir-operations.patch
queue-6.1/ext4-fix-leaking-uninitialized-memory-in-fast-commit-journal.patch
queue-6.1/ext4-add-missing-validation-of-fast-commit-record-lengths.patch
queue-6.1/ext4-don-t-allow-journal-inode-to-have-encrypt-flag.patch
queue-6.1/ext4-fix-uninititialized-value-in-ext4_evict_inode.patch
queue-6.1/ext4-fix-off-by-one-errors-in-fast-commit-block-filling.patch
queue-6.1/ext4-don-t-set-up-encryption-key-during-jbd2-transaction.patch



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux