<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/ext4/resize.c, branch linux-3.12.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.12.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.12.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2016-02-24T09:23:19Z</updated>
<entry>
<title>ext4: fix potential integer overflow</title>
<updated>2016-02-24T09:23:19Z</updated>
<author>
<name>Insu Yun</name>
</author>
<published>2016-02-12T06:15:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b7993fb7ce48ca9ba2cfba6226c0f54db589fb9d'/>
<id>urn:sha1:b7993fb7ce48ca9ba2cfba6226c0f54db589fb9d</id>
<content type='text'>
commit 46901760b46064964b41015d00c140c83aa05bcf upstream.

Since sizeof(ext_new_group_data) &gt; sizeof(ext_new_flex_group_data),
integer overflow could be happened.
Therefore, need to fix integer overflow sanitization.

Signed-off-by: Insu Yun &lt;wuninsu@gmail.com&gt;
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;

</content>
</entry>
<entry>
<title>fix calculation of meta_bg descriptor backups</title>
<updated>2016-02-15T16:07:50Z</updated>
<author>
<name>Andy Leiserson</name>
</author>
<published>2015-10-18T04:36:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a6abf86bb91493fe8b94268219d99e42788fa110'/>
<id>urn:sha1:a6abf86bb91493fe8b94268219d99e42788fa110</id>
<content type='text'>
commit 904dad4742d211b7a8910e92695c0fa957483836 upstream.

"group" is the group where the backup will be placed, and is
initialized to zero in the declaration. This meant that backups for
meta_bg descriptors were erroneously written to the backup block group
descriptors in groups 1 and (desc_per_block-1).

Reproduction information:
  mke2fs -Fq -t ext4 -b 1024 -O ^resize_inode /tmp/foo.img 16G
  truncate -s 24G /tmp/foo.img
  losetup /dev/loop0 /tmp/foo.img
  mount /dev/loop0 /mnt
  resize2fs /dev/loop0
  umount /dev/loop0
  dd if=/dev/zero of=/dev/loop0 bs=1024 count=2
  e2fsck -fy /dev/loop0
  losetup -d /dev/loop0

Signed-off-by: Andy Leiserson &lt;andy@leiserson.org&gt;
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;

</content>
</entry>
<entry>
<title>ext4: fix overflow when updating superblock backups after resize</title>
<updated>2014-11-13T18:02:36Z</updated>
<author>
<name>Jan Kara</name>
</author>
<published>2014-10-30T14:52:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6eac6ac49db2487a748258be990a34cff73dc792'/>
<id>urn:sha1:6eac6ac49db2487a748258be990a34cff73dc792</id>
<content type='text'>
commit 9378c6768e4fca48971e7b6a9075bc006eda981d upstream.

When there are no meta block groups update_backups() will compute the
backup block in 32-bit arithmetics thus possibly overflowing the block
number and corrupting the filesystem. OTOH filesystems without meta
block groups larger than 16 TB should be rare. Fix the problem by doing
the counting in 64-bit arithmetics.

Coverity-id: 741252
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
Reviewed-by: Lukas Czerner &lt;lczerner@redhat.com&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
</entry>
<entry>
<title>ext4: Replace open coded mdata csum feature to helper function</title>
<updated>2014-11-13T18:02:35Z</updated>
<author>
<name>Dmitry Monakhov</name>
</author>
<published>2014-10-13T07:36:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c8137a7d271bc709697ecac2dfc88d6a226f2124'/>
<id>urn:sha1:c8137a7d271bc709697ecac2dfc88d6a226f2124</id>
<content type='text'>
commit 9aa5d32ba269bec0e7eaba2697a986a7b0bc8528 upstream.

Besides the fact that this replacement improves code readability
it also protects from errors caused direct EXT4_S(sb)-&gt;s_es manipulation
which may result attempt to use uninitialized  csum machinery.

#Testcase_BEGIN
IMG=/dev/ram0
MNT=/mnt
mkfs.ext4 $IMG
mount $IMG $MNT
#Enable feature directly on disk, on mounted fs
tune2fs -O metadata_csum  $IMG
# Provoke metadata update, likey result in OOPS
touch $MNT/test
umount $MNT
#Testcase_END

# Replacement script
@@
expression E;
@@
- EXT4_HAS_RO_COMPAT_FEATURE(E, EXT4_FEATURE_RO_COMPAT_METADATA_CSUM)
+ ext4_has_metadata_csum(E)

https://bugzilla.kernel.org/show_bug.cgi?id=82201

Signed-off-by: Dmitry Monakhov &lt;dmonakhov@openvz.org&gt;
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
</entry>
<entry>
<title>ext4: fix online resize with a non-standard blocks per group setting</title>
<updated>2014-03-05T16:13:39Z</updated>
<author>
<name>Theodore Ts'o</name>
</author>
<published>2014-02-16T03:42:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=50e31fc3f09c418d312d4129d8f01f607087bd5a'/>
<id>urn:sha1:50e31fc3f09c418d312d4129d8f01f607087bd5a</id>
<content type='text'>
commit 3d2660d0c9c2f296837078c189b68a47f6b2e3b5 upstream.

The set_flexbg_block_bitmap() function assumed that the number of
blocks in a blockgroup was sb-&gt;blocksize * 8, which is normally true,
but not always!  Use EXT4_BLOCKS_PER_GROUP(sb) instead, to fix block
bitmap corruption after:

mke2fs -t ext4 -g 3072 -i 4096 /dev/vdd 1G
mount -t ext4 /dev/vdd /vdd
resize2fs /dev/vdd 8G

Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Reported-by: Jon Bernard &lt;jbernard@tuxion.com&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;

</content>
</entry>
<entry>
<title>ext4: fix online resize with very large inode tables</title>
<updated>2014-03-05T16:13:39Z</updated>
<author>
<name>Theodore Ts'o</name>
</author>
<published>2014-02-16T02:33:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c6f75d48dffe9216edacf94205ab55aebe67e46f'/>
<id>urn:sha1:c6f75d48dffe9216edacf94205ab55aebe67e46f</id>
<content type='text'>
commit b93c95353413041a8cebad915a8109619f66bcc6 upstream.

If a file system has a large number of inodes per block group, all of
the metadata blocks in a flex_bg may be larger than what can fit in a
single block group.  Unfortunately, ext4_alloc_group_tables() in
resize.c was never tested to see if it would handle this case
correctly, and there were a large number of bugs which caused the
following sequence to result in a BUG_ON:

kernel bug at fs/ext4/resize.c:409!
   ...
call trace:
 [&lt;ffffffff81256768&gt;] ext4_flex_group_add+0x1448/0x1830
 [&lt;ffffffff81257de2&gt;] ext4_resize_fs+0x7b2/0xe80
 [&lt;ffffffff8123ac50&gt;] ext4_ioctl+0xbf0/0xf00
 [&lt;ffffffff811c111d&gt;] do_vfs_ioctl+0x2dd/0x4b0
 [&lt;ffffffff811b9df2&gt;] ? final_putname+0x22/0x50
 [&lt;ffffffff811c1371&gt;] sys_ioctl+0x81/0xa0
 [&lt;ffffffff81676aa9&gt;] system_call_fastpath+0x16/0x1b
code: c8 4c 89 df e8 41 96 f8 ff 44 89 e8 49 01 c4 44 29 6d d4 0
rip  [&lt;ffffffff81254fa1&gt;] set_flexbg_block_bitmap+0x171/0x180


This can be reproduced with the following command sequence:

   mke2fs -t ext4 -i 4096 /dev/vdd 1G
   mount -t ext4 /dev/vdd /vdd
   resize2fs /dev/vdd 8G

To fix this, we need to make sure the right thing happens when a block
group's inode table straddles two block groups, which means the
following bugs had to be fixed:

1) Not clearing the BLOCK_UNINIT flag in the second block group in
   ext4_alloc_group_tables --- the was proximate cause of the BUG_ON.

2) Incorrectly determining how many block groups contained contiguous
   free blocks in ext4_alloc_group_tables().

3) Incorrectly setting the start of the next block range to be marked
   in use after a discontinuity in setup_new_flex_group_blocks().

Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;

</content>
</entry>
<entry>
<title>ext4: fix corruption when online resizing a fs with 1K block size</title>
<updated>2013-07-01T12:12:08Z</updated>
<author>
<name>Maarten ter Huurne</name>
</author>
<published>2013-07-01T12:12:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6ca792edc13c409e8d4eb9001e048264c6a2eb64'/>
<id>urn:sha1:6ca792edc13c409e8d4eb9001e048264c6a2eb64</id>
<content type='text'>
Subtracting the number of the first data block places the superblock
backups one block too early, corrupting the file system. When the block
size is larger than 1K, the first data block is 0, so the subtraction
has no effect and no corruption occurs.

Signed-off-by: Maarten ter Huurne &lt;maarten@treewalker.org&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Reviewed-by: Jan Kara &lt;jack@suse.cz&gt;
CC: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>ext4: delete unused variables</title>
<updated>2013-06-17T12:56:26Z</updated>
<author>
<name>Jon Ernst</name>
</author>
<published>2013-06-17T12:56:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=03b40e349695dc700582568e5b410a89058f707e'/>
<id>urn:sha1:03b40e349695dc700582568e5b410a89058f707e</id>
<content type='text'>
This patch removed several unused variables.

Signed-off-by: Jon Ernst &lt;jonernst07@gmx.com&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>ext4: verify group number in verify_group_input() before using it</title>
<updated>2013-06-06T15:14:31Z</updated>
<author>
<name>Theodore Ts'o</name>
</author>
<published>2013-06-06T15:14:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b302ef2d3c73d8a07ed2f0679ce35f00b6dcacef'/>
<id>urn:sha1:b302ef2d3c73d8a07ed2f0679ce35f00b6dcacef</id>
<content type='text'>
Check the group number for sanity earilier, before calling routines
such as ext4_bg_has_super() or ext4_group_overhead_blocks().

Reported-by: Jonathan Salwan &lt;jonathan.salwan@gmail.com&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>ext4: add check for inodes_count overflow in new resize ioctl</title>
<updated>2013-04-22T02:56:32Z</updated>
<author>
<name>Theodore Ts'o</name>
</author>
<published>2013-04-22T02:56:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3f8a6411fbada1fa482276591e037f3b1adcf55b'/>
<id>urn:sha1:3f8a6411fbada1fa482276591e037f3b1adcf55b</id>
<content type='text'>
Addresses-Red-Hat-Bugzilla: #913245

Reported-by: Eric Sandeen &lt;sandeen@redhat.com&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Reviewed-by: Carlos Maiolino &lt;cmaiolino@redhat.com&gt;
Cc: stable@vger.kernel.org
</content>
</entry>
</feed>
