<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/android/binder.c, branch v4.15</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.15</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.15'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2017-12-18T14:47:12Z</updated>
<entry>
<title>binder: fix proc-&gt;files use-after-free</title>
<updated>2017-12-18T14:47:12Z</updated>
<author>
<name>Todd Kjos</name>
<email>tkjos@android.com</email>
</author>
<published>2017-11-27T17:32:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7f3dc0088b98533f17128058fac73cd8b2752ef1'/>
<id>urn:sha1:7f3dc0088b98533f17128058fac73cd8b2752ef1</id>
<content type='text'>
proc-&gt;files cleanup is initiated by binder_vma_close. Therefore
a reference on the binder_proc is not enough to prevent the
files_struct from being released while the binder_proc still has
a reference. This can lead to an attempt to dereference the
stale pointer obtained from proc-&gt;files prior to proc-&gt;files
cleanup. This has been seen once in task_get_unused_fd_flags()
when __alloc_fd() is called with a stale "files".

The fix is to protect proc-&gt;files with a mutex to prevent cleanup
while in use.

Signed-off-by: Todd Kjos &lt;tkjos@google.com&gt;
Cc: stable &lt;stable@vger.kernel.org&gt; # 4.14
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>ANDROID: binder: fix transaction leak.</title>
<updated>2017-11-28T15:54:45Z</updated>
<author>
<name>Martijn Coenen</name>
<email>maco@android.com</email>
</author>
<published>2017-11-13T09:06:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=fb2c445277e7b0b4ffe10de8114bad4eccaca948'/>
<id>urn:sha1:fb2c445277e7b0b4ffe10de8114bad4eccaca948</id>
<content type='text'>
If a call to put_user() fails, we failed to
properly free a transaction and send a failed
reply (if necessary).

Signed-off-by: Martijn Coenen &lt;maco@android.com&gt;
Cc: stable &lt;stable@vger.kernel.org&gt; # 4.14
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'char-misc-4.15-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc</title>
<updated>2017-11-16T17:10:59Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2017-11-16T17:10:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2bf16b7a73caf3435f782e4170cfe563675e10f9'/>
<id>urn:sha1:2bf16b7a73caf3435f782e4170cfe563675e10f9</id>
<content type='text'>
Pull char/misc updates from Greg KH:
 "Here is the big set of char/misc and other driver subsystem patches
  for 4.15-rc1.

  There are small changes all over here, hyperv driver updates, pcmcia
  driver updates, w1 driver updats, vme driver updates, nvmem driver
  updates, and lots of other little one-off driver updates as well. The
  shortlog has the full details.

  All of these have been in linux-next for quite a while with no
  reported issues"

* tag 'char-misc-4.15-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (90 commits)
  VME: Return -EBUSY when DMA list in use
  w1: keep balance of mutex locks and refcnts
  MAINTAINERS: Update VME subsystem tree.
  nvmem: sunxi-sid: add support for A64/H5's SID controller
  nvmem: imx-ocotp: Update module description
  nvmem: imx-ocotp: Enable i.MX7D OTP write support
  nvmem: imx-ocotp: Add i.MX7D timing write clock setup support
  nvmem: imx-ocotp: Move i.MX6 write clock setup to dedicated function
  nvmem: imx-ocotp: Add support for banked OTP addressing
  nvmem: imx-ocotp: Pass parameters via a struct
  nvmem: imx-ocotp: Restrict OTP write to IMX6 processors
  nvmem: uniphier: add UniPhier eFuse driver
  dt-bindings: nvmem: add description for UniPhier eFuse
  nvmem: set nvmem-&gt;owner to nvmem-&gt;dev-&gt;driver-&gt;owner if unset
  nvmem: qfprom: fix different address space warnings of sparse
  nvmem: mtk-efuse: fix different address space warnings of sparse
  nvmem: mtk-efuse: use stack for nvmem_config instead of malloc'ing it
  nvmem: imx-iim: use stack for nvmem_config instead of malloc'ing it
  thunderbolt: tb: fix use after free in tb_activate_pcie_devices
  MAINTAINERS: Add git tree for Thunderbolt development
  ...
</content>
</entry>
<entry>
<title>Merge tag 'modules-for-v4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux</title>
<updated>2017-11-15T21:46:33Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2017-11-15T21:46:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1be2172e96e33bfa22a5c7a651f768ef30ce3984'/>
<id>urn:sha1:1be2172e96e33bfa22a5c7a651f768ef30ce3984</id>
<content type='text'>
Pull module updates from Jessica Yu:
 "Summary of modules changes for the 4.15 merge window:

   - treewide module_param_call() cleanup, fix up set/get function
     prototype mismatches, from Kees Cook

   - minor code cleanups"

* tag 'modules-for-v4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux:
  module: Do not paper over type mismatches in module_param_call()
  treewide: Fix function prototypes for module_param_call()
  module: Prepare to convert all module_param_call() prototypes
  kernel/module: Delete an error message for a failed memory allocation in add_module_usage()
</content>
</entry>
<entry>
<title>treewide: Fix function prototypes for module_param_call()</title>
<updated>2017-10-31T14:30:37Z</updated>
<author>
<name>Kees Cook</name>
<email>keescook@chromium.org</email>
</author>
<published>2017-10-18T02:04:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e4dca7b7aa08b22893c45485d222b5807c1375ae'/>
<id>urn:sha1:e4dca7b7aa08b22893c45485d222b5807c1375ae</id>
<content type='text'>
Several function prototypes for the set/get functions defined by
module_param_call() have a slightly wrong argument types. This fixes
those in an effort to clean up the calls when running under type-enforced
compiler instrumentation for CFI. This is the result of running the
following semantic patch:

@match_module_param_call_function@
declarer name module_param_call;
identifier _name, _set_func, _get_func;
expression _arg, _mode;
@@

 module_param_call(_name, _set_func, _get_func, _arg, _mode);

@fix_set_prototype
 depends on match_module_param_call_function@
identifier match_module_param_call_function._set_func;
identifier _val, _param;
type _val_type, _param_type;
@@

 int _set_func(
-_val_type _val
+const char * _val
 ,
-_param_type _param
+const struct kernel_param * _param
 ) { ... }

@fix_get_prototype
 depends on match_module_param_call_function@
identifier match_module_param_call_function._get_func;
identifier _val, _param;
type _val_type, _param_type;
@@

 int _get_func(
-_val_type _val
+char * _val
 ,
-_param_type _param
+const struct kernel_param * _param
 ) { ... }

Two additional by-hand changes are included for places where the above
Coccinelle script didn't notice them:

	drivers/platform/x86/thinkpad_acpi.c
	fs/lockd/svc.c

Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Signed-off-by: Jessica Yu &lt;jeyu@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge 4.14-rc6 into char-misc-next</title>
<updated>2017-10-23T15:21:44Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2017-10-23T15:21:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6fbf248a20d362a92de60beee9474faca0b54eee'/>
<id>urn:sha1:6fbf248a20d362a92de60beee9474faca0b54eee</id>
<content type='text'>
We want the driver fixes in here and this resolves a merge issue with
the binder driver.

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>binder: pr_err() strings should end with newlines</title>
<updated>2017-10-20T13:18:27Z</updated>
<author>
<name>Arvind Yadav</name>
<email>arvind.yadav.cs@gmail.com</email>
</author>
<published>2017-09-25T07:22:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f7f84fded6c461d58ca73c85f0cb23a036717110'/>
<id>urn:sha1:f7f84fded6c461d58ca73c85f0cb23a036717110</id>
<content type='text'>
pr_err() messages should terminated with a new-line to avoid
other messages being concatenated onto the end.

Signed-off-by: Arvind Yadav &lt;arvind.yadav.cs@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>binder: call poll_wait() unconditionally.</title>
<updated>2017-10-20T10:53:43Z</updated>
<author>
<name>Martijn Coenen</name>
<email>maco@android.com</email>
</author>
<published>2017-10-09T12:26:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=66b83a4cdd3b73effdc285d1d66763c69ffe2ee8'/>
<id>urn:sha1:66b83a4cdd3b73effdc285d1d66763c69ffe2ee8</id>
<content type='text'>
Because we're not guaranteed that subsequent calls
to poll() will have a poll_table_struct parameter
with _qproc set. When _qproc is not set, poll_wait()
is a noop, and we won't be woken up correctly.

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>binder: fix use-after-free in binder_transaction()</title>
<updated>2017-10-04T09:25:10Z</updated>
<author>
<name>Todd Kjos</name>
<email>tkjos@android.com</email>
</author>
<published>2017-09-29T22:39:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=512cf465ee01eb23936a9e6ed0b6414eccb00853'/>
<id>urn:sha1:512cf465ee01eb23936a9e6ed0b6414eccb00853</id>
<content type='text'>
User-space normally keeps the node alive when creating a transaction
since it has a reference to the target. The local strong ref keeps it
alive if the sending process dies before the target process processes
the transaction. If the source process is malicious or has a reference
counting bug, this can fail.

In this case, when we attempt to decrement the node in the failure
path, the node has already been freed.

This is fixed by taking a tmpref on the node while constructing
the transaction. To avoid re-acquiring the node lock and inner
proc lock to increment the proc's tmpref, a helper is used that
does the ref increments on both the node and proc.

Signed-off-by: Todd Kjos &lt;tkjos@google.com&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>binder: fix memory corruption in binder_transaction binder</title>
<updated>2017-09-18T14:06:00Z</updated>
<author>
<name>Xu YiPing</name>
<email>xuyiping@hisilicon.com</email>
</author>
<published>2017-09-05T17:21:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d53bebdf4d779497b29e1aad26e19cac1d446f42'/>
<id>urn:sha1:d53bebdf4d779497b29e1aad26e19cac1d446f42</id>
<content type='text'>
commit 7a4408c6bd3e ("binder: make sure accesses to proc/thread are
safe") made a change to enqueue tcomplete to thread-&gt;todo before
enqueuing the transaction. However, in err_dead_proc_or_thread case,
the tcomplete is directly freed, without dequeued. It may cause the
thread-&gt;todo list to be corrupted.

So, dequeue it before freeing.

Fixes: 7a4408c6bd3e ("binder: make sure accesses to proc/thread are safe")
Signed-off-by: Xu YiPing &lt;xuyiping@hisilicon.com&gt;
Signed-off-by: Todd Kjos &lt;tkjos@google.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
