<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/block, branch v4.9</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.9</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.9'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2016-12-08T01:10:00Z</updated>
<entry>
<title>zram: restrict add/remove attributes to root only</title>
<updated>2016-12-08T01:10:00Z</updated>
<author>
<name>Sergey Senozhatsky</name>
<email>sergey.senozhatsky@gmail.com</email>
</author>
<published>2016-12-07T22:44:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5c7e9ccd91b90d87029261f8856294ee51934cab'/>
<id>urn:sha1:5c7e9ccd91b90d87029261f8856294ee51934cab</id>
<content type='text'>
zram hot_add sysfs attribute is a very 'special' attribute - reading
from it creates a new uninitialized zram device.  This file, by a
mistake, can be read by a 'normal' user at the moment, while only root
must be able to create a new zram device, therefore hot_add attribute
must have S_IRUSR mode, not S_IRUGO.

[akpm@linux-foundation.org: s/sence/sense/, reflow comment to use 80 cols]
Fixes: 6566d1a32bf72 ("zram: add dynamic device add/remove functionality")
Link: http://lkml.kernel.org/r/20161205155845.20129-1-sergey.senozhatsky@gmail.com
Signed-off-by: Sergey Senozhatsky &lt;sergey.senozhatsky@gmail.com&gt;
Reported-by: Steven Allen &lt;steven@stebalien.com&gt;
Acked-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: Minchan Kim &lt;minchan@kernel.org&gt;
Cc: &lt;stable@vger.kernel.org&gt;    [4.2+]
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>zram: fix unbalanced idr management at hot removal</title>
<updated>2016-12-01T00:32:52Z</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2016-11-30T23:54:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=529e71e16403830ae0d737a66c55c5f360f3576b'/>
<id>urn:sha1:529e71e16403830ae0d737a66c55c5f360f3576b</id>
<content type='text'>
The zram hot removal code calls idr_remove() even when zram_remove()
returns an error (typically -EBUSY).  This results in a leftover at the
device release, eventually leading to a crash when the module is
reloaded.

As described in the bug report below, the following procedure would
cause an Oops with zram:

 - provision three zram devices via modprobe zram num_devices=3
 - configure a size for each device
   + echo "1G" &gt; /sys/block/$zram_name/disksize
 - mkfs and mount zram0 only
 - attempt to hot remove all three devices
   + echo 2 &gt; /sys/class/zram-control/hot_remove
   + echo 1 &gt; /sys/class/zram-control/hot_remove
   + echo 0 &gt; /sys/class/zram-control/hot_remove
     - zram0 removal fails with EBUSY, as expected
 - unmount zram0
 - try zram0 hot remove again
   + echo 0 &gt; /sys/class/zram-control/hot_remove
     - fails with ENODEV (unexpected)
 - unload zram kernel module
   + completes successfully
 - zram0 device node still exists
 - attempt to mount /dev/zram0
   + mount command is killed
   + following BUG is encountered

 BUG: unable to handle kernel paging request at ffffffffa0002ba0
 IP: get_disk+0x16/0x50
 Oops: 0000 [#1] SMP
 CPU: 0 PID: 252 Comm: mount Not tainted 4.9.0-rc6 #176
 Call Trace:
   exact_lock+0xc/0x20
   kobj_lookup+0xdc/0x160
   get_gendisk+0x2f/0x110
   __blkdev_get+0x10c/0x3c0
   blkdev_get+0x19d/0x2e0
   blkdev_open+0x56/0x70
   do_dentry_open.isra.19+0x1ff/0x310
   vfs_open+0x43/0x60
   path_openat+0x2c9/0xf30
   do_filp_open+0x79/0xd0
   do_sys_open+0x114/0x1e0
   SyS_open+0x19/0x20
   entry_SYSCALL_64_fastpath+0x13/0x94

This patch adds the proper error check in hot_remove_store() not to call
idr_remove() unconditionally.

Fixes: 17ec4cd98578 ("zram: don't call idr_remove() from zram_remove()")
Bugzilla: https://bugzilla.opensuse.org/show_bug.cgi?id=1010970
Link: http://lkml.kernel.org/r/20161121132140.12683-1-tiwai@suse.de
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Reviewed-by: David Disseldorp &lt;ddiss@suse.de&gt;
Reported-by: David Disseldorp &lt;ddiss@suse.de&gt;
Tested-by: David Disseldorp &lt;ddiss@suse.de&gt;
Acked-by: Minchan Kim &lt;minchan@kernel.org&gt;
Acked-by: Sergey Senozhatsky &lt;sergey.senozhatsky@gmail.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;    [4.4+]
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>aoe: fix crash in page count manipulation</title>
<updated>2016-11-12T15:27:07Z</updated>
<author>
<name>Jens Axboe</name>
<email>axboe@fb.com</email>
</author>
<published>2016-11-12T01:28:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0cbc72a1781250f373327dd7e306e33859a42154'/>
<id>urn:sha1:0cbc72a1781250f373327dd7e306e33859a42154</id>
<content type='text'>
aoeblk contains some mysterious code, that wants to elevate the bio
vec page counts while it's under IO. That is not needed, it's
fragile, and it's causing kernel oopses for some.

Reported-by: Tested-by: Don Koch &lt;kochd@us.ibm.com&gt;
Tested-by: Tested-by: Don Koch &lt;kochd@us.ibm.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
</entry>
<entry>
<title>drbd: Fix kernel_sendmsg() usage - potential NULL deref</title>
<updated>2016-11-10T00:08:32Z</updated>
<author>
<name>Richard Weinberger</name>
<email>richard@nod.at</email>
</author>
<published>2016-11-09T21:52:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d8e9e5e80e882b4f90cba7edf1e6cb7376e52e54'/>
<id>urn:sha1:d8e9e5e80e882b4f90cba7edf1e6cb7376e52e54</id>
<content type='text'>
Don't pass a size larger than iov_len to kernel_sendmsg().
Otherwise it will cause a NULL pointer deref when kernel_sendmsg()
returns with rv &lt; size.

DRBD as external module has been around in the kernel 2.4 days already.
We used to be compatible to 2.4 and very early 2.6 kernels,
we used to use
 rv = sock_sendmsg(sock, &amp;msg, iov.iov_len);
then later changed to
 rv = kernel_sendmsg(sock, &amp;msg, &amp;iov, 1, size);
when we should have used
 rv = kernel_sendmsg(sock, &amp;msg, &amp;iov, 1, iov.iov_len);

tcp_sendmsg() used to totally ignore the size parameter.
 57be5bd ip: convert tcp_sendmsg() to iov_iter primitives
changes that, and exposes our long standing error.

Even with this error exposed, to trigger the bug, we would need to have
an environment (config or otherwise) causing us to not use sendpage()
for larger transfers, a failing connection, and have it fail "just at the
right time".  Apparently that was unlikely enough for most, so this went
unnoticed for years.

Still, it is known to trigger at least some of these,
and suspected for the others:
[0] http://lists.linbit.com/pipermail/drbd-user/2016-July/023112.html
[1] http://lists.linbit.com/pipermail/drbd-dev/2016-March/003362.html
[2] https://forums.grsecurity.net/viewtopic.php?f=3&amp;t=4546
[3] https://ubuntuforums.org/showthread.php?t=2336150
[4] http://e2.howsolveproblem.com/i/1175162/

This should go into 4.9,
and into all stable branches since and including v4.0,
which is the first to contain the exposing change.

It is correct for all stable branches older than that as well
(which contain the DRBD driver; which is 2.6.33 and up).

It requires a small "conflict" resolution for v4.4 and earlier, with v4.5
we dropped the comment block immediately preceding the kernel_sendmsg().

Fixes: b411b3637fa7 ("The DRBD driver")
Cc: &lt;stable@vger.kernel.org&gt; # 2.6.33.x-
Cc: viro@zeniv.linux.org.uk
Cc: christoph.lechleitner@iteg.at
Cc: wolfgang.glas@iteg.at
Reported-by: Christoph Lechleitner &lt;christoph.lechleitner@iteg.at&gt;
Tested-by: Christoph Lechleitner &lt;christoph.lechleitner@iteg.at&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
[changed oneliner to be "obvious" without context; more verbose message]
Signed-off-by: Lars Ellenberg &lt;lars.ellenberg@linbit.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
</entry>
<entry>
<title>nbd: Fix error handling</title>
<updated>2016-11-06T21:14:59Z</updated>
<author>
<name>Christophe JAILLET</name>
<email>christophe.jaillet@wanadoo.fr</email>
</author>
<published>2016-10-30T04:28:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=772918524dfb8c8869120728c1b1109a2d49493c'/>
<id>urn:sha1:772918524dfb8c8869120728c1b1109a2d49493c</id>
<content type='text'>
'blk_mq_alloc_request()' returns an error pointer in case of error, not
NULL. So test it with IS_ERR.

Fixes: 	fd8383fd88a2 ("nbd: convert to blkmq")

Signed-off-by: Christophe JAILLET &lt;christophe.jaillet@wanadoo.fr&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
</entry>
<entry>
<title>virtio_blk: Delete an unnecessary initialisation in init_vq()</title>
<updated>2016-10-30T22:21:47Z</updated>
<author>
<name>Markus Elfring</name>
<email>elfring@users.sourceforge.net</email>
</author>
<published>2016-09-13T11:43:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2ff98449ee883d6e7484f5937370df42d6789e07'/>
<id>urn:sha1:2ff98449ee883d6e7484f5937370df42d6789e07</id>
<content type='text'>
The local variable "err" will be set to an appropriate value
by a following statement.
Thus omit the explicit initialisation at the beginning.

Signed-off-by: Markus Elfring &lt;elfring@users.sourceforge.net&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>virtio_blk: Use kmalloc_array() in init_vq()</title>
<updated>2016-10-30T22:21:46Z</updated>
<author>
<name>Markus Elfring</name>
<email>elfring@users.sourceforge.net</email>
</author>
<published>2016-09-13T09:32:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=668866b6e8dffa5583d8694f1d8ddd89a8bee745'/>
<id>urn:sha1:668866b6e8dffa5583d8694f1d8ddd89a8bee745</id>
<content type='text'>
Multiplications for the size determination of memory allocations
indicated that array data structures should be processed.
Thus use the corresponding function "kmalloc_array".

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring &lt;elfring@users.sourceforge.net&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>block: DAC960: print a hex number after a 0x prefix</title>
<updated>2016-10-28T01:43:43Z</updated>
<author>
<name>Uwe Kleine-König</name>
<email>u.kleine-koenig@pengutronix.de</email>
</author>
<published>2016-10-28T00:47:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ee52c44dee63ff2686a7b0d98fff7c80852ac022'/>
<id>urn:sha1:ee52c44dee63ff2686a7b0d98fff7c80852ac022</id>
<content type='text'>
It makes the message hard to interpret correctly if a base 10 number is
prefixed by 0x.  So change to a hex number.

Link: http://lkml.kernel.org/r/20161026125658.25728-3-u.kleine-koenig@pengutronix.de
Signed-off-by: Uwe Kleine-König &lt;u.kleine-koenig@pengutronix.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>nbd: fix incorrect unlock of nbd-&gt;sock_lock in sock_shutdown</title>
<updated>2016-10-24T19:18:14Z</updated>
<author>
<name>John W. Linville</name>
<email>linville@tuxdriver.com</email>
</author>
<published>2016-10-24T19:13:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=423221d1745b53656db896bd34646d09d620c759'/>
<id>urn:sha1:423221d1745b53656db896bd34646d09d620c759</id>
<content type='text'>
Commit 0eadf37afc250 ("nbd: allow block mq to deal with timeouts")
changed normal usage of nbd-&gt;sock_lock to use spin_lock/spin_unlock
rather than the *_irq variants, but it missed this unlock in an
error path.

Found by Coverity, CID 1373871.

Signed-off-by: John W. Linville &lt;linville@tuxdriver.com&gt;
Cc: Josef Bacik &lt;jbacik@fb.com&gt;
Cc: Jens Axboe &lt;axboe@fb.com&gt;
Cc: Markus Pargmann &lt;mpa@pengutronix.de&gt;
Fixes: 0eadf37afc250 ("nbd: allow block mq to deal with timeouts")
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
</entry>
<entry>
<title>rbd: don't retry watch reregistration if header object is gone</title>
<updated>2016-10-15T21:22:09Z</updated>
<author>
<name>Ilya Dryomov</name>
<email>idryomov@gmail.com</email>
</author>
<published>2016-09-29T12:23:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4d73644bc3d76dd161a84e3849c6f2c9c01c4ba7'/>
<id>urn:sha1:4d73644bc3d76dd161a84e3849c6f2c9c01c4ba7</id>
<content type='text'>
If the header object gets deleted (perhaps along with the entire pool),
there is no point in attempting to reregister the watch.  Treat this
the same as blacklisting: fail all pending and new I/Os requiring the
lock.

Signed-off-by: Ilya Dryomov &lt;idryomov@gmail.com&gt;
</content>
</entry>
</feed>
