<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/block, branch linux-3.4.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-3.4.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-3.4.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2016-10-26T15:15:32Z</updated>
<entry>
<title>mac: validate mac_partition is within sector</title>
<updated>2016-10-26T15:15:32Z</updated>
<author>
<name>Kees Cook</name>
<email>keescook@chromium.org</email>
</author>
<published>2015-11-20T01:18:54Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=34a906cd9f6445d9510841667eff0d980279ebf3'/>
<id>urn:sha1:34a906cd9f6445d9510841667eff0d980279ebf3</id>
<content type='text'>
commit 02e2a5bfebe99edcf9d694575a75032d53fe1b73 upstream.

If md-&gt;signature == MAC_DRIVER_MAGIC and md-&gt;block_size == 1023, a single
512 byte sector would be read (secsize / 512). However the partition
structure would be located past the end of the buffer (secsize % 512).

Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
Signed-off-by: Zefan Li &lt;lizefan@huawei.com&gt;
</content>
</entry>
<entry>
<title>block: fix ext_dev_lock lockdep report</title>
<updated>2015-09-18T01:20:46Z</updated>
<author>
<name>Dan Williams</name>
<email>dan.j.williams@intel.com</email>
</author>
<published>2015-06-11T03:47:14Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=bd3fa7572a3793590ac024de5800b98cf2a1acfc'/>
<id>urn:sha1:bd3fa7572a3793590ac024de5800b98cf2a1acfc</id>
<content type='text'>
commit 4d66e5e9b6d720d8463e11d027bd4ad91c8b1318 upstream.

 =================================
 [ INFO: inconsistent lock state ]
 4.1.0-rc7+ #217 Tainted: G           O
 ---------------------------------
 inconsistent {SOFTIRQ-ON-W} -&gt; {IN-SOFTIRQ-W} usage.
 swapper/6/0 [HC0[0]:SC1[1]:HE1:SE0] takes:
  (ext_devt_lock){+.?...}, at: [&lt;ffffffff8143a60c&gt;] blk_free_devt+0x3c/0x70
 {SOFTIRQ-ON-W} state was registered at:
   [&lt;ffffffff810bf6b1&gt;] __lock_acquire+0x461/0x1e70
   [&lt;ffffffff810c1947&gt;] lock_acquire+0xb7/0x290
   [&lt;ffffffff818ac3a8&gt;] _raw_spin_lock+0x38/0x50
   [&lt;ffffffff8143a07d&gt;] blk_alloc_devt+0x6d/0xd0  &lt;-- take the lock in process context
[..]
  [&lt;ffffffff810bf64e&gt;] __lock_acquire+0x3fe/0x1e70
  [&lt;ffffffff810c00ad&gt;] ? __lock_acquire+0xe5d/0x1e70
  [&lt;ffffffff810c1947&gt;] lock_acquire+0xb7/0x290
  [&lt;ffffffff8143a60c&gt;] ? blk_free_devt+0x3c/0x70
  [&lt;ffffffff818ac3a8&gt;] _raw_spin_lock+0x38/0x50
  [&lt;ffffffff8143a60c&gt;] ? blk_free_devt+0x3c/0x70
  [&lt;ffffffff8143a60c&gt;] blk_free_devt+0x3c/0x70    &lt;-- take the lock in softirq
  [&lt;ffffffff8143bfec&gt;] part_release+0x1c/0x50
  [&lt;ffffffff8158edf6&gt;] device_release+0x36/0xb0
  [&lt;ffffffff8145ac2b&gt;] kobject_cleanup+0x7b/0x1a0
  [&lt;ffffffff8145aad0&gt;] kobject_put+0x30/0x70
  [&lt;ffffffff8158f147&gt;] put_device+0x17/0x20
  [&lt;ffffffff8143c29c&gt;] delete_partition_rcu_cb+0x16c/0x180
  [&lt;ffffffff8143c130&gt;] ? read_dev_sector+0xa0/0xa0
  [&lt;ffffffff810e0e0f&gt;] rcu_process_callbacks+0x2ff/0xa90
  [&lt;ffffffff810e0dcf&gt;] ? rcu_process_callbacks+0x2bf/0xa90
  [&lt;ffffffff81067e2e&gt;] __do_softirq+0xde/0x600

Neil sees this in his tests and it also triggers on pmem driver unbind
for the libnvdimm tests.  This fix is on top of an initial fix by Keith
for incorrect usage of mutex_lock() in this path: 2da78092dda1 "block:
Fix dev_t minor allocation lifetime".  Both this and 2da78092dda1 are
candidates for -stable.

Fixes: 2da78092dda1 ("block: Fix dev_t minor allocation lifetime")
Cc: Keith Busch &lt;keith.busch@intel.com&gt;
Reported-by: NeilBrown &lt;neilb@suse.de&gt;
Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
[lizf: Backported to 3.4: adjust context]
Signed-off-by: Zefan Li &lt;lizefan@huawei.com&gt;
</content>
</entry>
<entry>
<title>genhd: check for int overflow in disk_expand_part_tbl()</title>
<updated>2015-04-14T09:33:42Z</updated>
<author>
<name>Jens Axboe</name>
<email>axboe@fb.com</email>
</author>
<published>2014-11-19T20:06:22Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=45fdc587f1615d7fc4a318650c2bedc3c590f428'/>
<id>urn:sha1:45fdc587f1615d7fc4a318650c2bedc3c590f428</id>
<content type='text'>
commit 5fabcb4c33fe11c7e3afdf805fde26c1a54d0953 upstream.

We can get here from blkdev_ioctl() -&gt; blkpg_ioctl() -&gt; add_partition()
with a user passed in partno value. If we pass in 0x7fffffff, the
new target in disk_expand_part_tbl() overflows the 'int' and we
access beyond the end of ptbl-&gt;part[] and even write to it when we
do the rcu_assign_pointer() to assign the new partition.

Reported-by: David Ramos &lt;daramos@stanford.edu&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
Signed-off-by: Zefan Li &lt;lizefan@huawei.com&gt;
</content>
</entry>
<entry>
<title>scsi: Fix error handling in SCSI_IOCTL_SEND_COMMAND</title>
<updated>2015-02-02T09:05:03Z</updated>
<author>
<name>Jan Kara</name>
<email>jack@suse.cz</email>
</author>
<published>2014-10-23T02:13:39Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=981cf05b831a41bf4e73ee557d404568907f36ff'/>
<id>urn:sha1:981cf05b831a41bf4e73ee557d404568907f36ff</id>
<content type='text'>
commit 84ce0f0e94ac97217398b3b69c21c7a62ebeed05 upstream.

When sg_scsi_ioctl() fails to prepare request to submit in
blk_rq_map_kern() we jump to a label where we just end up copying
(luckily zeroed-out) kernel buffer to userspace instead of reporting
error. Fix the problem by jumping to the right label.

CC: Jens Axboe &lt;axboe@kernel.dk&gt;
CC: linux-scsi@vger.kernel.org
Coverity-id: 1226871
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;

Fixed up the, now unused, out label.

Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
Signed-off-by: Zefan Li &lt;lizefan@huawei.com&gt;
</content>
</entry>
<entry>
<title>block: fix alignment_offset math that assumes io_min is a power-of-2</title>
<updated>2015-02-02T09:04:48Z</updated>
<author>
<name>Mike Snitzer</name>
<email>snitzer@redhat.com</email>
</author>
<published>2014-10-08T22:26:13Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=c76a73b3d03e08074d08a7cbf1acb386a022a367'/>
<id>urn:sha1:c76a73b3d03e08074d08a7cbf1acb386a022a367</id>
<content type='text'>
commit b8839b8c55f3fdd60dc36abcda7e0266aff7985c upstream.

The math in both blk_stack_limits() and queue_limit_alignment_offset()
assume that a block device's io_min (aka minimum_io_size) is always a
power-of-2.  Fix the math such that it works for non-power-of-2 io_min.

This issue (of alignment_offset != 0) became apparent when testing
dm-thinp with a thinp blocksize that matches a RAID6 stripesize of
1280K.  Commit fdfb4c8c1 ("dm thin: set minimum_io_size to pool's data
block size") unlocked the potential for alignment_offset != 0 due to
the dm-thin-pool's io_min possibly being a non-power-of-2.

Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
Acked-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
Signed-off-by: Zefan Li &lt;lizefan@huawei.com&gt;
</content>
</entry>
<entry>
<title>genhd: fix leftover might_sleep() in blk_free_devt()</title>
<updated>2014-12-01T10:02:41Z</updated>
<author>
<name>Jens Axboe</name>
<email>axboe@fb.com</email>
</author>
<published>2014-09-16T19:38:51Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=62db31b50ea97524defc93b74a851e6d7ca864ed'/>
<id>urn:sha1:62db31b50ea97524defc93b74a851e6d7ca864ed</id>
<content type='text'>
commit 46f341ffcfb5d8530f7d1e60f3be06cce6661b62 upstream.

Commit 2da78092 changed the locking from a mutex to a spinlock,
so we now longer sleep in this context. But there was a leftover
might_sleep() in there, which now triggers since we do the final
free from an RCU callback. Get rid of it.

Reported-by: Pontus Fuchs &lt;pontus.fuchs@gmail.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
Signed-off-by: Zefan Li &lt;lizefan@huawei.com&gt;
</content>
</entry>
<entry>
<title>block: Fix dev_t minor allocation lifetime</title>
<updated>2014-12-01T10:02:26Z</updated>
<author>
<name>Keith Busch</name>
<email>keith.busch@intel.com</email>
</author>
<published>2014-08-26T15:05:36Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=45b95d1615eaf3efde4f7f9dd4ca83884d96db67'/>
<id>urn:sha1:45b95d1615eaf3efde4f7f9dd4ca83884d96db67</id>
<content type='text'>
commit 2da78092dda13f1efd26edbbf99a567776913750 upstream.

Releases the dev_t minor when all references are closed to prevent
another device from acquiring the same major/minor.

Since the partition's release may be invoked from call_rcu's soft-irq
context, the ext_dev_idr's mutex had to be replaced with a spinlock so
as not so sleep.

Signed-off-by: Keith Busch &lt;keith.busch@intel.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
[lizf: Backported to 3.4:
 - adjust context
 - remove idr_preload() and idr_preload_end()]
Signed-off-by: Zefan Li &lt;lizefan@huawei.com&gt;
</content>
</entry>
<entry>
<title>block: don't assume last put of shared tags is for the host</title>
<updated>2014-07-31T19:54:51Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2014-07-08T10:25:28Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=696acd9dc0b30f29ed9732b237c4670034e91863'/>
<id>urn:sha1:696acd9dc0b30f29ed9732b237c4670034e91863</id>
<content type='text'>
commit d45b3279a5a2252cafcd665bbf2db8c9b31ef783 upstream.

There is no inherent reason why the last put of a tag structure must be
the one for the Scsi_Host, as device model objects can be held for
arbitrary periods.  Merge blk_free_tags and __blk_free_tags into a single
funtion that just release a references and get rid of the BUG() when the
host reference wasn't the last.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>blktrace: fix accounting of partially completed requests</title>
<updated>2014-05-18T12:25:55Z</updated>
<author>
<name>Roman Pen</name>
<email>r.peniaev@gmail.com</email>
</author>
<published>2014-03-04T14:13:10Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=14eee5bd065d6aac0acbdc6092a25ba68c55b9c8'/>
<id>urn:sha1:14eee5bd065d6aac0acbdc6092a25ba68c55b9c8</id>
<content type='text'>
commit af5040da01ef980670b3741b3e10733ee3e33566 upstream.

trace_block_rq_complete does not take into account that request can
be partially completed, so we can get the following incorrect output
of blkparser:

  C   R 232 + 240 [0]
  C   R 240 + 232 [0]
  C   R 248 + 224 [0]
  C   R 256 + 216 [0]

but should be:

  C   R 232 + 8 [0]
  C   R 240 + 8 [0]
  C   R 248 + 8 [0]
  C   R 256 + 8 [0]

Also, the whole output summary statistics of completed requests and
final throughput will be incorrect.

This patch takes into account real completion size of the request and
fixes wrong completion accounting.

Signed-off-by: Roman Pen &lt;r.peniaev@gmail.com&gt;
CC: Steven Rostedt &lt;rostedt@goodmis.org&gt;
CC: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
CC: Ingo Molnar &lt;mingo@redhat.com&gt;
CC: linux-kernel@vger.kernel.org
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>block: Don't access request after it might be freed</title>
<updated>2014-03-11T23:10:06Z</updated>
<author>
<name>Roland Dreier</name>
<email>roland@purestorage.com</email>
</author>
<published>2012-11-22T10:00:11Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=0ef4c881e4ade7a45174d9cf45eca6f9e10f5ccc'/>
<id>urn:sha1:0ef4c881e4ade7a45174d9cf45eca6f9e10f5ccc</id>
<content type='text'>
commit 893d290f1d7496db97c9471bc352ad4a11dc8a25 upstream.

After we've done __elv_add_request() and __blk_run_queue() in
blk_execute_rq_nowait(), the request might finish and be freed
immediately.  Therefore checking if the type is REQ_TYPE_PM_RESUME
isn't safe afterwards, because if it isn't, rq might be gone.
Instead, check beforehand and stash the result in a temporary.

This fixes crashes in blk_execute_rq_nowait() I get occasionally when
running with lots of memory debugging options enabled -- I think this
race is usually harmless because the window for rq to be reallocated
is so small.

Signed-off-by: Roland Dreier &lt;roland@purestorage.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
[xr: Backported to 3.4: adjust context]
Signed-off-by: Rui Xiang &lt;rui.xiang@huawei.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
</feed>
