Commit graph

687,095 commits

Message SHA1
msm: vidc: Fix max value of base layer pid
Increase the max allowed value of base layer pid
from 6 to 63 as per the spec.

Change-Id: Ie51de329a1f67633dd488bc15b3d37101a1a0b33
Signed-off-by: Mahesh Voorugonda <quic_mvoorugo@quicinc.com>

Mahesh Voorugonda   authored and   Agnimitra Sen   commited 2023-09-21 12:58:08 -07:00
994cf5fbdf
bus: mhi: misc: Add check for dev_rp if it is iommu range or not
er_ctxt->rp pointer is updated by MDM which is untrusted to HLOS,
it could be arbitrary value.

If there is security issue on MDM, and updated pointer which is not
align then driver will never come out of loop where checking against
dev_rp != rp.

So added check to make sure it is in the buffer range & aligned to 128bit.

Change-Id: Ib484e07f2c75fcd657a4ccc648a3a20de3edeebc
Signed-off-by: Krishna chaitanya chundru <quic_krichai@quicinc.com>
Signed-off-by: Paras Sharma <quic_parass@quicinc.com>
(cherry picked from commit 9a0593979577cb86eebc9503b4bbe3e27f9e195a)

Paras Sharma   authored and   Errikayala Subramanyam   commited 2023-08-24 00:41:09 -07:00
2e3b9045e4
pinctrl: qcom: Using readl_relaxed/writel_relaxed APIs
Replacing scm_io_read/scm_io_write with readl_relaxed/writel_relaxed
respectively.

Change-Id: I5837b5c99e44c4f088df55e37dafe7964bf2e942
Signed-off-by: Naresh Kumar Lingagalla <quic_nlingaga@quicinc.com>

Naresh Kumar Lingagalla   authored and   Gerrit - the friendly Code Review server   commited 2023-06-09 00:14:39 -07:00
7db206dd44
pinctrl: qcom: Using readl_relaxed/writel_relaxed APIs
Replacing scm_io_read/scm_io_write with readl_relaxed/writel_relaxed
respectively.

Change-Id: I5536906eb40ab618eb429f97d813462813fcfc44
Signed-off-by: Naresh Kumar Lingagalla <quic_nlingaga@quicinc.com>

Naresh Kumar Lingagalla   authored and   Gerrit - the friendly Code Review server   commited 2023-06-05 05:11:19 -07:00
68c4f0b6ad
msm: kgsl: Keep postamble packets in a privileged buffer
Postamble packets are executed in privileged mode by gpu. So we should keep
them in a privileged scratch buffer to block userspace access. For
targets with APRIV feature support, we can mark the preemption scratch
buffer as privileged too to avoid similar issues in future.

Change-Id: Ifda360dda251083f38dfde80ce1b5dc83daae902
Signed-off-by: Akhil P Oommen <quic_akhilpo@quicinc.com>
Signed-off-by: Kaushal Sanadhya <quic_ksanadhy@quicinc.com>

Akhil P Oommen   authored and   Gerrit - the friendly Code Review server   commited 2023-04-18 23:22:17 -07:00
62ab4b820f
Merge "msm: kgsl: Make sure that pool pages don't have any extra references"
Linux Build Service Account   authored and   Gerrit - the friendly Code Review server   commited 2023-03-05 20:57:10 -08:00
5b4853e8ef
msm: kgsl: Make sure that pool pages don't have any extra references
Before putting a page back in the pool be sure that it doesn't have
any additional references that would be a signal that somebody else
is looking at the page and that it would be a bad idea to keep it
around and run the risk of accidentally handing it to a different
process.

Change-Id: Ic0dedbad0cf2ffb34b76ad23e393c5a911114b82
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Harshitha Sai Neelati <quic_hsaineel@quicinc.com>

Harshitha Sai Neelati   authored and   Rajesh Kemisetti   commited 2023-03-05 20:20:35 +05:30
b9b8bc658c
msm: kgsl: Use dma_buf_get() to get dma_buf structure
Currently we don't ensure if vma->vm_file is associated with dma_buf. This
can cause issues later when private_data from a non dma_buf file is used as
dma_buf structure. Hence get the fd that is associated with vma->vm_file
and use dma_buf_get() to get pointer to dma_buf structure. dma_buf_get()
ensures that the file from the input fd is associated with dma_buf.

Change-Id: Ib78aef8b16bedca5ca86d3a132278ff9f07dce73
Signed-off-by: Puranam V G Tejaswi <quic_pvgtejas@quicinc.com>

Puranam V G Tejaswi   authored and   Rajesh Kemisetti   commited 2023-03-05 08:43:08 +05:30
ae0923eb75
net: ipc_router: Add bounds check on tx path
Add bounds check on values read from shared memory in the tx path.
In cases where the VM is misbehaving, the ipcrtr fifo xport should
exit and print a warning when bogus values may cause out of bounds to
be read.

Change-Id: I2d219b36a4d7ddb137f232f47f4fe2e662add98d
Signed-off-by: Sarannya S <quic_sarannya@quicinc.com>

Sarannya S   authored and   Gerrit - the friendly Code Review server   commited 2023-01-04 21:42:04 -08:00
ad457d2413
msm: ADSPRPC: Restrict untrusted applications from attaching to GuestOS
Untrusted application can attach to guestOS and staticPD if it can
somehow make INIT IOCTL call with ATTACH flag. This is a potential
security issue as the untrusted application can crash guestOS or
staticPD. Restrict attach to guestOS or staticPD request if request
is being made using non-secure device node.

Change-Id: I322c7b242fd0baaf1c1bce2d83b992fecb0ca593
Acked-by: Ekansh Gupta <ekangupt@qti.qualcomm.com>
Signed-off-by: Vamsi Krishna Gattupalli <quic_vgattupa@quicinc.com>

Vamsi Krishna Gattupalli   authored and   Gerrit - the friendly Code Review server   commited 2022-07-08 02:17:36 -07:00
7c3ffbe3d5
Merge "msm: kgsl: Remove 'fd' dependency to get dma_buf handle"
Linux Build Service Account   authored and   Gerrit - the friendly Code Review server   commited 2022-05-23 04:41:30 -07:00
f4fb629ace
Merge "msm: kgsl: Fix gpuaddr_in_range() to check upper bound"
Linux Build Service Account   authored and   Gerrit - the friendly Code Review server   commited 2022-05-23 04:41:27 -07:00
22d6b4a1bf
msm: kgsl: Remove 'fd' dependency to get dma_buf handle
Get the dma_buf handle directly from 'vm_file' after
doing necessary checks on the file.

Change-Id: Id5eec16588d64e4e28483b32bb52d4d3d9b86b99
Signed-off-by: ravnar <quic_ravnar@quicinc.com>
Signed-off-by: Sanjay Yadav <quic_sanjyada@quicinc.com>
Signed-off-by: Abhishek Barman <quic_abarman@quicinc.com>
Signed-off-by: Kamal Agrawal <quic_kamaagra@quicinc.com>

Abhishek Barman   authored and   Kamal Agrawal   commited 2022-05-11 15:07:20 +05:30
db2b3cf93d
msm: kgsl: Fix gpuaddr_in_range() to check upper bound
Currently gpuaddr_in_range() accepts only the gpuaddr & returns
true if it lies in valid range. But this does not mean that the
entire buffer is within range.
Modify the function to accept size as a parameter and check that
both starting & ending points of buffer lie within mmu range.

Change-Id: I1d722295b9a27e746bfdb6d3bf409ffe722193cb
Signed-off-by: Rohan Sethi <quic_rohsethi@quicinc.com>
Signed-off-by: Abhishek Barman <quic_abarman@quicinc.com>
Signed-off-by: Kamal Agrawal <quic_kamaagra@quicinc.com>

Abhishek Barman   authored and   Kamal Agrawal   commited 2022-05-11 14:59:18 +05:30
50d74c6b62
Merge "msm: kgsl: Perform cache flush on the pages obtained using get_user_pages()"
Linux Build Service Account   authored and   Gerrit - the friendly Code Review server   commited 2022-04-23 04:32:11 -07:00
8e0e8dc1de
msm: kgsl: Zap performance counters across context switches
Performance counter values need not be retained across contexts unless
specifically requested for debug. Zap the counters by initialising
perfcounter SRAM with 0's using GPU_RBBM_PERFCTR_SRAM_INIT_CMD.

Add pm4 packets during context switches and add a KMD postamble packet to
clear the counters during preemption. Do not enable perfcounter save and
restore unless requested.

Change-Id: I371779ce659c07a1cc664327f5ecdcf0374201d8
Signed-off-by: Mohammed Mirza Mandayappurath Manzoor <quic_mmandaya@quicinc.com>
Signed-off-by: Sebanti Das <quic_sebadas@quicinc.com>
Signed-off-by: Pankaj Gupta <quic_gpankaj@quicinc.com>

Pankaj Gupta   authored and   Sebanti Das   commited 2022-03-21 13:36:41 +05:30
58f8d1d270
msm: kgsl: Add a sysfs node to control performance counter reads
Currently performance counters are global and can be read by anyone. Change
the behaviour to disable reading global counters as default and add a sysfs
node to enable/disable reads.

Change-Id: Ic3785acd9bd7425c2a844ed103d7b870d9f80adf
Signed-off-by: Mohammed Mirza Mandayappurath Manzoor <quic_mmandaya@quicinc.com>
Signed-off-by: Harshitha Sai Neelati <quic_hsaineel@quicinc.com>
Signed-off-by: Pankaj Gupta <quic_gpankaj@quicinc.com>
Signed-off-by: Sebanti Das <quic_sebadas@quicinc.com>

Pankaj Gupta   authored and   Sebanti Das   commited 2022-03-21 13:32:45 +05:30
f61222b5e8
msm: kgsl: Perform cache flush on the pages obtained using get_user_pages()
Consider a scenario where user allocates anonymous memory but does not
write to it. Here the physical pages are not yet allocated. Now when this
memory is requested to be imported, a list of newly allocated zero pages
is obtained using get_user_pages(). Currently cache flush is not done for
these pages and hence GPU sees stale data. Fix this by performing cache
flush on these pages.

Change-Id: Id1e8aa20e8a9de112761732ed92f30c01088840b
Signed-off-by: Puranam V G Tejaswi <quic_pvgtejas@quicinc.com>
Signed-off-by: Sebanti Das <quic_sebadas@quicinc.com>
Signed-off-by: Kamal Agrawal <quic_kamaagra@quicinc.com>

Puranam V G Tejaswi   authored and   Kamal Agrawal   commited 2022-02-01 12:44:29 +05:30
63b454fefb
msm: kgsl: Fix memory leak for anonymous buffers
Currently, clean up is not done properly for anonymous buffer
(KGSL_MEM_ENTRY_USER). Fix it by freeing up resources allocated
during memdesc_sg_virt.

Change-Id: I75bff2e718b494c102a8075a5f27323e1823b212
Signed-off-by: Kamal Agrawal <kamaagra@codeaurora.org>
Signed-off-by: Rajesh Kemisetti <rajeshk@codeaurora.org>

Kamal Agrawal   authored and   Rajesh Kemisetti   commited 2021-12-23 18:45:24 +05:30
ca935e323f
Merge "msm: kgsl: Update register protection config"
Linux Build Service Account   authored and   Gerrit - the friendly Code Review server   commited 2021-11-10 03:27:18 -08:00
3297d95c5a
msm: kgsl: Update register protection config
Update the register protection configuration as per the latest
recommendation.

Change-Id: I70365268e8e4c7ee4ff28538f22e970822e4edf0
Signed-off-by: Akhil P Oommen <akhilpo@codeaurora.org>

Akhil P Oommen   authored and   Kamal Agrawal   commited 2021-11-08 12:17:13 +05:30
a511cc2fc4
disp: msm: sde: protect file private structure with mutex lock
Access file private data structures inside the
mutex lock only to avoid use-after-free issues.

Change-Id: Ibae25aa31eeb7a7afada3dd0ecc236615223dfc9
Signed-off-by: srikanthreddy ponogoti <sponogot@codeaurora.org>

srikanthreddy ponogoti   authored and   Gerrit - the friendly Code Review server   commited 2021-11-01 23:48:14 -07:00
cd3a09b4df
Merge "soc: qcom: glink: wait for tx blocked signal response"
Linux Build Service Account   authored and   Gerrit - the friendly Code Review server   commited 2021-10-04 10:15:39 -07:00
4e5159084d
msm: kgsl: Fix out of bound write in adreno_profile_submit_time
Make sure there is enough room in the memory descriptor to store the
entire profiling buffer object.

Change-Id: I1e1c73097bb2bba9645b0a3c66fdbbc71d8ba8fa
Signed-off-by: Kamal Agrawal <kamaagra@codeaurora.org>

Kamal Agrawal   authored and   Gerrit - the friendly Code Review server   commited 2021-09-27 07:23:22 -07:00
77d3ec60d1
soc: qcom: glink: wait for tx blocked signal response
Until tx blocked signal response is received, allowing
tx may again fill the fifo. As tx_blocked_signal_sent
is already true glink will not be able to send tx blocked
signal again to remote host.

Do not allow tx unless response for previous tx blocked
signal is received.

CRs-Fixed: 3039195
Change-Id: Ib8137740f5a02958645934b55e33673394412919
Signed-off-by: Deepak Kumar Singh <deesin@codeaurora.org>

Deepak Kumar Singh   commited 2021-09-21 16:23:04 +05:30
e25a3ff8d8
msm: kgsl: Deregister gpu address on memdesc_sg_virt failure
When memdesc_sg_virt returns error in kgsl_setup_anon_useraddr function,
the gpu address registered in SVM region will not be deregistered.
This change deregisters the gpu address on memdesc_sg_virt failure.

Change-Id: Ic99167e283a0c6331bb9f5f0b608b6cdb3c918e4
Signed-off-by: Neeraja P <neerp@codeaurora.org>
Signed-off-by: Rajesh Kemisetti <rajeshk@codeaurora.org>

Rajesh Kemisetti   authored and   Harshitha Sai Neelati   commited 2021-08-16 13:57:05 +05:30
b87350e732
disp: msm: sde: add null check for drm file in msm_release
Drm file is not set to NULL after freeing it from drm
release. This can result in use-after-free issues in
some scenarios. Add a mutex lock and other proper null
checks to prevent such issues.

Change-Id: Ic35b0a76166b0f47a354b1737e6f4c3ac1437ed4
Signed-off-by: Nirmal Abraham <nabrah@codeaurora.org>
Signed-off-by: Althaf Neelanchirayil <aneelanc@codeaurora.org>

Krishna Manikandan   authored and   Gerrit - the friendly Code Review server   commited 2021-08-09 23:45:58 -07:00
2b282ad1d8
msm: adsprpc: Handle UAF in process shell memory
Added flag to indicate memory used
in process initialization. And, this memory
would not removed in internal unmap to avoid
UAF or double free.

Change-Id: Ifa621dee171b3d1f98b82302c847f4d767f3e736
Signed-off-by: Swathi K <kataka@codeaurora.org>

Swathi K   commited 2021-07-16 12:43:17 +05:30
f5f9e4b492
msm: adsprpc: Fix race condition in internal_control
Protect add and update qos request with mutex to
avoid race condition when multiple threads try to add
or update request simultaneously.

Change-Id: Id33b81bf85246ec69c72bad59cca068e627bb21d
Acked-by: Deepika Singh <dsi@qti.qualcomm.com>
Signed-off-by: Jeya R <jeyr@codeaurora.org>

Jeya R   authored and   Gerrit - the friendly Code Review server   commited 2021-07-08 03:42:31 -07:00
f1a84321f9
msm: adsprpc: overflow vulnerability by race condition in adsprpc driver
Create local copy of current->comm to avoid the possibility of modification
in race condition.

Change-Id: Ie10f6577ed7edb9279a36039348e7a1ad25239f9
Acked-by: Nishant Chaubey <chaubey@qti.qualcomm.com>
Signed-off-by: Jeya R <jeyr@codeaurora.org>

Jeya R   authored and   Gerrit - the friendly Code Review server   commited 2021-04-01 00:40:49 -07:00
c86a1b0afc
crypto: Fix possible stack out-of-bound error
Adding fix to check the upper limit on the length
of the destination array while copying elements
from source address to avoid stack out of bound error.

Change-Id: I39d5768fa97f9d269cfb101a389bb771d13c7538
Signed-off-by: Monika Singh <monising@codeaurora.org>

Monika Singh   authored and   Gerrit - the friendly Code Review server   commited 2021-03-14 22:33:55 -07:00
ddc41aeaf8
net:sockev: hold file reference till the sock event is sent
hold file reference till the sock event is sent.

Change-Id: I14d581f210c86e5771bec22a9aca7c78630e9ac1
Signed-off-by: Sharath Chandra Vurukala <sharathv@codeaurora.org>

Sharath Chandra Vurukala   authored and   Gerrit - the friendly Code Review server   commited 2021-03-10 01:39:08 -08:00
60dc8c0a09
msm: kgsl: Access map_count only if entry is successfully allocated
In kgsl_mem_entry_create, access map_count only if entry is allocated
successfully to avoid invalid access.

Change-Id: I57bce1aec2da6a27b6d13dbee96ed86a45c9660c
Signed-off-by: Deepak Kumar <dkumar@codeaurora.org>

Deepak Kumar   authored and   Gerrit - the friendly Code Review server   commited 2021-03-07 23:52:20 -08:00
a7fd5812f9
Merge "msm: kgsl: Correct the refcount on current process PID"
Linux Build Service Account   authored and   Gerrit - the friendly Code Review server   commited 2021-02-01 20:48:33 -08:00
61a74387dd
Merge "msm: kgsl: Stop using memdesc->usermem"
Linux Build Service Account   authored and   Gerrit - the friendly Code Review server   commited 2021-02-01 20:48:31 -08:00
33834d647d
Merge "msm: kgsl: Protect the memdesc->gpuaddr in SVM use cases"
Linux Build Service Account   authored and   Gerrit - the friendly Code Review server   commited 2021-02-01 20:48:30 -08:00
56a0deb91b
Merge "msm:ADSPRPC :Fix to avoid Use after free in fastrpc_internal_munmap"
Linux Build Service Account   authored and   Gerrit - the friendly Code Review server   commited 2021-02-01 20:48:27 -08:00
cef802dd22
msm: kgsl: Correct the refcount on current process PID
In kgsl_process_private_new() function there is inconsistency
in the refcount of current process PID. Fix this to avoid
overflowing of reference counter leading to use after free
of this struct.

Change-Id: I6291b9a05e139337e7f8471d0f9409fc839969a3
Signed-off-by: Archana Sriram <apsrir@codeaurora.org>

Archana Sriram   authored and   Gerrit - the friendly Code Review server   commited 2021-02-01 02:59:28 -08:00
4ce0db5024
msm: kgsl: Stop using memdesc->usermem
It shouldn't be illegal for memory descriptors to have multiple virtual
memory mappings under certain circumstances. If that is the case
tracking a single usermem address for each memdesc no longer makes much
sense. Get rid of the memdesc->usermem member and use an atomic counter
to track mappings instead.

Change-Id: Ic0dedbad31bafcd1019ccc8e68657cb7e3c72727
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Harshitha Sai Neelati <hsaine@codeaurora.org>
Signed-off-by: Pranav Patel <pranavp@codeaurora.org>

Jordan Crouse   authored and   Gerrit - the friendly Code Review server   commited 2021-02-01 02:59:04 -08:00
918ff3fbdf
msm: kgsl: Protect the memdesc->gpuaddr in SVM use cases
When SVM is being used there can only be one GPU address assigned
to the memory descriptor. Don't allow the GPU address to be changed
after it has been negotiated the first time by a process.

Change-Id: Ic0dedbad2a1b3ccdc2c1598a6c501b2be288d64e
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Harshitha Sai Neelati <hsaine@codeaurora.org>
Signed-off-by: Pranav Patel <pranavp@codeaurora.org>

Jordan Crouse   authored and   Gerrit - the friendly Code Review server   commited 2021-02-01 02:59:00 -08:00
81f366d210
msm:ADSPRPC :Fix to avoid Use after free in fastrpc_internal_munmap
Added a check to validate map before freeing it to avoid Use after
free scenario.

Change-Id: I484391ff7c55c0689530a928a2821ee5a1a0e10c
Signed-off-by: Vamsi krishna Gattupalli <vgattupa@codeaurora.org>

Vamsi krishna Gattupalli   authored and   Gerrit - the friendly Code Review server   commited 2021-02-01 02:56:45 -08:00
934cf8f650
msm: kgsl: Allocate user_ctxt_record based on preemption feature flag
Allocation of memory to user_ctxt_record is done based on adreno_device
flag. If a context is created when preemption is disabled, the memory
to user_ctxt_record is not allocated. Now if we enable preemption,
through the sysfs knob, the device flag is again set. We may try to
access user_ctxt_record in preemption_pre_ibsubmit(). So allocate memory
to user_ctxt_record based on the preemption feature flag instead
of preemption device flag.

Change-Id: I947ef5a1bfbd8bff471427fae60d7fcd507b85a2
Signed-off-by: Puranam V G Tejaswi <pvgtejas@codeaurora.org>
Signed-off-by: Harshitha Sai Neelati <hsaine@codeaurora.org>

Puranam V G Tejaswi   authored and   Gerrit - the friendly Code Review server   commited 2021-02-01 02:56:26 -08:00
cb4d45a027
Merge 75fae4d1e4 on remote branch
Change-Id: Ia3b652d6d4a96986d72b7896eafbfc38d60b3db8

Linux Build Service Account   commited 2020-11-29 23:08:23 -08:00
1e5bd85599
Merge "msm-camera: Add SOF Consolidation for SHDRv3.8"
Linux Build Service Account   authored and   Gerrit - the friendly Code Review server   commited 2020-11-25 11:26:55 -08:00
75fae4d1e4
msm-camera: Add SOF Consolidation for SHDRv3.8
ADD SOF Consolidation for SHDRv3.8

Change-Id: I97d6b1bd859e2ddd8f000f934bb288afe0c3dacb
Signed-off-by: Chandan Gera <cgera@codeaurora.org>

Chandan Gera   commited 2020-11-25 12:58:08 +05:30
260e268e9a
uapi: sound: Fix compilation error
Add macros related to audio to fix compilation
error.

Change-Id: I7e13c429cfadb1a05c447cad3557d8d179fe22eb
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>

Aditya Bavanari   commited 2020-11-24 13:07:42 +05:30
7604502b6d
ARM: msm: dts: Remove force ufs probe flag in emmc based device
Remove force-ufshc-probe in emmc based boot device.
It was added to cdp,dtsi for prototyping using UFS as
extended storage on eMMC target. This flag is not really
needed. Hence removing it.

Change-Id: I7a97c53e1db75050e9ca89ab67b480085c8790aa
Signed-off-by: Nitin Rawat <nitirawa@codeaurora.org>

Nitin Rawat   authored and   Gerrit - the friendly Code Review server   commited 2020-11-19 02:46:24 -08:00
23014ec694
Merge "defconfig: msm: Disable ANDROID_LOW_MEMORY_KILLER"
Linux Build Service Account   authored and   Gerrit - the friendly Code Review server   commited 2020-11-11 08:56:49 -08:00
77a5d2b6ff
defconfig: msm: Disable ANDROID_LOW_MEMORY_KILLER
Disable CONFIG_ANDROID_LOW_MEMORY_KILLER for testLmkdKill
cts testcase.

Change-Id: Ia831ae44089762d0ff9a0833334f7c24d6dc3ec9
Signed-off-by: Rahul Shahare <rshaha@codeaurora.org>

Rahul Shahare   commited 2020-11-11 08:24:36 +05:30
fd47451064
msm: Changes to support 7.6k resolution feature
-Add HFI changes to firmware to set the 7.6k resolution

Change-Id: Ic7825d45648418c26744822a25096e38123fad58
Signed-off-by: Srinu Gorle <sgorle@codeaurora.org>

Rudra Venkatesh(Temp)   authored and   Srinu Gorle   commited 2020-11-10 15:14:18 +05:30
06545143b8