<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/btrfs, branch linux-2.6.37.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.37.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.37.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2011-03-23T19:49:56Z</updated>
<entry>
<title>Btrfs: deal with short returns from copy_from_user</title>
<updated>2011-03-23T19:49:56Z</updated>
<author>
<name>Chris Mason</name>
</author>
<published>2011-03-07T16:10:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=64bb48e4e88b52e05e36b8b0d033a17fa9102962'/>
<id>urn:sha1:64bb48e4e88b52e05e36b8b0d033a17fa9102962</id>
<content type='text'>
commit 31339acd07b4ba687906702085127895a56eb920 upstream.

When copy_from_user is only able to copy some of the bytes we requested,
we may end up creating a partially up to date page.  To avoid garbage in
the page, we need to treat a partial copy as a zero length copy.

This makes the rest of the file_write code drop the page and
retry the whole copy instead of marking the partially up to
date page as dirty.

Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>btrfs: prevent heap corruption in btrfs_ioctl_space_info()</title>
<updated>2011-02-24T22:54:28Z</updated>
<author>
<name>Dan Rosenberg</name>
</author>
<published>2011-02-14T21:04:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=05b3244cf2cfabcb523583cd3c1161d870e70898'/>
<id>urn:sha1:05b3244cf2cfabcb523583cd3c1161d870e70898</id>
<content type='text'>
commit 51788b1bdd0d68345bab0af4301e7fa429277228 upstream.

Commit bf5fc093c5b625e4259203f1cee7ca73488a5620 refactored
btrfs_ioctl_space_info() and introduced several security issues.

space_args.space_slots is an unsigned 64-bit type controlled by a
possibly unprivileged caller.  The comparison as a signed int type
allows providing values that are treated as negative and cause the
subsequent allocation size calculation to wrap, or be truncated to 0.
By providing a size that's truncated to 0, kmalloc() will return
ZERO_SIZE_PTR.  It's also possible to provide a value smaller than the
slot count.  The subsequent loop ignores the allocation size when
copying data in, resulting in a heap overflow or write to ZERO_SIZE_PTR.

The fix changes the slot count type and comparison typecast to u64,
which prevents truncation or signedness errors, and also ensures that we
don't copy more data than we've allocated in the subsequent loop.  Note
that zero-size allocations are no longer possible since there is already
an explicit check for space_args.space_slots being 0 and truncation of
this value is no longer an issue.

Signed-off-by: Dan Rosenberg &lt;drosenberg@vsecurity.com&gt;
Signed-off-by: Josef Bacik &lt;josef@redhat.com&gt;
Reviewed-by: Josef Bacik &lt;josef@redhat.com&gt;
Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>Fix btrfs b0rkage</title>
<updated>2010-12-20T17:09:57Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2010-12-20T15:53:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3cb50ddf97a0a1ca4c68bc12fa1e727a6b45fbf2'/>
<id>urn:sha1:3cb50ddf97a0a1ca4c68bc12fa1e727a6b45fbf2</id>
<content type='text'>
Buggered-in: 76dda93c6ae2 ("Btrfs: add snapshot/subvolume destroy
ioctl")

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Acked-by: Chris Mason &lt;chris.mason@oracle.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable</title>
<updated>2010-12-14T19:08:13Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2010-12-14T19:08:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e13cf63f2bbd38721af557f0205da994ea068427'/>
<id>urn:sha1:e13cf63f2bbd38721af557f0205da994ea068427</id>
<content type='text'>
* git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable:
  Btrfs: prevent RAID level downgrades when space is low
  Btrfs: account for missing devices in RAID allocation profiles
  Btrfs: EIO when we fail to read tree roots
  Btrfs: fix compiler warnings
  Btrfs: Make async snapshot ioctl more generic
  Btrfs: pwrite blocked when writing from the mmaped buffer of the same page
  Btrfs: Fix a crash when mounting a subvolume
  Btrfs: fix sync subvol/snapshot creation
  Btrfs: Fix page leak in compressed writeback path
  Btrfs: do not BUG if we fail to remove the orphan item for dead snapshots
  Btrfs: fixup return code for btrfs_del_orphan_item
  Btrfs: do not do fast caching if we are allocating blocks for tree_root
  Btrfs: deal with space cache errors better
  Btrfs: fix use after free in O_DIRECT
</content>
</entry>
<entry>
<title>Btrfs: prevent RAID level downgrades when space is low</title>
<updated>2010-12-14T01:07:01Z</updated>
<author>
<name>Chris Mason</name>
</author>
<published>2010-12-13T20:06:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=83a50de97fe96aca82389e061862ed760ece2283'/>
<id>urn:sha1:83a50de97fe96aca82389e061862ed760ece2283</id>
<content type='text'>
The extent allocator has code that allows us to fill
allocations from any available block group, even if it doesn't
match the raid level we've requested.

This was put in because adding a new drive to a filesystem
made with the default mkfs options actually upgrades the metadata from
single spindle dup to full RAID1.

But, the code also allows us to allocate from a raid0 chunk when we
really want a raid1 or raid10 chunk.  This can cause big trouble because
mkfs creates a small (4MB) raid0 chunk for data and metadata which then
goes unused for raid1/raid10 installs.

The allocator will happily wander in and allocate from that chunk when
things get tight, which is not correct.

The fix here is to make sure that we provide duplication when the
caller has asked for it.  It does all the dups to be any raid level,
which preserves the dup-&gt;raid1 upgrade abilities.

Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
</content>
</entry>
<entry>
<title>Btrfs: account for missing devices in RAID allocation profiles</title>
<updated>2010-12-14T01:06:52Z</updated>
<author>
<name>Chris Mason</name>
</author>
<published>2010-12-13T19:56:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cd02dca56442e1504fd6bc5b96f7f1870162b266'/>
<id>urn:sha1:cd02dca56442e1504fd6bc5b96f7f1870162b266</id>
<content type='text'>
When we mount in RAID degraded mode without adding a new device to
replace the failed one, we can end up using the wrong RAID flags for
allocations.

This results in strange combinations of block groups (raid1 in a raid10
filesystem) and corruptions when we try to allocate blocks from single
spindle chunks on drives that are actually missing.

The first device has two small 4MB chunks in it that mkfs creates and
these are usually unused in a raid1 or raid10 setup.  But, in -o degraded,
the allocator will fall back to these because the mask of desired raid groups
isn't correct.

The fix here is to count the missing devices as we build up the list
of devices in the system.  This count is used when picking the
raid level to make sure we continue using the same levels that were
in place before we lost a drive.

Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
</content>
</entry>
<entry>
<title>Btrfs: EIO when we fail to read tree roots</title>
<updated>2010-12-13T19:47:58Z</updated>
<author>
<name>Chris Mason</name>
</author>
<published>2010-12-13T19:47:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=68433b73b104bff388aac376631d32abbbd872b0'/>
<id>urn:sha1:68433b73b104bff388aac376631d32abbbd872b0</id>
<content type='text'>
If we just get a plain IO error when we read tree roots, the code
wasn't properly sending that error up the chain.  This allowed mounts to
continue when they should failed, and allowed operations
on partially setup root structs.  The end result was usually oopsen
on spinlocks that hadn't been spun up correctly.

Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
</content>
</entry>
<entry>
<title>Btrfs: fix compiler warnings</title>
<updated>2010-12-10T21:29:11Z</updated>
<author>
<name>Jan Beulich</name>
</author>
<published>2010-12-07T14:54:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3dd1462e82bcab7625cec129952f26dae7a8b742'/>
<id>urn:sha1:3dd1462e82bcab7625cec129952f26dae7a8b742</id>
<content type='text'>
... regarding an unused function when !MIGRATION, and regarding a
printk() format string vs argument mismatch.

Signed-off-by: Jan Beulich &lt;jbeulich@novell.com&gt;
Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
</content>
</entry>
<entry>
<title>Btrfs: Make async snapshot ioctl more generic</title>
<updated>2010-12-10T21:29:11Z</updated>
<author>
<name>Li Zefan</name>
</author>
<published>2010-12-10T06:41:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fdfb1e4f6c61477a61890b64974d65cdc3a98702'/>
<id>urn:sha1:fdfb1e4f6c61477a61890b64974d65cdc3a98702</id>
<content type='text'>
If we had reserved some bytes in struct btrfs_ioctl_vol_args, we
wouldn't have to create a new structure for async snapshot creation.

Here we convert async snapshot ioctl to use a more generic ABI, as
we'll add more ioctls for snapshots/subvolumes in the future, readonly
snapshots for example.

Signed-off-by: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
</content>
</entry>
<entry>
<title>Btrfs: pwrite blocked when writing from the mmaped buffer of the same page</title>
<updated>2010-12-10T21:29:10Z</updated>
<author>
<name>Xin Zhong</name>
</author>
<published>2010-12-09T09:30:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=914ee295af418e936ec20a08c1663eaabe4cd07a'/>
<id>urn:sha1:914ee295af418e936ec20a08c1663eaabe4cd07a</id>
<content type='text'>
This problem is found in meego testing:
http://bugs.meego.com/show_bug.cgi?id=6672
A file in btrfs is mmaped and the mmaped buffer is passed to pwrite to write to the same page
of the same file. In btrfs_file_aio_write(), the pages is locked by prepare_pages(). So when
btrfs_copy_from_user() is called, page fault happens and the same page needs to be locked again
in filemap_fault(). The fix is to move iov_iter_fault_in_readable() before prepage_pages() to make page
fault happen before pages are locked. And also disable page fault in critical region in
btrfs_copy_from_user().

Reviewed-by: Yan, Zheng&lt;zheng.z.yan@intel.com&gt;
Signed-off-by: Zhong, Xin &lt;xin.zhong@intel.com&gt;
Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
</content>
</entry>
</feed>
