<feed xmlns='http://www.w3.org/2005/Atom'>
<title>xavi/android_kernel_m2note/drivers/usb/gadget/inode.c, branch ng-7.1.2</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<id>https://gitea.privatedns.org/xavi/android_kernel_m2note/atom?h=ng-7.1.2</id>
<link rel='self' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/atom?h=ng-7.1.2'/>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/'/>
<updated>2018-11-29T16:49:05+00:00</updated>
<entry>
<title>Replace &lt;asm/uaccess.h&gt; with &lt;linux/uaccess.h&gt; globally</title>
<updated>2018-11-29T16:49:05+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2016-12-24T19:46:01+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=8588b01909e0145e5e84f5fe0a5353bd194f205c'/>
<id>urn:sha1:8588b01909e0145e5e84f5fe0a5353bd194f205c</id>
<content type='text'>
This was entirely automated, using the script by Al:

  PATT='^[[:blank:]]*#[[:blank:]]*include[[:blank:]]*&lt;asm/uaccess.h&gt;'
  sed -i -e "s!$PATT!#include &lt;linux/uaccess.h&gt;!" \
        $(git grep -l "$PATT"|grep -v ^include/linux/uaccess.h)

to do the replacement at the end of the merge window.

Requested-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Moyster &lt;oysterized@gmail.com&gt;
</content>
</entry>
<entry>
<title>usb: replace %p with %pK</title>
<updated>2018-11-27T15:09:55+00:00</updated>
<author>
<name>Manu Gautam</name>
<email>mgautam@codeaurora.org</email>
</author>
<published>2017-02-24T09:52:40+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=513cef2c53c2b3846f6c571823412f514b6f66c7'/>
<id>urn:sha1:513cef2c53c2b3846f6c571823412f514b6f66c7</id>
<content type='text'>
Format specifier %p can leak kernel addresses while not valuing the
kptr_restrict system settings. When kptr_restrict is set to (1), kernel
pointers printed using the %pK format specifier will be replaced with 0's.
Debugging Note : &amp;pK prints only Zeros as address. If you need actual
address information, write 0 to kptr_restrict.
echo 0 &gt; /proc/sys/kernel/kptr_restrict

CRs-fixed: 1052849
Change-Id: I0e98145730380ea983fa8f46a28d15dd6c2c31df
Signed-off-by: Manu Gautam &lt;mgautam@codeaurora.org&gt;
Signed-off-by: Yasir Malik &lt;ymalik@codeaurora.org&gt;
Signed-off-by: Kevin F. Haggerty &lt;haggertk@lineageos.org&gt;
</content>
</entry>
<entry>
<title>USB: gadgetfs: fix checks of wTotalLength in config descriptors</title>
<updated>2017-07-04T09:51:09+00:00</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2016-12-09T20:24:24+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=95c09d2354e75ae47c1de539699469879e978e85'/>
<id>urn:sha1:95c09d2354e75ae47c1de539699469879e978e85</id>
<content type='text'>
commit 1c069b057dcf64fada952eaa868d35f02bb0cfc2 upstream.

Andrey Konovalov's fuzz testing of gadgetfs showed that we should
improve the driver's checks for valid configuration descriptors passed
in by the user.  In particular, the driver needs to verify that the
wTotalLength value in the descriptor is not too short (smaller
than USB_DT_CONFIG_SIZE).  And the check for whether wTotalLength is
too large has to be changed, because the driver assumes there is
always enough room remaining in the buffer to hold a device descriptor
(at least USB_DT_DEVICE_SIZE bytes).

This patch adds the additional check and fixes the existing check.  It
may do a little more than strictly necessary, but one extra check
won't hurt.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
CC: Andrey Konovalov &lt;andreyknvl@google.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
</content>
</entry>
<entry>
<title>USB: gadgetfs: fix use-after-free bug</title>
<updated>2017-07-04T09:51:09+00:00</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2016-12-09T20:18:43+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=00de3ab89241e15db520524c0506c087ed26a8ae'/>
<id>urn:sha1:00de3ab89241e15db520524c0506c087ed26a8ae</id>
<content type='text'>
commit add333a81a16abbd4f106266a2553677a165725f upstream.

Andrey Konovalov reports that fuzz testing with syzkaller causes a
KASAN use-after-free bug report in gadgetfs:

BUG: KASAN: use-after-free in gadgetfs_setup+0x208a/0x20e0 at addr ffff88003dfe5bf2
Read of size 2 by task syz-executor0/22994
CPU: 3 PID: 22994 Comm: syz-executor0 Not tainted 4.9.0-rc7+ #16
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
 ffff88006df06a18 ffffffff81f96aba ffffffffe0528500 1ffff1000dbe0cd6
 ffffed000dbe0cce ffff88006df068f0 0000000041b58ab3 ffffffff8598b4c8
 ffffffff81f96828 1ffff1000dbe0ccd ffff88006df06708 ffff88006df06748
Call Trace:
 &lt;IRQ&gt; [  201.343209]  [&lt;     inline     &gt;] __dump_stack lib/dump_stack.c:15
 &lt;IRQ&gt; [  201.343209]  [&lt;ffffffff81f96aba&gt;] dump_stack+0x292/0x398 lib/dump_stack.c:51
 [&lt;ffffffff817e4dec&gt;] kasan_object_err+0x1c/0x70 mm/kasan/report.c:159
 [&lt;     inline     &gt;] print_address_description mm/kasan/report.c:197
 [&lt;ffffffff817e5080&gt;] kasan_report_error+0x1f0/0x4e0 mm/kasan/report.c:286
 [&lt;     inline     &gt;] kasan_report mm/kasan/report.c:306
 [&lt;ffffffff817e562a&gt;] __asan_report_load_n_noabort+0x3a/0x40 mm/kasan/report.c:337
 [&lt;     inline     &gt;] config_buf drivers/usb/gadget/legacy/inode.c:1298
 [&lt;ffffffff8322c8fa&gt;] gadgetfs_setup+0x208a/0x20e0 drivers/usb/gadget/legacy/inode.c:1368
 [&lt;ffffffff830fdcd0&gt;] dummy_timer+0x11f0/0x36d0 drivers/usb/gadget/udc/dummy_hcd.c:1858
 [&lt;ffffffff814807c1&gt;] call_timer_fn+0x241/0x800 kernel/time/timer.c:1308
 [&lt;     inline     &gt;] expire_timers kernel/time/timer.c:1348
 [&lt;ffffffff81482de6&gt;] __run_timers+0xa06/0xec0 kernel/time/timer.c:1641
 [&lt;ffffffff814832c1&gt;] run_timer_softirq+0x21/0x80 kernel/time/timer.c:1654
 [&lt;ffffffff84f4af8b&gt;] __do_softirq+0x2fb/0xb63 kernel/softirq.c:284

The cause of the bug is subtle.  The dev_config() routine gets called
twice by the fuzzer.  The first time, the user data contains both a
full-speed configuration descriptor and a high-speed config
descriptor, causing dev-&gt;hs_config to be set.  But it also contains an
invalid device descriptor, so the buffer containing the descriptors is
deallocated and dev_config() returns an error.

The second time dev_config() is called, the user data contains only a
full-speed config descriptor.  But dev-&gt;hs_config still has the stale
pointer remaining from the first call, causing the routine to think
that there is a valid high-speed config.  Later on, when the driver
dereferences the stale pointer to copy that descriptor, we get a
use-after-free access.

The fix is simple: Clear dev-&gt;hs_config if the passed-in data does not
contain a high-speed config descriptor.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Reported-by: Andrey Konovalov &lt;andreyknvl@google.com&gt;
Tested-by: Andrey Konovalov &lt;andreyknvl@google.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
</content>
</entry>
<entry>
<title>USB: gadgetfs: fix unbounded memory allocation bug</title>
<updated>2017-07-04T09:51:09+00:00</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2016-12-09T20:17:46+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=14ac3297f0dbbe12d63200195935ea04e29e4a8d'/>
<id>urn:sha1:14ac3297f0dbbe12d63200195935ea04e29e4a8d</id>
<content type='text'>
commit faab50984fe6636e616c7cc3d30308ba391d36fd upstream.

Andrey Konovalov reports that fuzz testing with syzkaller causes a
KASAN warning in gadgetfs:

BUG: KASAN: slab-out-of-bounds in dev_config+0x86f/0x1190 at addr ffff88003c47e160
Write of size 65537 by task syz-executor0/6356
CPU: 3 PID: 6356 Comm: syz-executor0 Not tainted 4.9.0-rc7+ #19
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
 ffff88003c107ad8 ffffffff81f96aba ffffffff3dc11ef0 1ffff10007820eee
 ffffed0007820ee6 ffff88003dc11f00 0000000041b58ab3 ffffffff8598b4c8
 ffffffff81f96828 ffffffff813fb4a0 ffff88003b6eadc0 ffff88003c107738
Call Trace:
 [&lt;     inline     &gt;] __dump_stack lib/dump_stack.c:15
 [&lt;ffffffff81f96aba&gt;] dump_stack+0x292/0x398 lib/dump_stack.c:51
 [&lt;ffffffff817e4dec&gt;] kasan_object_err+0x1c/0x70 mm/kasan/report.c:159
 [&lt;     inline     &gt;] print_address_description mm/kasan/report.c:197
 [&lt;ffffffff817e5080&gt;] kasan_report_error+0x1f0/0x4e0 mm/kasan/report.c:286
 [&lt;ffffffff817e5705&gt;] kasan_report+0x35/0x40 mm/kasan/report.c:306
 [&lt;     inline     &gt;] check_memory_region_inline mm/kasan/kasan.c:308
 [&lt;ffffffff817e3fb9&gt;] check_memory_region+0x139/0x190 mm/kasan/kasan.c:315
 [&lt;ffffffff817e4044&gt;] kasan_check_write+0x14/0x20 mm/kasan/kasan.c:326
 [&lt;     inline     &gt;] copy_from_user arch/x86/include/asm/uaccess.h:689
 [&lt;     inline     &gt;] ep0_write drivers/usb/gadget/legacy/inode.c:1135
 [&lt;ffffffff83228caf&gt;] dev_config+0x86f/0x1190 drivers/usb/gadget/legacy/inode.c:1759
 [&lt;ffffffff817fdd55&gt;] __vfs_write+0x5d5/0x760 fs/read_write.c:510
 [&lt;ffffffff817ff650&gt;] vfs_write+0x170/0x4e0 fs/read_write.c:560
 [&lt;     inline     &gt;] SYSC_write fs/read_write.c:607
 [&lt;ffffffff81803a5b&gt;] SyS_write+0xfb/0x230 fs/read_write.c:599
 [&lt;ffffffff84f47ec1&gt;] entry_SYSCALL_64_fastpath+0x1f/0xc2

Indeed, there is a comment saying that the value of len is restricted
to a 16-bit integer, but the code doesn't actually do this.

This patch fixes the warning.  It replaces the comment with a
computation that forces the amount of data copied from the user in
ep0_write() to be no larger than the wLength size for the control
transfer, which is a 16-bit quantity.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Reported-by: Andrey Konovalov &lt;andreyknvl@google.com&gt;
Tested-by: Andrey Konovalov &lt;andreyknvl@google.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
</content>
</entry>
<entry>
<title>usb: gadgetfs: restrict upper bound on device configuration size</title>
<updated>2017-07-04T09:51:08+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2016-12-06T07:36:29+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=42dc2639ba895d1307bf63e02e52e684e1e5f64b'/>
<id>urn:sha1:42dc2639ba895d1307bf63e02e52e684e1e5f64b</id>
<content type='text'>
commit 0994b0a257557e18ee8f0b7c5f0f73fe2b54eec1 upstream.

Andrey Konovalov reported that we were not properly checking the upper
limit before of a device configuration size before calling
memdup_user(), which could cause some problems.

So set the upper limit to PAGE_SIZE * 4, which should be good enough for
all devices.

Reported-by: Andrey Konovalov &lt;andreyknvl@google.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
</content>
</entry>
<entry>
<title>first commit</title>
<updated>2016-08-15T02:19:42+00:00</updated>
<author>
<name>Meizu OpenSource</name>
<email>patchwork@meizu.com</email>
</author>
<published>2016-08-15T02:19:42+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=d2e1446d81725c351dc73a03b397ce043fb18452'/>
<id>urn:sha1:d2e1446d81725c351dc73a03b397ce043fb18452</id>
<content type='text'>
</content>
</entry>
</feed>
