<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/block, branch v3.4.45</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/drivers/block?h=v3.4.45</id>
<link rel='self' href='https://git.amat.us/linux/atom/drivers/block?h=v3.4.45'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2013-04-05T17:04:52Z</updated>
<entry>
<title>Revert "xen/blkback: Don't trust the handle from the frontend."</title>
<updated>2013-04-05T17:04:52Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2013-04-03T17:05:41Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=29fcbcb3e028d63c3bb8a396bd696f82803f8053'/>
<id>urn:sha1:29fcbcb3e028d63c3bb8a396bd696f82803f8053</id>
<content type='text'>
This reverts commit c93c85196e2c7001daa8a04b83a9d6dd4febfb59 which is
commit 01c681d4c70d64cb72142a2823f27c4146a02e63 upstream.

It shouldn't have been applied to the 3.4-stable tree, sorry about that.

Reported-by: William Dauchy &lt;wdauchy@gmail.com&gt;
Cc: Jan Beulich &lt;jbeulich@suse.com&gt;
Cc: Ian Campbell &lt;ian.campbell@citrix.com&gt;
Cc: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>aoe: reserve enough headroom on skbs</title>
<updated>2013-04-05T17:04:40Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2013-03-27T18:28:41Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=d97bcfae8bae32b72c12781fea0cf2ac1fd26776'/>
<id>urn:sha1:d97bcfae8bae32b72c12781fea0cf2ac1fd26776</id>
<content type='text'>
[ Upstream commit 91c5746425aed8f7188a351f1224a26aa232e4b3 ]

Some network drivers use a non default hard_header_len

Transmitted skb should take into account dev-&gt;hard_header_len, or risk
crashes or expensive reallocations.

In the case of aoe, lets reserve MAX_HEADER bytes.

David reported a crash in defxx driver, solved by this patch.

Reported-by: David Oostdyk &lt;daveo@ll.mit.edu&gt;
Tested-by: David Oostdyk &lt;daveo@ll.mit.edu&gt;
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Cc: Ed Cashin &lt;ecashin@coraid.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>loop: prevent bdev freeing while device in use</title>
<updated>2013-04-05T17:04:35Z</updated>
<author>
<name>Anatol Pomozov</name>
<email>anatol.pomozov@gmail.com</email>
</author>
<published>2013-04-01T16:47:56Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=ccb3d567d5c7aef76879349a192339569da94c17'/>
<id>urn:sha1:ccb3d567d5c7aef76879349a192339569da94c17</id>
<content type='text'>
commit c1681bf8a7b1b98edee8b862a42c19c4e53205fd upstream.

struct block_device lifecycle is defined by its inode (see fs/block_dev.c) -
block_device allocated first time we access /dev/loopXX and deallocated on
bdev_destroy_inode. When we create the device "losetup /dev/loopXX afile"
we want that block_device stay alive until we destroy the loop device
with "losetup -d".

But because we do not hold /dev/loopXX inode its counter goes 0, and
inode/bdev can be destroyed at any moment. Usually it happens at memory
pressure or when user drops inode cache (like in the test below). When later in
loop_clr_fd() we want to use bdev we have use-after-free error with following
stack:

BUG: unable to handle kernel NULL pointer dereference at 0000000000000280
  bd_set_size+0x10/0xa0
  loop_clr_fd+0x1f8/0x420 [loop]
  lo_ioctl+0x200/0x7e0 [loop]
  lo_compat_ioctl+0x47/0xe0 [loop]
  compat_blkdev_ioctl+0x341/0x1290
  do_filp_open+0x42/0xa0
  compat_sys_ioctl+0xc1/0xf20
  do_sys_open+0x16e/0x1d0
  sysenter_dispatch+0x7/0x1a

To prevent use-after-free we need to grab the device in loop_set_fd()
and put it later in loop_clr_fd().

The issue is reprodusible on current Linus head and v3.3. Here is the test:

  dd if=/dev/zero of=loop.file bs=1M count=1
  while [ true ]; do
    losetup /dev/loop0 loop.file
    echo 2 &gt; /proc/sys/vm/drop_caches
    losetup -d /dev/loop0
  done

[ Doing bdgrab/bput in loop_set_fd/loop_clr_fd is safe, because every
  time we call loop_set_fd() we check that loop_device-&gt;lo_state is
  Lo_unbound and set it to Lo_bound If somebody will try to set_fd again
  it will get EBUSY.  And if we try to loop_clr_fd() on unbound loop
  device we'll get ENXIO.

  loop_set_fd/loop_clr_fd (and any other loop ioctl) is called under
  loop_device-&gt;lo_ctl_mutex. ]

Signed-off-by: Anatol Pomozov &lt;anatol.pomozov@gmail.com&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>xen-blkback: fix dispatch_rw_block_io() error path</title>
<updated>2013-04-05T17:04:18Z</updated>
<author>
<name>Jan Beulich</name>
<email>JBeulich@suse.com</email>
</author>
<published>2013-03-11T09:39:55Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=2f21ae28ec704aa79dbbb912f20dd687ca0c001c'/>
<id>urn:sha1:2f21ae28ec704aa79dbbb912f20dd687ca0c001c</id>
<content type='text'>
commit 0e5e098ac22dae38f957e951b70d3cf73beff0f7 upstream.

Commit 7708992 ("xen/blkback: Seperate the bio allocation and the bio
submission") consolidated the pendcnt updates to just a single write,
neglecting the fact that the error path relied on it getting set to 1
up front (such that the decrement in __end_block_io_op() would actually
drop the count to zero, triggering the necessary cleanup actions).

Also remove a misleading and a stale (after said commit) comment.

Signed-off-by: Jan Beulich &lt;jbeulich@suse.com&gt;
Signed-off-by: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>xen/blkback: correctly respond to unknown, non-native requests</title>
<updated>2013-04-05T17:04:18Z</updated>
<author>
<name>David Vrabel</name>
<email>david.vrabel@citrix.com</email>
</author>
<published>2013-03-07T17:32:01Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=119016c59b6a83cf168f0f1202f2251122f0d5b3'/>
<id>urn:sha1:119016c59b6a83cf168f0f1202f2251122f0d5b3</id>
<content type='text'>
commit 0e367ae46503cfe7791460c8ba8434a5d60b2bd5 upstream.

If the frontend is using a non-native protocol (e.g., a 64-bit
frontend with a 32-bit backend) and it sent an unrecognized request,
the request was not translated and the response would have the
incorrect ID.  This may cause the frontend driver to behave
incorrectly or crash.

Since the ID field in the request is always in the same place,
regardless of the request type we can get the correct ID and make a
valid response (which will report BLKIF_RSP_EOPNOTSUPP).

This bug affected 64-bit SLES 11 guests when using a 32-bit backend.
This guest does a BLKIF_OP_RESERVED_1 (BLKIF_OP_PACKET in the SLES
source) and would crash in blkif_int() as the ID in the response would
be invalid.

Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
Signed-off-by: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>loopdev: remove an user triggerable oops</title>
<updated>2013-03-20T20:05:01Z</updated>
<author>
<name>Guo Chao</name>
<email>yan@linux.vnet.ibm.com</email>
</author>
<published>2013-02-21T23:16:49Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=51dfcbf53c4cc6b1a65a99f27cec3311531b982b'/>
<id>urn:sha1:51dfcbf53c4cc6b1a65a99f27cec3311531b982b</id>
<content type='text'>
commit b1a6650406875b9097a032eed89af50682fe1160 upstream.

When loopdev is built as module and we pass an invalid parameter,
loop_init() will return directly without deregister misc device, which
will cause an oops when insert loop module next time because we left some
garbage in the misc device list.

Test case:
sudo modprobe loop max_part=1024
(failed due to invalid parameter)
sudo modprobe loop
(oops)

Clean up nicely to avoid such oops.

Signed-off-by: Guo Chao &lt;yan@linux.vnet.ibm.com&gt;
Cc: Alexander Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: Guo Chao &lt;yan@linux.vnet.ibm.com&gt;
Cc: M. Hindess &lt;hindessm@uk.ibm.com&gt;
Cc: Nikanth Karthikesan &lt;knikanth@suse.de&gt;
Cc: Jens Axboe &lt;axboe@kernel.dk&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
Acked-by: Jeff Mahoney &lt;jeffm@suse.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>loopdev: fix a deadlock</title>
<updated>2013-03-20T20:05:01Z</updated>
<author>
<name>Guo Chao</name>
<email>yan@linux.vnet.ibm.com</email>
</author>
<published>2013-02-21T23:16:45Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=187c2bd82defa4d64910eed4d8c39ac93a984306'/>
<id>urn:sha1:187c2bd82defa4d64910eed4d8c39ac93a984306</id>
<content type='text'>
commit 5370019dc2d2c2ff90e95d181468071362934f3a upstream.

bd_mutex and lo_ctl_mutex can be held in different order.

Path #1:

blkdev_open
 blkdev_get
  __blkdev_get (hold bd_mutex)
   lo_open (hold lo_ctl_mutex)

Path #2:

blkdev_ioctl
 lo_ioctl (hold lo_ctl_mutex)
  lo_set_capacity (hold bd_mutex)

Lockdep does not report it, because path #2 actually holds a subclass of
lo_ctl_mutex.  This subclass seems creep into the code by mistake.  The
patch author actually just mentioned it in the changelog, see commit
f028f3b2 ("loop: fix circular locking in loop_clr_fd()"), also see:

	http://marc.info/?l=linux-kernel&amp;m=123806169129727&amp;w=2

Path #2 hold bd_mutex to call bd_set_size(), I've protected it
with i_mutex in a previous patch, so drop bd_mutex at this site.

Signed-off-by: Guo Chao &lt;yan@linux.vnet.ibm.com&gt;
Cc: Alexander Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: Guo Chao &lt;yan@linux.vnet.ibm.com&gt;
Cc: M. Hindess &lt;hindessm@uk.ibm.com&gt;
Cc: Nikanth Karthikesan &lt;knikanth@suse.de&gt;
Cc: Jens Axboe &lt;axboe@kernel.dk&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
Acked-by: Jeff Mahoney &lt;jeffm@suse.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>xen/blkback: Don't trust the handle from the frontend.</title>
<updated>2013-03-03T22:06:40Z</updated>
<author>
<name>Konrad Rzeszutek Wilk</name>
<email>konrad.wilk@oracle.com</email>
</author>
<published>2013-01-16T16:36:23Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=c93c85196e2c7001daa8a04b83a9d6dd4febfb59'/>
<id>urn:sha1:c93c85196e2c7001daa8a04b83a9d6dd4febfb59</id>
<content type='text'>
commit 01c681d4c70d64cb72142a2823f27c4146a02e63 upstream.

The 'handle' is the device that the request is from. For the life-time
of the ring we copy it from a request to a response so that the frontend
is not surprised by it. But we do not need it - when we start processing
I/Os we have our own 'struct phys_req' which has only most essential
information about the request. In fact the 'vbd_translate' ends up
over-writing the preq.dev with a value from the backend.

This assignment of preq.dev with the 'handle' value is superfluous
so lets not do it.

Acked-by: Jan Beulich &lt;jbeulich@suse.com&gt;
Acked-by: Ian Campbell &lt;ian.campbell@citrix.com&gt;
Signed-off-by: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>xen-blkback: do not leak mode property</title>
<updated>2013-03-03T22:06:40Z</updated>
<author>
<name>Jan Beulich</name>
<email>JBeulich@suse.com</email>
</author>
<published>2012-12-20T10:31:11Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f8cf1124a8f6cdd4ebc834ec3d848508e229e1d4'/>
<id>urn:sha1:f8cf1124a8f6cdd4ebc834ec3d848508e229e1d4</id>
<content type='text'>
commit 9d092603cc306ee6edfe917bf9ab8beb5f32d7bc upstream.

"be-&gt;mode" is obtained from xenbus_read(), which does a kmalloc() for
the message body. The short string is never released, so do it along
with freeing "be" itself, and make sure the string isn't kept when
backend_changed() doesn't complete successfully (which made it
desirable to slightly re-structure that function, so that the error
cleanup can be done in one place).

Reported-by: Olaf Hering &lt;olaf@aepfle.de&gt;
Signed-off-by: Jan Beulich &lt;jbeulich@suse.com&gt;
Signed-off-by: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>sunvdc: Fix off-by-one in generic_request().</title>
<updated>2013-02-28T14:59:02Z</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2013-02-14T19:49:01Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=5cf5b734496e73c30f43833138078ee7884ec725'/>
<id>urn:sha1:5cf5b734496e73c30f43833138078ee7884ec725</id>
<content type='text'>
[ Upstream commit f4d9605434c0fd4cc8639bf25cfc043418c52362 ]

The 'operations' bitmap corresponds one-for-one with the operation
codes, no adjustment is necessary.

Reported-by: Mark Kettenis &lt;mark.kettenis@xs4all.nl&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
