Commit Graph

18342 Commits

Author SHA1 Message Date
Christoph Hellwig 3af7f5faa3 staging: android: ion: use vmap instead of vm_map_ram
[ Upstream commit 5bf9917452112694b2c774465ee4dbe441c84b77 ]

vm_map_ram can keep mappings around after the vm_unmap_ram.  Using that
with non-PAGE_KERNEL mappings can lead to all kinds of aliasing issues.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Christophe Leroy <christophe.leroy@c-s.fr>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: David Airlie <airlied@linux.ie>
Cc: Gao Xiang <xiang@kernel.org>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>
Cc: Laura Abbott <labbott@redhat.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Michael Kelley <mikelley@microsoft.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Nitin Gupta <ngupta@vflare.org>
Cc: Robin Murphy <robin.murphy@arm.com>
Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: Stephen Hemminger <sthemmin@microsoft.com>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Wei Liu <wei.liu@kernel.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Paul Mackerras <paulus@ozlabs.org>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Will Deacon <will@kernel.org>
Link: http://lkml.kernel.org/r/20200414131348.444715-4-hch@lst.de
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Change-Id: I10e16b456cad271b6e12b6bec9425392aa71b6c0
2020-07-14 01:00:50 +02:00
Suren Baghdasaryan a90d46376b staging: android: ashmem: Disallow ashmem memory from being remapped
When ashmem file is being mmapped the resulting vma->vm_file points to the
backing shmem file with the generic fops that do not check ashmem
permissions like fops of ashmem do. Fix that by disallowing mapping
operation for backing shmem file.

Bug: 142938932
Bug: 142903466
Reported-by: Jann Horn <jannh@google.com>
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I718dfca02c83845f8a41d88506871b0aa21326d7
CVE-2020-0009
Signed-off-by: Kevin F. Haggerty <haggertk@lineageos.org>
2020-01-10 03:25:25 +01:00
syphyr d132d6387f ANDROID: Remove conflicting Samsung options for upstream changes
In order to bring lowmemorykiller in sync with Google sources,
the following Samsung specific changes have been removed:

SEC_TIMEOUT_LOW_MEMORY_KILLER
SEC_DEBUG_LMK_MEMINFO
SEC_DEBUG_LMK_COUNT_INFO

These options are not used upstream and conflict.
2019-07-27 22:09:50 +02:00
Tim Murray 9697139d52 lowmemorykiller: account for unevictable pages
lowmemorykiller was not taking into account unevictable pages when
deciding what level to kill. If significant amounts of memory were
pinned, this caused lowmemorykiller to effectively stop at a much higher
level than it should.

bug 31255977

Change-Id: I763ecbfef8c56d65bb8f6147ae810692bd81b6e2
2019-07-27 22:09:50 +02:00
Vinayak Menon 862f4f71e0 staging: android: lowmemorykiller: neglect swap cached pages in other_file
With ZRAM enabled it is observed that lowmemory killer
doesn't trigger properly. swap cached pages are
accounted in NR_FILE, and lowmemorykiller considers
this as reclaimable and adds to other_file. But these
pages can't be reclaimed unless lowmemorykiller triggers.
So subtract swap pages from other_file.

Signed-off-by: Vinayak Menon <vinayakm.list@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 058dbde928597e7a8bd04e28e77e5cfc4270591d)

Change-Id: I217e831bbe1db830e6d61c7943e442a32a7548a1
2019-07-27 22:09:49 +02:00
Thierry Strudel 8a04cc5c75 Revert "android/lowmemorykiller: Check all tasks for death pending"
This reverts commit 7ec0cf6d3f.
2019-07-27 22:09:49 +02:00
Thierry Strudel 919a123cc9 Revert "android/lowmemorykiller: Wait for memory to be freed"
This reverts commit 25f87e504b.

Change-Id: If8709a45b36fb73bee4e9c3e4e99937a8a952651
2019-07-27 22:09:48 +02:00
Thierry Strudel 6f6c955aa5 Revert "android/lowmemorykiller: Ignore tasks with freed mm"
This reverts commit 05d5ad4d0a.

Change-Id: Ib5770b5b38f123116322507646ae9bce6c3c186a
2019-07-27 22:09:48 +02:00
Thierry Strudel 44ba2354e3 Revert "android: lowmemorykiller: add lmk parameters tunning code."
This reverts commit f92471abb9.
2019-07-27 22:09:48 +02:00
Thierry Strudel 6b1475d492 Revert "android/lowmemorykiller: Selectively count free CMA pages"
This reverts commit 06e8520b10.
2019-07-27 22:09:47 +02:00
Thierry Strudel 0675816e5b Revert "lowmemorykiller: Account for highmem during kswapd reclaim"
This reverts commit e137b1a41f.
2019-07-27 22:09:47 +02:00
Thierry Strudel 70bbc4c513 Revert "lowmemorykiller: enhance debug information"
This reverts commit ba79232663.

Change-Id: I6a1b524ccdcd7c963cd0c380061b1b05c9a3fe3e
2019-07-27 22:09:46 +02:00
Thierry Strudel 6b8d46ce77 Revert "lowmemorykiller: Dump out slab state information"
This reverts commit ed1aff26c1.
2019-07-27 22:09:46 +02:00
Thierry Strudel 5cfdb9221d Revert "lowmemorykiller: Run the lowmemory notifier when killing"
This reverts commit f49905e2be.
2019-07-27 22:09:45 +02:00
Thierry Strudel da8ab3ac0e Revert "lowmemorykiller: use for_each_thread instead of buggy while_each_thread"
This reverts commit 4e352bff294dc89bbd9fc74646d9fe01cbfd6e02.
2019-07-27 22:09:45 +02:00
Thierry Strudel 200ed15225 Revert "lowmemorykiller: Don't count swap cache pages twice"
This reverts commit 52acbe414c1643066b299c1e9cdae7f4f188d419.
2019-07-27 22:09:45 +02:00
Thierry Strudel 9174c4f83f Revert "lowmemorykiller: Do proper NULL checks"
This reverts commit a7d54d72883cf7cb31c059e31125695babbf2b8d.
2019-07-27 22:09:44 +02:00
syphyr dece380b97 Revert "lowmemorykiller: adapt to vmpressure"
This reverts commit a7668cd5e2.
2019-07-27 22:09:44 +02:00
syphyr 46a47a6d0a Revert "lowmemorykiller: avoid false adaptive LMK triggers"
This reverts commit deafbd6437.
2019-07-27 22:09:43 +02:00
syphyr 688ad4c9cd Revert "lowmemorykiller: Introduce sysfs node for ALMK and PPR adj threshold"
This reverts commit b0c67828b5.
2019-07-27 22:09:43 +02:00
Thierry Strudel bfd76409e1 Revert "android/lowmemorykiller: Account for total_swapcache_pages"
This reverts commit 3a610c281c.
2019-07-27 22:09:43 +02:00
Thierry Strudel d7b96a1cf4 Revert "lowmemorykiller: Don't count reserve page twice"
This reverts commit 1fb8384f99.
2019-07-27 22:09:42 +02:00
syphyr 6ee8027b59 lowmemorykiller: Remove Samsung specific code 2019-07-27 22:09:42 +02:00
syphyr b67119054a lowmemorykiller: Match case of config settings 2019-07-27 22:09:40 +02:00
Greg Hackmann 83256f490a staging: goldfish: audio: fix compiliation on arm
[ Upstream commit 4532150762ceb0d6fd765ebcb3ba6966fbb8faab ]

We do actually need slab.h, by luck we get it on other platforms but not
always on ARM. Include it properly.

Signed-off-by: Greg Hackmann <ghackmann@google.com>
Signed-off-by: Jin Qian <jinqian@android.com>
Signed-off-by: Alan <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-07-27 22:08:57 +02:00
Rajmal Menariya 99182a96d2 staging: ion: Set minimum carveout heap allocation order to PAGE_SHIFT
[ Upstream commit 1328d8efef17d5e16bd6e9cfe59130a833674534 ]

In carveout heap, change minimum allocation order from 12 to
PAGE_SHIFT. After this change each bit in bitmap (genalloc -
General purpose special memory pool) represents one page size
memory.

Cc: sprd-ind-kernel-group@googlegroups.com
Cc: sanjeev.yadav@spreadtrum.com
Cc: Colin Cross <ccross@android.com>
Cc: Android Kernel Team <kernel-team@android.com>
Cc: Greg KH <gregkh@linuxfoundation.org>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Signed-off-by: Rajmal Menariya <rajmal.menariya@spreadtrum.com>
[jstultz: Reworked commit message]
Signed-off-by: John Stultz <john.stultz@linaro.org>
Acked-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-07-27 22:08:56 +02:00
Seunghun Lee 45797fc3ac staging: android: fix a possible memory leak
Memory allocated by kstrdup should be freed.

Change-Id: I0feeb8199b3a53bbad72f04c2b9b11345b2ef6bc
CC: Brian Swetland <swetland@google.com>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Seunghun Lee <waydi1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-27 22:08:31 +02:00
Vinayak Menon ec91320159 ion: invalidate the pool pointers after free
ion_system_heap_destroy_pools frees the pool, but
does not invalidate the pointer. This can result in
a double free if ion_system_heap_create_pools fails,
and then causes ion_system_heap_create to call into
ion_system_heap_destroy_pools again from the error
path. This can happen in ion_system_heap_create when
one of the secure pool creation fails.

Bug: 70638103
Change-Id: Ic73ca78722aa5a575cc4dd7c1caa560b518094f2
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
Signed-off-by: Siqi Lin <siqilin@google.com>
2019-07-27 21:53:28 +02:00
Alistair Strachan 47df57c9b0 staging: android: ashmem: Fix mmap size validation
[ Upstream commit 8632c614565d0c5fdde527889601c018e97b6384 ]

The ashmem driver did not check that the size/offset of the vma passed
to its .mmap() function was not larger than the ashmem object being
mapped. This could cause mmap() to succeed, even though accessing parts
of the mapping would later fail with a segmentation fault.

Ensure an error is returned by the ashmem_mmap() function if the vma
size is larger than the ashmem object size. This enables safer handling
of the problem in userspace.

Cc: Todd Kjos <tkjos@android.com>
Cc: devel@driverdev.osuosl.org
Cc: linux-kernel@vger.kernel.org
Cc: kernel-team@android.com
Cc: Joel Fernandes <joel@joelfernandes.org>
Signed-off-by: Alistair Strachan <astrachan@google.com>
Acked-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Reviewed-by: Martijn Coenen <maco@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-27 21:51:53 +02:00
Weijie Yang cffd694b3f UPSTREAM: staging: android: lowmemorykiller: set TIF_MEMDIE before send kill sig
(cherry picked from commit 6bc2b856bb7c49f238914d965c0b1057ec78226e)

Set TIF_MEMDIE tsk_thread flag before send kill signal to the
selected thread. This is to fit a usual code sequence and avoid
potential race issue.

Signed-off-by: Weijie Yang <weijie.yang@samsung.com>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Git-commit: 76fc4536faaac9644151fb8a38731c8cf4ab85c4
Git-repo: https://android.googlesource.com/kernel/common.git
Signed-off-by: Srinivasarao P <spathi@codeaurora.org>
2019-07-27 21:50:43 +02:00
Rohit kumar 20f2c52350 UPSTREAM: staging: ion: Fix error handling in ion_buffer_create
This patch fixes error handling case when buffer->pages allocation
fails. Also, it removes unreachable code of checking ret variable
although it is not updated.

Signed-off-by: Rohit kumar <rohit.kr@samsung.com>
Reviewed-by: Laura Abbott <labbott@redhat.com>
Suggested-by: Pintu Kumar <pintu.k@samsung.com>
Reviewed-by: Pintu Kumar <pintu.k@samsung.com>
Reviewed-by: Gioh Kim <gioh.kim@lge.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit a56d092aa94ebcc9452ddaa47423b9a478aa6aa5)
Change-Id: Ic38b8e3ef0a21de4e38e58b4bb942535fe671ae5
Bug: 34283718
Git-commit: ad592ac248aeb91448c398dcea5eaeef66790b53
Git-repo: https://android.googlesource.com/kernel/common.git
Signed-off-by: Srinivasarao P <spathi@codeaurora.org>
2019-07-27 21:50:42 +02:00
Neil Zhang 3ee02277ca BACKPORT: ion:synchronize debugfs callback and ion_client_destroy
(cherry picked from commit 948c4db4ee10d85fe78ed3755dcaeb85cd37a148)

There are race condition B/T ion_client_destroy and debugfs callbacks.
Let's use a mutex to synchronize them.

Change-Id: I4d73b258ac1fb67604b62f237da0e004275fd3da
Signed-off-by: Neil Zhang <neilzhang1123@hotmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Git-commit: e5e4ee1de3cdc0a1bed86806afb03643bf547e94
Git-repo: https://android.googlesource.com/kernel/common.git
[resolved trivial merge conflicts]
Signed-off-by: Srinivasarao P <spathi@codeaurora.org>
2019-07-27 21:50:41 +02:00
Joel Fernandes be105de753 staging: android: ashmem: Fix lockdep issue during llseek
commit cb57469c9573f6018cd1302953dd45d6e05aba7b upstream.

ashmem_mutex create a chain of dependencies like so:

(1)
mmap syscall ->
  mmap_sem ->  (acquired)
  ashmem_mmap
  ashmem_mutex (try to acquire)
  (block)

(2)
llseek syscall ->
  ashmem_llseek ->
  ashmem_mutex ->  (acquired)
  inode_lock ->
  inode->i_rwsem (try to acquire)
  (block)

(3)
getdents ->
  iterate_dir ->
  inode_lock ->
  inode->i_rwsem   (acquired)
  copy_to_user ->
  mmap_sem         (try to acquire)

There is a lock ordering created between mmap_sem and inode->i_rwsem
causing a lockdep splat [2] during a syzcaller test, this patch fixes
the issue by unlocking the mutex earlier. Functionally that's Ok since
we don't need to protect vfs_llseek.

[1] https://patchwork.kernel.org/patch/10185031/
[2] https://lkml.org/lkml/2018/1/10/48

Acked-by: Todd Kjos <tkjos@google.com>
Cc: Arve Hjonnevag <arve@android.com>
Reported-by: syzbot+8ec30bb7bf1a981a2012@syzkaller.appspotmail.com
Signed-off-by: Joel Fernandes <joelaf@google.com>
Acked-by: Greg Hackmann <ghackmann@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[bwh: Backported to 3.16: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2019-07-27 21:49:47 +02:00
Yisheng Xie 8eb85e1248 staging: android: ashmem: Fix possible deadlock in ashmem_ioctl
commit 740a5759bf222332fbb5eda42f89aa25ba38f9b2 upstream.

ashmem_mutex may create a chain of dependencies like:

CPU0                                    CPU1
 mmap syscall                           ioctl syscall
 -> mmap_sem (acquired)                 -> ashmem_ioctl
 -> ashmem_mmap                            -> ashmem_mutex (acquired)
    -> ashmem_mutex (try to acquire)       -> copy_from_user
                                              -> mmap_sem (try to acquire)

There is a lock odering problem between mmap_sem and ashmem_mutex causing
a lockdep splat[1] during a syzcaller test. This patch fixes the problem
by move copy_from_user out of ashmem_mutex.

[1] https://www.spinics.net/lists/kernel/msg2733200.html

Fixes: ce8a3a9e76d0 (staging: android: ashmem: Fix a race condition in pin ioctls)
Reported-by: syzbot+d7a918a7a8e1c952bc36@syzkaller.appspotmail.com
Signed-off-by: Yisheng Xie <xieyisheng1@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2019-07-27 21:49:47 +02:00
Ben Hutchings 8a288901ad staging: android: ashmem: Fix a race condition in pin ioctls
commit ce8a3a9e76d0193e2e8d74a06d275b3c324ca652 upstream.

ashmem_pin_unpin() reads asma->file and asma->size before taking the
ashmem_mutex, so it can race with other operations that modify them.

Build-tested only.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-27 21:49:47 +02:00
LuK1337 65f8423215 Import T813XXS2BRC2 kernel source changes
Change-Id: I90bb6c013287c1edbf8ca607d1666cc4c62d504e
2018-05-26 00:39:42 +02:00
Viktor Slavkovic f665814801 staging: android: ashmem: fix a race condition in ASHMEM_SET_SIZE ioctl
A lock-unlock is missing in ASHMEM_SET_SIZE ioctl which can result in a
race condition when mmap is called. After the !asma->file check, before
setting asma->size, asma->file can be set in mmap. That would result in
having different asma->size than the mapped memory size. Combined with
ASHMEM_UNPIN ioctl and shrinker invocation, this can result in memory
corruption.

Bug: 66954097
Signed-off-by: Viktor Slavkovic <viktors@google.com>
Change-Id: Ia52312a75ade30bc94be6b94420f17f34e0c1f86
CVE-2017-13216
Signed-off-by: Kevin F. Haggerty <haggertk@lineageos.org>
(cherry picked from commit b150b0606691a89adfd4729238a1c92b8011a207)
2018-05-26 00:39:36 +02:00
LuK1337 39a771baad Merge tag 'LA.BR.1.3.6-05410-8976.0' of https://source.codeaurora.org/quic/la/kernel/msm-3.10 into HEAD
"LA.BR.1.3.6-05410-8976.0"
2018-02-06 13:11:45 +01:00
Liam Mark 4593c1e97d ion: ensure CMO target is valid
Cleanup ION cache maintenance code to properly validate the target of
userspace cache maintenance requests.

Change-Id: I55b8e3584c59634f95250bc7c0bce5d8d70e6a13
Signed-off-by: Liam Mark <lmark@codeaurora.org>
Signed-off-by: Swetha Chikkaboraiah <schikk@codeaurora.org>
2018-01-23 21:36:52 -08:00
LuK1337 97104ad488 Merge tag 'LA.BR.1.3.6-04710-8976.0' of https://source.codeaurora.org/quic/la/kernel/msm-3.10 into HEAD
"LA.BR.1.3.6-04710-8976.0"
2017-09-15 11:27:24 +02:00
Patrick Daly 40a4bab422 ion: Improve support for heap walking
Clients may wish to implement custom functions on a particular
heap ID. That function assumes that the heap ID has a specific heap
type. Make that requirement explicit by only calling the custom
function if both the ID and type match.

CRs-Fixed: 2078339
Change-Id: Ie746362a19a22dceb6e47148d67901d483778a85
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
Signed-off-by: Sudarshan Rajagopalan <sudaraja@codeaurora.org>
2017-08-06 23:50:10 -07:00
LuK1337 f77b254b9f Merge tag 'LA.BR.1.3.6-04510-8976.0' of https://source.codeaurora.org/quic/la/kernel/msm-3.10 into HEAD
"LA.BR.1.3.6-04510-8976.0"
2017-08-06 13:38:06 +02:00
Sudarshan Rajagopalan f6dd76db81 ion: fix logical-not comparison warning
Fixes compiler warning when a logical-not on a variable
is applied while comparing it with value zero.

Change-Id: I92aa16bd0d57a0d59ecd26eef1ac92220332998d
Signed-off-by: Sudarshan Rajagopalan <sudaraja@codeaurora.org>
2017-07-05 02:49:59 -07:00
LuK1337 18aceede84 Merge tag 'LA.BR.1.3.6-03910-8976.0' of https://source.codeaurora.org/quic/la/kernel/msm-3.10 into HEAD
"LA.BR.1.3.6-03910-8976.0"

Change-Id: I16643fc055aa2965fe5903396a8e5158c42cf1bc
2017-05-26 13:28:48 +02:00
Linux Build Service Account a6896b48ca Merge "ion: Fix unprotected userspace access" 2017-05-02 05:38:16 -07:00
Se Wang (Patrick) Oh e86b6eb955 ion: Fix unprotected userspace access
After enabling KASan, unprotected userspace access causes
a PTE translation fault as it can covers only kernel memory
region. Following is the crash error for the reference.

Unable to handle kernel paging request at virtual address dfffff901ff64b84
pgd = ffffffc083266000
[dfffff901ff64b84] *pgd=0000000000000000, *pud=0000000000000000
Internal error: Oops: 96000004 [#1] PREEMPT SMP
Modules linked in:
CPU: 1 PID: 8527 Comm: iveaudiolatency Tainted: G        W      3.18.0-g5a4a5d5-07255-g8e80921-dirty #21
Hardware name: Qualcomm Technologies, Inc. MSM 8996 v2 + PMI8994 MTP (DT)
task: ffffffc02bfeb600 ti: ffffffc083378000 task.ti: ffffffc083378000
PC is at compat_msm_ion_ioctl+0x23c/0x614
LR is at compat_msm_ion_ioctl+0x1d8/0x614
pc : [<ffffffc0012bd570>] lr : [<ffffffc0012bd50c>] pstate: 80000145
sp : ffffffc08337faf0
x29: ffffffc08337faf0 x28: 0000000000000000
x27: ffffffc083378000 x26: 00000000ffb25c20
x25: 00000000e2fa6000 x24: 0000000000000000
x23: 00000000ffb25c18 x22: 0000000000000000
x21: ffffffc08fcaa640 x20: 00000000c0144d00
x19: 00000000ffb25c74 x18: 0000000000000000
x17: 0000000000000000 x16: ffffffc000385a88
x15: 0000000000000000 x14: 00000000f73517c9
x13: 00000000ffb25c30 x12: 0000000000000001
x11: 00000000ffffffff x10: ffffff881066ff3a
x9 : 1ffffff81066ff3a x8 : dfffff9000000000
x7 : 0000000000000036 x6 : ffffffc08337f9d4
x5 : 0000000000000003 x4 : 00000000ffb25c30
x3 : ffffffc0012bd334 x2 : 0000000000000001
x1 : 000000001ff64b84 x0 : dfffff9000000000

Process iveaudiolatency (pid: 8527, stack limit = 0xffffffc083378058)
Call trace:
[<ffffffc0012bd570>] compat_msm_ion_ioctl+0x23c/0x614
[<ffffffc0012aea84>] ion_ioctl+0x4dc/0x680
[<ffffffc0012bb254>] compat_ion_ioctl+0xb98/0xbc0
[<ffffffc000385d10>] compat_SyS_ioctl+0x288/0x2048
Code: 910022fa d2dff200 d343ff41 f2fbffe0 (38e06820)
---[ end trace 490ef1c3bde7b96c ]---
coresight-tmc 3028000.tmc: TMC aborted

Change-Id: I7595bbf5f311182d40f7158654df56dc8bcf672a
Signed-off-by: Se Wang (Patrick) Oh <sewango@codeaurora.org>
2017-05-01 22:15:54 -07:00
Daniel Rosenberg 29e4492044 ANDROID: ion: Fix uninitialized variable
Fix an uninitialized variable in user_ion_handle_put_nolock

Change-Id: Ia634b790661089ad01aca8e5975984435463d148
Signed-off-by: Daniel Rosenberg <drosen@google.com>
Bug: 34276203
[d-cagle@codeaurora.org: Add commit message]
Signed-off-by: Dennis Cagle <d-cagle@codeaurora.org>
2017-05-01 21:33:28 -07:00
Daniel Rosenberg d96aa409f8 ANDROID: ion: Protect kref from userspace manipulation
This separates the kref for ion handles into two components.
Userspace requests through the ioctl will hold at most one
reference to the internally used kref. All additional requests
will increment a separate counter, and the original reference is
only put once that counter hits 0. This protects the kernel from
a poorly behaving userspace.

Bug: 34276203

Change-Id: Ibc36bc4405788ed0fea7337b541cad3be2b934c0
Signed-off-by: Daniel Rosenberg <drosen@google.com>
Git-repo: https://android.googlesource.com/kernel/msm/
Git-commit: 20abfcc16884a5af973a5e91dd013ddd789c44f4
[d-cagle@codeaurora.org: Resolve style issues]
Signed-off-by: Dennis Cagle <d-cagle@codeaurora.org>
2017-04-28 21:34:08 -07:00
Sudarshan Rajagopalan 2a2f0b7463 ashmem: remove cache maintenance support
The cache maintenance routines in ashmem were causing
several security issues. Since they are not being used
anymore by any drivers, its well to remove them entirely.

CRs-Fixed: 1107034, 2001129, 2007786
Change-Id: I955e33d90b888d58db5cf6bb490905283374425b
Signed-off-by: Sudarshan Rajagopalan <sudaraja@codeaurora.org>
2017-04-23 23:34:27 -07:00
Nick Desaulniers 3d8a47d738 ANDROID: ion: Protect kref from userspace manipulation
This separates the kref for ion handles into two components.
Userspace requests through the ioctl will hold at most one
reference to the internally used kref. All additional requests
will increment a separate counter, and the original reference is
only put once that counter hits 0. This protects the kernel from
a poorly behaving userspace.

Bug: 34276203

Change-Id: Ibc36bc4405788ed0fea7337b541cad3be2b934c0
Signed-off-by: Daniel Rosenberg <drosen@google.com>
Signed-off-by: Corinna Vinschen <xda@vinschen.de>
2017-04-22 23:02:56 +02:00