<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/staging/android, branch v3.18.62</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v3.18.62</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v3.18.62'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2017-04-30T03:49:17+00:00</updated>
<entry>
<title>staging/android/ion : fix a race condition in the ion driver</title>
<updated>2017-04-30T03:49:17+00:00</updated>
<author>
<name>EunTaik Lee</name>
<email>eun.taik.lee@samsung.com</email>
</author>
<published>2016-02-24T04:38:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f63514257efd74108711e1d4e2ca462968170c42'/>
<id>urn:sha1:f63514257efd74108711e1d4e2ca462968170c42</id>
<content type='text'>
commit 9590232bb4f4cc824f3425a6e1349afbe6d6d2b7 upstream.

There is a use-after-free problem in the ion driver.
This is caused by a race condition in the ion_ioctl()
function.

A handle has ref count of 1 and two tasks on different
cpus calls ION_IOC_FREE simultaneously.

cpu 0                                   cpu 1
-------------------------------------------------------
ion_handle_get_by_id()
(ref == 2)
                            ion_handle_get_by_id()
                            (ref == 3)

ion_free()
(ref == 2)

ion_handle_put()
(ref == 1)

                            ion_free()
                            (ref == 0 so ion_handle_destroy() is
                            called
                            and the handle is freed.)

                            ion_handle_put() is called and it
                            decreases the slub's next free pointer

The problem is detected as an unaligned access in the
spin lock functions since it uses load exclusive
 instruction. In some cases it corrupts the slub's
free pointer which causes a mis-aligned access to the
next free pointer.(kmalloc returns a pointer like
ffffc0745b4580aa). And it causes lots of other
hard-to-debug problems.

This symptom is caused since the first member in the
ion_handle structure is the reference count and the
ion driver decrements the reference after it has been
freed.

To fix this problem client-&gt;lock mutex is extended
to protect all the codes that uses the handle.

Signed-off-by: Eun Taik Lee &lt;eun.taik.lee@samsung.com&gt;
Reviewed-by: Laura Abbott &lt;labbott@redhat.com&gt;
Cc: Ben Hutchings &lt;ben.hutchings@codethink.co.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

index 7ff2a7ec871f..33b390e7ea31
</content>
</entry>
<entry>
<title>staging: android: ashmem: lseek failed due to no FMODE_LSEEK.</title>
<updated>2017-04-18T05:55:48+00:00</updated>
<author>
<name>Shuxiao Zhang</name>
<email>zhangshuxiao@xiaomi.com</email>
</author>
<published>2017-04-06T14:30:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=50b791e146b94d57293349e5bd870a1d0ebdda14'/>
<id>urn:sha1:50b791e146b94d57293349e5bd870a1d0ebdda14</id>
<content type='text'>
commit 97fbfef6bd597888485b653175fb846c6998b60c upstream.

vfs_llseek will check whether the file mode has
FMODE_LSEEK, no return failure. But ashmem can be
lseek, so add FMODE_LSEEK to ashmem file.

Comment From Greg Hackmann:
	ashmem_llseek() passes the llseek() call through to the backing
	shmem file.  91360b02ab48 ("ashmem: use vfs_llseek()") changed
	this from directly calling the file's llseek() op into a VFS
	layer call.  This also adds a check for the FMODE_LSEEK bit, so
	without that bit ashmem_llseek() now always fails with -ESPIPE.

Fixes: 91360b02ab48 ("ashmem: use vfs_llseek()")
Signed-off-by: Shuxiao Zhang &lt;zhangshuxiao@xiaomi.com&gt;
Tested-by: Greg Hackmann &lt;ghackmann@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>2017-04-18T05:55:45+00:00</updated>
<author>
<name>Arve Hjønnevåg</name>
<email>arve@android.com</email>
</author>
<published>2016-10-24T13:20:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ddfe528c0ef64f086c1018cee6529fc4e577019c'/>
<id>urn:sha1:ddfe528c0ef64f086c1018cee6529fc4e577019c</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>2017-04-18T05:55:45+00:00</updated>
<author>
<name>Arve Hjønnevåg</name>
<email>arve@android.com</email>
</author>
<published>2016-10-24T13:20:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=663673422e18b5df59b8632f05956ffb11d41aa9'/>
<id>urn:sha1:663673422e18b5df59b8632f05956ffb11d41aa9</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>staging: ion: fix corruption of ion_import_dma_buf</title>
<updated>2015-10-28T02:13:30+00:00</updated>
<author>
<name>Shawn Lin</name>
<email>shawn.lin@rock-chips.com</email>
</author>
<published>2015-09-09T07:41:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=606c9512a3797bd5d4b7f9e0639aace1f6bc0112'/>
<id>urn:sha1:606c9512a3797bd5d4b7f9e0639aace1f6bc0112</id>
<content type='text'>
[ Upstream commit 6fa92e2bcf6390e64895b12761e851c452d87bd8 ]

we found this issue but still exit in lastest kernel. Simply
keep ion_handle_create under mutex_lock to avoid this race.

WARNING: CPU: 2 PID: 2648 at drivers/staging/android/ion/ion.c:512 ion_handle_add+0xb4/0xc0()
ion_handle_add: buffer already found.
Modules linked in: iwlmvm iwlwifi mac80211 cfg80211 compat
CPU: 2 PID: 2648 Comm: TimedEventQueue Tainted: G        W    3.14.0 #7
 00000000 00000000 9a3efd2c 80faf273 9a3efd6c 9a3efd5c 80935dc9 811d7fd3
 9a3efd88 00000a58 812208a0 00000200 80e128d4 80e128d4 8d4ae00c a8cd8600
 a8cd8094 9a3efd74 80935e0e 00000009 9a3efd6c 811d7fd3 9a3efd88 9a3efd9c
Call Trace:
  [&lt;80faf273&gt;] dump_stack+0x48/0x69
  [&lt;80935dc9&gt;] warn_slowpath_common+0x79/0x90
  [&lt;80e128d4&gt;] ? ion_handle_add+0xb4/0xc0
  [&lt;80e128d4&gt;] ? ion_handle_add+0xb4/0xc0
  [&lt;80935e0e&gt;] warn_slowpath_fmt+0x2e/0x30
  [&lt;80e128d4&gt;] ion_handle_add+0xb4/0xc0
  [&lt;80e144cc&gt;] ion_import_dma_buf+0x8c/0x110
  [&lt;80c517c4&gt;] reg_init+0x364/0x7d0
  [&lt;80993363&gt;] ? futex_wait+0x123/0x210
  [&lt;80992e0e&gt;] ? get_futex_key+0x16e/0x1e0
  [&lt;8099308f&gt;] ? futex_wake+0x5f/0x120
  [&lt;80c51e19&gt;] vpu_service_ioctl+0x1e9/0x500
  [&lt;80994aec&gt;] ? do_futex+0xec/0x8e0
  [&lt;80971080&gt;] ? prepare_to_wait_event+0xc0/0xc0
  [&lt;80c51c30&gt;] ? reg_init+0x7d0/0x7d0
  [&lt;80a22562&gt;] do_vfs_ioctl+0x2d2/0x4c0
  [&lt;80b198ad&gt;] ? inode_has_perm.isra.41+0x2d/0x40
  [&lt;80b199cf&gt;] ? file_has_perm+0x7f/0x90
  [&lt;80b1a5f7&gt;] ? selinux_file_ioctl+0x47/0xf0
  [&lt;80a227a8&gt;] SyS_ioctl+0x58/0x80
  [&lt;80fb45e8&gt;] syscall_call+0x7/0x7
  [&lt;80fb0000&gt;] ? mmc_do_calc_max_discard+0xab/0xe4

Fixes: 83271f626 ("ion: hold reference to handle...")
Signed-off-by: Shawn Lin &lt;shawn.lin@rock-chips.com&gt;
Reviewed-by: Laura Abbott &lt;labbott@redhat.com&gt;
Cc: stable &lt;stable@vger.kernel.org&gt; # 3.14+
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</content>
</entry>
<entry>
<title>staging: android: sync: Fix memory corruption in sync_timeline_signal().</title>
<updated>2015-05-17T23:11:52+00:00</updated>
<author>
<name>Alistair Strachan</name>
<email>alistair.strachan@imgtec.com</email>
</author>
<published>2015-03-24T21:51:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f364a04fb44955c96c08f99171ba1cf822dcdea1'/>
<id>urn:sha1:f364a04fb44955c96c08f99171ba1cf822dcdea1</id>
<content type='text'>
[ Upstream commit 8e43c9c75faf2902955bd2ecd7a50a8cc41cb00a ]

The android_fence_release() function checks for active sync points
by calling list_empty() on the list head embedded on the sync
point. However, it is only valid to use list_empty() on nodes that
have been initialized with INIT_LIST_HEAD() or list_del_init().

Because the list entry has likely been removed from the active list
by sync_timeline_signal(), there is a good chance that this
WARN_ON_ONCE() will be hit due to dangling pointers pointing at
freed memory (even though the sync drivers did nothing wrong)
and memory corruption will ensue as the list entry is removed for
a second time, corrupting the active list.

This problem can be reproduced quite easily with CONFIG_DEBUG_LIST=y
and fences with more than one sync point.

Signed-off-by: Alistair Strachan &lt;alistair.strachan@imgtec.com&gt;
Cc: Maarten Lankhorst &lt;maarten.lankhorst@canonical.com&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: Colin Cross &lt;ccross@google.com&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</content>
</entry>
<entry>
<title>staging: android: logger: Fix log corruption regression</title>
<updated>2014-10-28T22:24:30+00:00</updated>
<author>
<name>Daniel Thompson</name>
<email>daniel.thompson@linaro.org</email>
</author>
<published>2014-10-27T18:51:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5fecf3a1e1a0af61eb34eb6976ec9f59cca65d3f'/>
<id>urn:sha1:5fecf3a1e1a0af61eb34eb6976ec9f59cca65d3f</id>
<content type='text'>
Since commit cd678fce4280 ("switch logger to -&gt;write_iter()"), any
attempt to write to the log results in the log data being written over
its own metadata, thus rendering the log unreadable.

The problem was first detected when I ran an Android userspace on the
v3.18-rc1 kernel. However the issue can also be observed with a
non-Android userspace by using echo/cat to write to/from /dev/log_main .

This patch resolves the problem by using a temporary to track the status
of not-yet-committed writes to the log buffer.

Signed-off-by: Daniel Thompson &lt;daniel.thompson@linaro.org&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs</title>
<updated>2014-10-13T09:28:42+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2014-10-13T09:28:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=77c688ac87183537ed0fb84ec2cb8fa8ec97c458'/>
<id>urn:sha1:77c688ac87183537ed0fb84ec2cb8fa8ec97c458</id>
<content type='text'>
Pull vfs updates from Al Viro:
 "The big thing in this pile is Eric's unmount-on-rmdir series; we
  finally have everything we need for that.  The final piece of prereqs
  is delayed mntput() - now filesystem shutdown always happens on
  shallow stack.

  Other than that, we have several new primitives for iov_iter (Matt
  Wilcox, culled from his XIP-related series) pushing the conversion to
  -&gt;read_iter()/ -&gt;write_iter() a bit more, a bunch of fs/dcache.c
  cleanups and fixes (including the external name refcounting, which
  gives consistent behaviour of d_move() wrt procfs symlinks for long
  and short names alike) and assorted cleanups and fixes all over the
  place.

  This is just the first pile; there's a lot of stuff from various
  people that ought to go in this window.  Starting with
  unionmount/overlayfs mess...  ;-/"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (60 commits)
  fs/file_table.c: Update alloc_file() comment
  vfs: Deduplicate code shared by xattr system calls operating on paths
  reiserfs: remove pointless forward declaration of struct nameidata
  don't need that forward declaration of struct nameidata in dcache.h anymore
  take dname_external() into fs/dcache.c
  let path_init() failures treated the same way as subsequent link_path_walk()
  fix misuses of f_count() in ppp and netlink
  ncpfs: use list_for_each_entry() for d_subdirs walk
  vfs: move getname() from callers to do_mount()
  gfs2_atomic_open(): skip lookups on hashed dentry
  [infiniband] remove pointless assignments
  gadgetfs: saner API for gadgetfs_create_file()
  f_fs: saner API for ffs_sb_create_file()
  jfs: don't hash direct inode
  [s390] remove pointless assignment of -&gt;f_op in vmlogrdr -&gt;open()
  ecryptfs: -&gt;f_op is never NULL
  android: -&gt;f_op is never NULL
  nouveau: __iomem misannotations
  missing annotation in fs/file.c
  fs: namespace: suppress 'may be used uninitialized' warnings
  ...
</content>
</entry>
<entry>
<title>android: -&gt;f_op is never NULL</title>
<updated>2014-10-09T06:39:12+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2014-09-02T21:29:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=765d368217715c794f767d396d8cea16502d823f'/>
<id>urn:sha1:765d368217715c794f767d396d8cea16502d823f</id>
<content type='text'>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>switch logger to -&gt;write_iter()</title>
<updated>2014-10-09T06:39:09+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2014-08-23T16:20:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=cd678fce428018dee0c9345ed63ebf9920d9902f'/>
<id>urn:sha1:cd678fce428018dee0c9345ed63ebf9920d9902f</id>
<content type='text'>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
</feed>
