<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers/android, branch v4.4.148</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.4.148</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.4.148'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2018-02-28T09:17:23Z</updated>
<entry>
<title>binder: add missing binder_unlock()</title>
<updated>2018-02-28T09:17:23Z</updated>
<author>
<name>Eric Biggers</name>
<email>ebiggers@google.com</email>
</author>
<published>2018-02-26T18:56:45Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=bf5a6a7256834ad88104d3a99cc935c9ac49b527'/>
<id>urn:sha1:bf5a6a7256834ad88104d3a99cc935c9ac49b527</id>
<content type='text'>
When commit 4be5a2810489 ("binder: check for binder_thread allocation
failure in binder_poll()") was applied to 4.4-stable and 4.9-stable it
was forgotten to release the global binder lock in the new error path.
The global binder lock wasn't removed until v4.14, by commit
a60b890f607d ("binder: remove global binder lock").

Fix the new error path to release the lock.

Reported-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Eric Biggers &lt;ebiggers@google.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>binder: check for binder_thread allocation failure in binder_poll()</title>
<updated>2018-02-25T10:03:38Z</updated>
<author>
<name>Eric Biggers</name>
<email>ebiggers@google.com</email>
</author>
<published>2018-01-31T07:11:24Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=83c76f2c50f197d1d827ec057f064bcaf13d22d1'/>
<id>urn:sha1:83c76f2c50f197d1d827ec057f064bcaf13d22d1</id>
<content type='text'>
commit f88982679f54f75daa5b8eff3da72508f1e7422f upstream.

If the kzalloc() in binder_get_thread() fails, binder_poll()
dereferences the resulting NULL pointer.

Fix it by returning POLLERR if the memory allocation failed.

This bug was found by syzkaller using fault injection.

Reported-by: syzbot &lt;syzkaller@googlegroups.com&gt;
Fixes: 457b9a6f09f0 ("Staging: android: add binder driver")
Cc: stable@vger.kernel.org
Signed-off-by: Eric Biggers &lt;ebiggers@google.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>ANDROID: binder: fix proc-&gt;tsk check.</title>
<updated>2017-08-30T08:19:26Z</updated>
<author>
<name>Martijn Coenen</name>
<email>maco@android.com</email>
</author>
<published>2017-07-28T11:56:08Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=9dac44d5d4b0a7fffe04ad505e0a082e900ad767'/>
<id>urn:sha1:9dac44d5d4b0a7fffe04ad505e0a082e900ad767</id>
<content type='text'>
commit b2a6d1b999a4c13e5997bb864694e77172d45250 upstream.

Commit c4ea41ba195d ("binder: use group leader instead of open thread")'
was incomplete and didn't update a check in binder_mmap(), causing all
mmap() calls into the binder driver to fail.

Signed-off-by: Martijn Coenen &lt;maco@android.com&gt;
Tested-by: John Stultz &lt;john.stultz@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>binder: Use wake up hint for synchronous transactions.</title>
<updated>2017-08-30T08:19:26Z</updated>
<author>
<name>Riley Andrews</name>
<email>riandrews@google.com</email>
</author>
<published>2017-06-29T19:01:37Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=1792d6c17cb282fd8e5cd197a8b33cb78484eb6a'/>
<id>urn:sha1:1792d6c17cb282fd8e5cd197a8b33cb78484eb6a</id>
<content type='text'>
commit 00b40d613352c623aaae88a44e5ded7c912909d7 upstream.

Use wake_up_interruptible_sync() to hint to the scheduler binder
transactions are synchronous wakeups. Disable preemption while waking
to avoid ping-ponging on the binder lock.

Signed-off-by: Todd Kjos &lt;tkjos@google.com&gt;
Signed-off-by: Omprakash Dhyade &lt;odhyade@codeaurora.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>binder: use group leader instead of open thread</title>
<updated>2017-08-30T08:19:26Z</updated>
<author>
<name>Todd Kjos</name>
<email>tkjos@android.com</email>
</author>
<published>2017-06-29T19:01:36Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=596b97ec2e5e24c966b9cb4aa9a9766e53ecdd43'/>
<id>urn:sha1:596b97ec2e5e24c966b9cb4aa9a9766e53ecdd43</id>
<content type='text'>
commit c4ea41ba195d01c9af66fb28711a16cc97caa9c5 upstream.

The binder allocator assumes that the thread that
called binder_open will never die for the lifetime of
that proc. That thread is normally the group_leader,
however it may not be. Use the group_leader instead
of current.

Signed-off-by: Todd Kjos &lt;tkjos@google.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>ANDROID: binder: Clear binder and cookie when setting handle in flat binder struct</title>
<updated>2016-11-10T15:36:33Z</updated>
<author>
<name>Arve Hjønnevåg</name>
<email>arve@android.com</email>
</author>
<published>2016-10-24T13:20:30Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=8910c33882536ba00efc0768748e0846b40addcc'/>
<id>urn:sha1:8910c33882536ba00efc0768748e0846b40addcc</id>
<content type='text'>
commit 4afb604e2d14d429ac9e1fd84b952602853b2df5 upstream.

Prevents leaking pointers between processes

Signed-off-by: Arve Hjønnevåg &lt;arve@android.com&gt;
Signed-off-by: Martijn Coenen &lt;maco@android.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>ANDROID: binder: Add strong ref checks</title>
<updated>2016-11-10T15:36:33Z</updated>
<author>
<name>Arve Hjønnevåg</name>
<email>arve@android.com</email>
</author>
<published>2016-10-24T13:20:29Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=14f09e8e7cd8c9b94a29c8373b3ff983a3ad3722'/>
<id>urn:sha1:14f09e8e7cd8c9b94a29c8373b3ff983a3ad3722</id>
<content type='text'>
commit 0a3ffab93fe52530602fe47cd74802cffdb19c05 upstream.

Prevent using a binder_ref with only weak references where a strong
reference is required.

Signed-off-by: Arve Hjønnevåg &lt;arve@android.com&gt;
Signed-off-by: Martijn Coenen &lt;maco@android.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>drivers: android: correct the size of struct binder_uintptr_t for BC_DEAD_BINDER_DONE</title>
<updated>2016-03-03T23:07:10Z</updated>
<author>
<name>Lisa Du</name>
<email>cldu@marvell.com</email>
</author>
<published>2016-02-17T01:32:52Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=3e908446627523e106c1edc7cf6fe7706924d6d3'/>
<id>urn:sha1:3e908446627523e106c1edc7cf6fe7706924d6d3</id>
<content type='text'>
commit 7a64cd887fdb97f074c3fda03bee0bfb9faceac3 upstream.

There's one point was missed in the patch commit da49889deb34 ("staging:
binder: Support concurrent 32 bit and 64 bit processes."). When configure
BINDER_IPC_32BIT, the size of binder_uintptr_t was 32bits, but size of
void * is 64bit on 64bit system. Correct it here.

Signed-off-by: Lisa Du &lt;cldu@marvell.com&gt;
Signed-off-by: Nicolas Boichat &lt;drinkcat@chromium.org&gt;
Fixes: da49889deb34 ("staging: binder: Support concurrent 32 bit and 64 bit processes.")
Acked-by: Olof Johansson &lt;olof@lixom.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>mm: mark most vm_operations_struct const</title>
<updated>2015-09-10T20:29:01Z</updated>
<author>
<name>Kirill A. Shutemov</name>
<email>kirill.shutemov@linux.intel.com</email>
</author>
<published>2015-09-09T22:39:26Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=7cbea8dc0127a95226c7722a738ac6534950ef67'/>
<id>urn:sha1:7cbea8dc0127a95226c7722a738ac6534950ef67</id>
<content type='text'>
With two exceptions (drm/qxl and drm/radeon) all vm_operations_struct
structs should be constant.

Signed-off-by: Kirill A. Shutemov &lt;kirill.shutemov@linux.intel.com&gt;
Reviewed-by: Oleg Nesterov &lt;oleg@redhat.com&gt;
Cc: "H. Peter Anvin" &lt;hpa@zytor.com&gt;
Cc: Andy Lutomirski &lt;luto@amacapital.net&gt;
Cc: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Minchan Kim &lt;minchan@kernel.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.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>android: binder: fix binder mmap failures</title>
<updated>2015-03-02T02:43:51Z</updated>
<author>
<name>Andrey Ryabinin</name>
<email>a.ryabinin@samsung.com</email>
</author>
<published>2015-02-27T17:44:21Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=f4c72c70308897bd26f2918979d06b429916fd0e'/>
<id>urn:sha1:f4c72c70308897bd26f2918979d06b429916fd0e</id>
<content type='text'>
binder_update_page_range() initializes only addr and size
fields in 'struct vm_struct tmp_area;' and passes it to
map_vm_area().

Before 71394fe50146 ("mm: vmalloc: add flag preventing guard hole allocation")
this was because map_vm_area() didn't use any other fields
in vm_struct except addr and size.

Now get_vm_area_size() (used in map_vm_area()) reads vm_struct's
flags to determine whether vm area has guard hole or not.

binder_update_page_range() don't initialize flags field, so
this causes following binder mmap failures:
-----------[ cut here ]------------
WARNING: CPU: 0 PID: 1971 at mm/vmalloc.c:130
vmap_page_range_noflush+0x119/0x144()
CPU: 0 PID: 1971 Comm: healthd Not tainted 4.0.0-rc1-00399-g7da3fdc-dirty #157
Hardware name: ARM-Versatile Express
[&lt;c001246d&gt;] (unwind_backtrace) from [&lt;c000f7f9&gt;] (show_stack+0x11/0x14)
[&lt;c000f7f9&gt;] (show_stack) from [&lt;c049a221&gt;] (dump_stack+0x59/0x7c)
[&lt;c049a221&gt;] (dump_stack) from [&lt;c001cf21&gt;] (warn_slowpath_common+0x55/0x84)
[&lt;c001cf21&gt;] (warn_slowpath_common) from [&lt;c001cfe3&gt;]
(warn_slowpath_null+0x17/0x1c)
[&lt;c001cfe3&gt;] (warn_slowpath_null) from [&lt;c00c66c5&gt;]
(vmap_page_range_noflush+0x119/0x144)
[&lt;c00c66c5&gt;] (vmap_page_range_noflush) from [&lt;c00c716b&gt;] (map_vm_area+0x27/0x48)
[&lt;c00c716b&gt;] (map_vm_area) from [&lt;c038ddaf&gt;]
(binder_update_page_range+0x12f/0x27c)
[&lt;c038ddaf&gt;] (binder_update_page_range) from [&lt;c038e857&gt;]
(binder_mmap+0xbf/0x1ac)
[&lt;c038e857&gt;] (binder_mmap) from [&lt;c00c2dc7&gt;] (mmap_region+0x2eb/0x4d4)
[&lt;c00c2dc7&gt;] (mmap_region) from [&lt;c00c3197&gt;] (do_mmap_pgoff+0x1e7/0x250)
[&lt;c00c3197&gt;] (do_mmap_pgoff) from [&lt;c00b35b5&gt;] (vm_mmap_pgoff+0x45/0x60)
[&lt;c00b35b5&gt;] (vm_mmap_pgoff) from [&lt;c00c1f39&gt;] (SyS_mmap_pgoff+0x5d/0x80)
[&lt;c00c1f39&gt;] (SyS_mmap_pgoff) from [&lt;c000ce81&gt;] (ret_fast_syscall+0x1/0x5c)
---[ end trace 48c2c4b9a1349e54 ]---
binder: 1982: binder_alloc_buf failed to map page at f0e00000 in kernel
binder: binder_mmap: 1982 b6bde000-b6cdc000 alloc small buf failed -12

Use map_kernel_range_noflush() instead of map_vm_area() as this is better
API for binder's purposes and it allows to get rid of 'vm_struct tmp_area' at all.

Fixes: 71394fe50146 ("mm: vmalloc: add flag preventing guard hole allocation")
Signed-off-by: Andrey Ryabinin &lt;a.ryabinin@samsung.com&gt;
Reported-by: Amit Pundir &lt;amit.pundir@linaro.org&gt;
Tested-by: Amit Pundir &lt;amit.pundir@linaro.org&gt;
Acked-by: David Rientjes &lt;rientjes@google.com&gt;
Tested-by: John Stultz &lt;john.stultz@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
