diff options
author | Al Viro <viro@ftp.linux.org.uk> | 2006-04-26 02:26:09 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-04-26 10:52:21 -0400 |
commit | de0bb97aff6743f71abb8ec581238e2bdae9cdd1 (patch) | |
tree | 86bf40b0545ca3b125864065aeb1ec4b3791aabf /fs | |
parent | c82ffb07cd1aa356c599999c4f0dc5155a91d318 (diff) |
[PATCH] forgotten ->b_data in memcpy() call in ext3/resize.c (oopsable)
sbi->s_group_desc is an array of pointers to buffer_head. memcpy() of
buffer size from address of buffer_head is a bad idea - it will generate
junk in any case, may oops if buffer_head is close to the end of slab
page and next page is not mapped and isn't what was intended there.
IOW, ->b_data is missing in that call. Fortunately, result doesn't go
into the primary on-disk data structures, so only backup ones get crap
written to them; that had allowed this bug to remain unnoticed until
now.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ext3/resize.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ext3/resize.c b/fs/ext3/resize.c index c5ffa8523968..8aac5334680d 100644 --- a/fs/ext3/resize.c +++ b/fs/ext3/resize.c | |||
@@ -213,7 +213,7 @@ static int setup_new_group_blocks(struct super_block *sb, | |||
213 | goto exit_bh; | 213 | goto exit_bh; |
214 | } | 214 | } |
215 | lock_buffer(bh); | 215 | lock_buffer(bh); |
216 | memcpy(gdb->b_data, sbi->s_group_desc[i], bh->b_size); | 216 | memcpy(gdb->b_data, sbi->s_group_desc[i]->b_data, bh->b_size); |
217 | set_buffer_uptodate(gdb); | 217 | set_buffer_uptodate(gdb); |
218 | unlock_buffer(bh); | 218 | unlock_buffer(bh); |
219 | ext3_journal_dirty_metadata(handle, gdb); | 219 | ext3_journal_dirty_metadata(handle, gdb); |