All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ext4: fix kernel infoleak via ext4_extent_header
@ 2021-05-05 13:30 ` Anirudh Rayabharam
  0 siblings, 0 replies; 7+ messages in thread
From: Anirudh Rayabharam @ 2021-05-05 13:30 UTC (permalink / raw)
  To: Theodore Ts'o, Andreas Dilger
  Cc: gregkh, linux-kernel-mentees, Anirudh Rayabharam,
	syzbot+2dcfeaf8cb49b05e8f1a, linux-ext4, linux-kernel

Initialize eh_generation of struct ext4_extent_header to prevent leaking
info to userspace. Fixes KMSAN kernel-infoleak bug reported by syzbot at:
http://syzkaller.appspot.com/bug?id=78e9ad0e6952a3ca16e8234724b2fa92d041b9b8

Reported-by: syzbot+2dcfeaf8cb49b05e8f1a@syzkaller.appspotmail.com
Signed-off-by: Anirudh Rayabharam <mail@anirudhrb.com>
---
 fs/ext4/extents.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 77c84d6f1af6..677d4821bcc1 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -825,6 +825,7 @@ void ext4_ext_tree_init(handle_t *handle, struct inode *inode)
 	eh->eh_entries = 0;
 	eh->eh_magic = EXT4_EXT_MAGIC;
 	eh->eh_max = cpu_to_le16(ext4_ext_space_root(inode, 0));
+	eh->eh_generation = 0;
 	ext4_mark_inode_dirty(handle, inode);
 }
 
@@ -1090,6 +1091,7 @@ static int ext4_ext_split(handle_t *handle, struct inode *inode,
 	neh->eh_max = cpu_to_le16(ext4_ext_space_block(inode, 0));
 	neh->eh_magic = EXT4_EXT_MAGIC;
 	neh->eh_depth = 0;
+	neh->eh_generation = 0;
 
 	/* move remainder of path[depth] to the new leaf */
 	if (unlikely(path[depth].p_hdr->eh_entries !=
@@ -1167,6 +1169,7 @@ static int ext4_ext_split(handle_t *handle, struct inode *inode,
 		neh->eh_magic = EXT4_EXT_MAGIC;
 		neh->eh_max = cpu_to_le16(ext4_ext_space_block_idx(inode, 0));
 		neh->eh_depth = cpu_to_le16(depth - i);
+		neh->eh_generation = 0;
 		fidx = EXT_FIRST_INDEX(neh);
 		fidx->ei_block = border;
 		ext4_idx_store_pblock(fidx, oldblock);
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread
* Re: [PATCH v2] ext4: fix kernel infoleak via ext4_extent_header
@ 2021-06-16 23:45 Theodore Ts'o
  2022-09-08 23:11 ` [PATCH] " eadavis
  0 siblings, 1 reply; 7+ messages in thread
From: Theodore Ts'o @ 2021-06-16 23:45 UTC (permalink / raw)
  To: Anirudh Rayabharam
  Cc: Andreas Dilger, Dave Kleikamp, Alex Tomas, Andrew Morton, gregkh,
	linux-kernel-mentees, syzbot+2dcfeaf8cb49b05e8f1a, linux-ext4,
	linux-kernel

On Fri, May 07, 2021 at 12:26:54AM +0530, Anirudh Rayabharam wrote:
> Initialize eh_generation of struct ext4_extent_header to prevent leaking
> info to userspace. Fixes KMSAN kernel-infoleak bug reported by syzbot at:
> http://syzkaller.appspot.com/bug?id=78e9ad0e6952a3ca16e8234724b2fa92d041b9b8
> 
> Reported-by: syzbot+2dcfeaf8cb49b05e8f1a@syzkaller.appspotmail.com
> Fixes: a86c61812637 ("[PATCH] ext3: add extent map support")
> Signed-off-by: Anirudh Rayabharam <mail@anirudhrb.com>

Applied, thanks.

					- Ted

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-09-08 23:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-05 13:30 [PATCH] ext4: fix kernel infoleak via ext4_extent_header Anirudh Rayabharam
2021-05-05 13:30 ` Anirudh Rayabharam
2021-05-05 16:19 ` Eric Biggers
2021-05-05 16:19   ` Eric Biggers
2021-05-06 18:58   ` Anirudh Rayabharam
2021-05-06 18:58     ` Anirudh Rayabharam
2021-06-16 23:45 [PATCH v2] " Theodore Ts'o
2022-09-08 23:11 ` [PATCH] " eadavis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.