<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers, branch v3.16.58</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.16.58</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.16.58'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2018-09-25T22:47:32Z</updated>
<entry>
<title>video: uvesafb: Fix integer overflow in allocation</title>
<updated>2018-09-25T22:47:32Z</updated>
<author>
<name>Kees Cook</name>
<email>keescook@chromium.org</email>
</author>
<published>2018-05-11T08:24:12Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ab6d43c1c7c298cacaae180b2232fe8abc18075f'/>
<id>urn:sha1:ab6d43c1c7c298cacaae180b2232fe8abc18075f</id>
<content type='text'>
commit 9f645bcc566a1e9f921bdae7528a01ced5bc3713 upstream.

cmap-&gt;len can get close to INT_MAX/2, allowing for an integer overflow in
allocation. This uses kmalloc_array() instead to catch the condition.

Reported-by: Dr Silvio Cesare of InfoSect &lt;silvio.cesare@gmail.com&gt;
Fixes: 8bdb3a2d7df48 ("uvesafb: the driver core")
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>uas: replace WARN_ON_ONCE() with lockdep_assert_held()</title>
<updated>2018-09-25T22:47:32Z</updated>
<author>
<name>Sanjeev Sharma</name>
<email>sanjeev_sharma@mentor.com</email>
</author>
<published>2014-08-12T06:40:21Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ef16be8519f20e688cae41db04c4ad60b4fc9b22'/>
<id>urn:sha1:ef16be8519f20e688cae41db04c4ad60b4fc9b22</id>
<content type='text'>
commit ab945eff8396bc3329cc97274320e8d2c6585077 upstream.

on some architecture spin_is_locked() always return false in
uniprocessor configuration and therefore it would be advise
to replace with lockdep_assert_held().

Signed-off-by: Sanjeev Sharma &lt;Sanjeev_Sharma@mentor.com&gt;
Acked-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>cdrom: Fix info leak/OOB read in cdrom_ioctl_drive_status</title>
<updated>2018-09-25T22:47:31Z</updated>
<author>
<name>Scott Bauer</name>
<email>scott.bauer@intel.com</email>
</author>
<published>2018-04-26T17:51:08Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=585e054220cd820aeac2436c29ff9c06e483dc83'/>
<id>urn:sha1:585e054220cd820aeac2436c29ff9c06e483dc83</id>
<content type='text'>
commit 8f3fafc9c2f0ece10832c25f7ffcb07c97a32ad4 upstream.

Like d88b6d04: "cdrom: information leak in cdrom_ioctl_media_changed()"

There is another cast from unsigned long to int which causes
a bounds check to fail with specially crafted input. The value is
then used as an index in the slot array in cdrom_slot_status().

Signed-off-by: Scott Bauer &lt;scott.bauer@intel.com&gt;
Signed-off-by: Scott Bauer &lt;sbauer@plzdonthack.me&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>USB: yurex: fix out-of-bounds uaccess in read handler</title>
<updated>2018-09-25T22:47:30Z</updated>
<author>
<name>Jann Horn</name>
<email>jannh@google.com</email>
</author>
<published>2018-07-06T15:12:56Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=189254a6aa0cc823b55e624ba77ad3bd0637bbd9'/>
<id>urn:sha1:189254a6aa0cc823b55e624ba77ad3bd0637bbd9</id>
<content type='text'>
commit f1e255d60ae66a9f672ff9a207ee6cd8e33d2679 upstream.

In general, accessing userspace memory beyond the length of the supplied
buffer in VFS read/write handlers can lead to both kernel memory corruption
(via kernel_read()/kernel_write(), which can e.g. be triggered via
sys_splice()) and privilege escalation inside userspace.

Fix it by using simple_read_from_buffer() instead of custom logic.

Fixes: 6bc235a2e24a ("USB: add driver for Meywa-Denki &amp; Kayac YUREX")
Signed-off-by: Jann Horn &lt;jannh@google.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>infiniband: fix a possible use-after-free bug</title>
<updated>2018-09-25T22:47:30Z</updated>
<author>
<name>Cong Wang</name>
<email>xiyou.wangcong@gmail.com</email>
</author>
<published>2018-06-01T18:31:44Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c62b25af5f51f49e9f93f828cc38a82c23e8a0c5'/>
<id>urn:sha1:c62b25af5f51f49e9f93f828cc38a82c23e8a0c5</id>
<content type='text'>
commit cb2595c1393b4a5211534e6f0a0fbad369e21ad8 upstream.

ucma_process_join() will free the new allocated "mc" struct,
if there is any error after that, especially the copy_to_user().

But in parallel, ucma_leave_multicast() could find this "mc"
through idr_find() before ucma_process_join() frees it, since it
is already published.

So "mc" could be used in ucma_leave_multicast() after it is been
allocated and freed in ucma_process_join(), since we don't refcnt
it.

Fix this by separating "publish" from ID allocation, so that we
can get an ID first and publish it later after copy_to_user().

Fixes: c8f6a362bf3e ("RDMA/cma: Add multicast communication support")
Reported-by: Noam Rathaus &lt;noamr@beyondsecurity.com&gt;
Signed-off-by: Cong Wang &lt;xiyou.wangcong@gmail.com&gt;
Signed-off-by: Jason Gunthorpe &lt;jgg@mellanox.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>scsi: libsas: defer ata device eh commands to libata</title>
<updated>2018-09-25T22:47:26Z</updated>
<author>
<name>Jason Yan</name>
<email>yanaijie@huawei.com</email>
</author>
<published>2018-03-08T02:34:53Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=0643adfa36b54ea5948e48383d8549ac5c2fb69e'/>
<id>urn:sha1:0643adfa36b54ea5948e48383d8549ac5c2fb69e</id>
<content type='text'>
commit 318aaf34f1179b39fa9c30fa0f3288b645beee39 upstream.

When ata device doing EH, some commands still attached with tasks are
not passed to libata when abort failed or recover failed, so libata did
not handle these commands. After these commands done, sas task is freed,
but ata qc is not freed. This will cause ata qc leak and trigger a
warning like below:

WARNING: CPU: 0 PID: 28512 at drivers/ata/libata-eh.c:4037
ata_eh_finish+0xb4/0xcc
CPU: 0 PID: 28512 Comm: kworker/u32:2 Tainted: G     W  OE 4.14.0#1
......
Call trace:
[&lt;ffff0000088b7bd0&gt;] ata_eh_finish+0xb4/0xcc
[&lt;ffff0000088b8420&gt;] ata_do_eh+0xc4/0xd8
[&lt;ffff0000088b8478&gt;] ata_std_error_handler+0x44/0x8c
[&lt;ffff0000088b8068&gt;] ata_scsi_port_error_handler+0x480/0x694
[&lt;ffff000008875fc4&gt;] async_sas_ata_eh+0x4c/0x80
[&lt;ffff0000080f6be8&gt;] async_run_entry_fn+0x4c/0x170
[&lt;ffff0000080ebd70&gt;] process_one_work+0x144/0x390
[&lt;ffff0000080ec100&gt;] worker_thread+0x144/0x418
[&lt;ffff0000080f2c98&gt;] kthread+0x10c/0x138
[&lt;ffff0000080855dc&gt;] ret_from_fork+0x10/0x18

If ata qc leaked too many, ata tag allocation will fail and io blocked
for ever.

As suggested by Dan Williams, defer ata device commands to libata and
merge sas_eh_finish_cmd() with sas_eh_defer_cmd(). libata will handle
ata qcs correctly after this.

Signed-off-by: Jason Yan &lt;yanaijie@huawei.com&gt;
CC: Xiaofei Tan &lt;tanxiaofei@huawei.com&gt;
CC: John Garry &lt;john.garry@huawei.com&gt;
CC: Dan Williams &lt;dan.j.williams@intel.com&gt;
Reviewed-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>scsi: sg: allocate with __GFP_ZERO in sg_build_indirect()</title>
<updated>2018-09-25T22:47:25Z</updated>
<author>
<name>Alexander Potapenko</name>
<email>glider@google.com</email>
</author>
<published>2018-05-18T14:23:18Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=582802e7c617cfb07cc15f280c128e6decbc57b8'/>
<id>urn:sha1:582802e7c617cfb07cc15f280c128e6decbc57b8</id>
<content type='text'>
commit a45b599ad808c3c982fdcdc12b0b8611c2f92824 upstream.

This shall help avoid copying uninitialized memory to the userspace when
calling ioctl(fd, SG_IO) with an empty command.

Reported-by: syzbot+7d26fc1eea198488deab@syzkaller.appspotmail.com
Signed-off-by: Alexander Potapenko &lt;glider@google.com&gt;
Acked-by: Douglas Gilbert &lt;dgilbert@interlog.com&gt;
Reviewed-by: Johannes Thumshirn &lt;jthumshirn@suse.de&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>sr: pass down correctly sized SCSI sense buffer</title>
<updated>2018-09-25T22:47:25Z</updated>
<author>
<name>Jens Axboe</name>
<email>axboe@kernel.dk</email>
</author>
<published>2018-05-21T18:21:14Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d98da66531a3b203dded83749d69dd07ca9e646a'/>
<id>urn:sha1:d98da66531a3b203dded83749d69dd07ca9e646a</id>
<content type='text'>
commit f7068114d45ec55996b9040e98111afa56e010fe upstream.

We're casting the CDROM layer request_sense to the SCSI sense
buffer, but the former is 64 bytes and the latter is 96 bytes.
As we generally allocate these on the stack, we end up blowing
up the stack.

Fix this by wrapping the scsi_execute() call with a properly
sized sense buffer, and copying back the bits for the CDROM
layer.

Reported-by: Piotr Gabriel Kosinski &lt;pg.kosinski@gmail.com&gt;
Reported-by: Daniel Shapira &lt;daniel@twistlock.com&gt;
Tested-by: Kees Cook &lt;keescook@chromium.org&gt;
Fixes: 82ed4db499b8 ("block: split scsi_request out of struct request")
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
[bwh: Despite what the "Fixes" field says, a buffer overrun was already
 possible if the sense data was really &gt; 64 bytes long.
 Backported to 3.16:
 - We always need to allocate a sense buffer in order to call
   scsi_normalize_sense()
 - Remove the existing conditional heap-allocation of the sense buffer]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>usbip: usbip_host: fix bad unlock balance during stub_probe()</title>
<updated>2018-09-25T22:47:23Z</updated>
<author>
<name>Shuah Khan (Samsung OSG)</name>
<email>shuah@kernel.org</email>
</author>
<published>2018-05-15T23:57:23Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=6a837c8c2937fba8f5c94821ca603913d72bc049'/>
<id>urn:sha1:6a837c8c2937fba8f5c94821ca603913d72bc049</id>
<content type='text'>
commit c171654caa875919be3c533d3518da8be5be966e upstream.

stub_probe() calls put_busid_priv() in an error path when device isn't
found in the busid_table. Fix it by making put_busid_priv() safe to be
called with null struct bus_id_priv pointer.

This problem happens when "usbip bind" is run without loading usbip_host
driver and then running modprobe. The first failed bind attempt unbinds
the device from the original driver and when usbip_host is modprobed,
stub_probe() runs and doesn't find the device in its busid table and calls
put_busid_priv(0 with null bus_id_priv pointer.

usbip-host 3-10.2: 3-10.2 is not in match_busid table...  skip!

[  367.359679] =====================================
[  367.359681] WARNING: bad unlock balance detected!
[  367.359683] 4.17.0-rc4+ #5 Not tainted
[  367.359685] -------------------------------------
[  367.359688] modprobe/2768 is trying to release lock (
[  367.359689]
==================================================================
[  367.359696] BUG: KASAN: null-ptr-deref in print_unlock_imbalance_bug+0x99/0x110
[  367.359699] Read of size 8 at addr 0000000000000058 by task modprobe/2768

[  367.359705] CPU: 4 PID: 2768 Comm: modprobe Not tainted 4.17.0-rc4+ #5

Fixes: 22076557b07c ("usbip: usbip_host: fix NULL-ptr deref and use-after-free errors") in usb-linus
Signed-off-by: Shuah Khan (Samsung OSG) &lt;shuah@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
[bwh: Backported to 3.16: adjust filename]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>usbip: usbip_host: fix NULL-ptr deref and use-after-free errors</title>
<updated>2018-09-25T22:47:23Z</updated>
<author>
<name>Shuah Khan (Samsung OSG)</name>
<email>shuah@kernel.org</email>
</author>
<published>2018-05-15T02:49:58Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=896b00bd9c66cc72ae6800ff6dba65a9e83ea5fd'/>
<id>urn:sha1:896b00bd9c66cc72ae6800ff6dba65a9e83ea5fd</id>
<content type='text'>
commit 22076557b07c12086eeb16b8ce2b0b735f7a27e7 upstream.

usbip_host updates device status without holding lock from stub probe,
disconnect and rebind code paths. When multiple requests to import a
device are received, these unprotected code paths step all over each
other and drive fails with NULL-ptr deref and use-after-free errors.

The driver uses a table lock to protect the busid array for adding and
deleting busids to the table. However, the probe, disconnect and rebind
paths get the busid table entry and update the status without holding
the busid table lock. Add a new finer grain lock to protect the busid
entry. This new lock will be held to search and update the busid entry
fields from get_busid_idx(), add_match_busid() and del_match_busid().

match_busid_show() does the same to access the busid entry fields.

get_busid_priv() changed to return the pointer to the busid entry holding
the busid lock. stub_probe(), stub_disconnect() and stub_device_rebind()
call put_busid_priv() to release the busid lock before returning. This
changes fixes the unprotected code paths eliminating the race conditions
in updating the busid entries.

Reported-by: Jakub Jirasek
Signed-off-by: Shuah Khan (Samsung OSG) &lt;shuah@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
[bwh: Backported to 3.16: adjust filenames, context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
</feed>
