Commit graph

602765 commits

Author SHA1 Message Date
Vijay kumar Tumati
edc083e812 msm: camera : Lock Implementation for avoid race condition
Lock Implementation for avoid race condition leading
to out-of-bound write in "msm_vb2_queue_setup

CRs-Fixed: 2362627
Change-Id: I7f7420c7437b9ac2f215929a8614b0846e890c98
Signed-off-by: Vijay kumar Tumati <vtumati@codeaurora.org>
Signed-off-by: Haibin Liu <haibinl@codeaurora.org>
2019-05-15 19:31:19 +08:00
Naman Padhiar
1c16771a7b icnss: Add check on msa region
When icnss receive server arrive it send wlfw_msa_mem_info_send_sync_msg
QMI request to firmware and in response expect range of addresses and size
to be mapped. Add condition to check whether addresses in response falls
under valid range otherwise it asserts.

Change-Id: I9a8542cb6c3b3cefe112d1f08a76dd2eadf68d2f
Signed-off-by: Naman Padhiar <npadhiar@codeaurora.org>
2019-05-14 23:14:39 -07:00
Sumalatha Malothu
2153161639 msm: camera_v2: handle the error value returned during get clock
currently only NULL pointer check is used to validate the return
value from clk_get, this change to handle all the failures.
This snapshot is taken from msm-4.9
Ported it from 4.9 to 4.4

Change-Id: Icd8b7e33d0f235a7c5dde2307972a594908e6a60
Signed-off-by: Sumalatha Malothu <smalot@codeaurora.org>
2019-05-14 04:37:59 -07:00
Linux Build Service Account
8258c6a068 Merge "msm: mdss: hdmi: skip pan_display during handoff" 2019-05-13 09:47:44 -07:00
Linux Build Service Account
0e545f94b2 Merge "diag: Check buffer size against command structure size" 2019-05-10 01:53:18 -07:00
Venkata Prahlad Valluru
b03b261cfc msm: mdss: hdmi: skip pan_display during handoff
In case of HDMI as primary, skip pan_display until
handoff completes.

Change-Id: I5af8142292bcac0f085fffab1af99f635d3ff304
Signed-off-by: Venkata Prahlad Valluru <vvalluru@codeaurora.org>
2019-05-10 01:10:39 -07:00
Linux Build Service Account
f311145c92 Merge "ARM: msm: dts: add splash memory region for APQ8098" 2019-05-09 15:11:37 -07:00
Linux Build Service Account
1204b2acd6 Merge "msm: sps: Update debug message format specifier" 2019-05-09 15:11:37 -07:00
Linux Build Service Account
1d08efb430 Merge "diag: Validate command length against size of command structure" 2019-05-09 15:11:34 -07:00
Jishnu Prakash
797de5526f msm: sps: Update debug message format specifier
Restrict printing of kernel virtual addresses in SPS driver.

In debug prints, handles to bam device structures may be printed
as integers. As these handles are obtained by casting pointer
to bam device structures to integer, they can reveal addresses
of the structures to attackers.

Cast the handles in debug prints to pointers, printed with with %pK,
which hides these values if kptr_restrict is set (default on Android).

Change-Id: Idd28c7d11a06113605f7428a4cfc2505c1ae0073
Signed-off-by: Jishnu Prakash <jprakash@codeaurora.org>
2019-05-09 07:44:19 -07:00
Venkata Prahlad Valluru
0513453847 ARM: msm: dts: add splash memory region for APQ8098
Add splash region to handle continuous splash over
HDMI.

Change-Id: I827111ce1656fcd4bc3bc61232c2f81af3bef5eb
Signed-off-by: Venkata Prahlad Valluru <vvalluru@codeaurora.org>
2019-05-09 18:17:38 +05:30
Manoj Prabhu B
60e2d8fafa diag: Check buffer size against command structure size
Validate the buffer size against the parsing command structure size
before parsing to prevent possible out of bound error case.

CRs-Fixed: 2437341
Change-Id: I31c9a556539fce403691294a76160ae4936e7065
Signed-off-by: Manoj Prabhu B <bmanoj@codeaurora.org>
2019-05-09 03:06:02 -07:00
Manoj Prabhu B
e2220d73ad diag: Validate command length against size of command structure
While processing a packet containing command request, buffer size
need to be checked against size of the command structures that is
being parsed to prevent possible out of bound access.

CRs-Fixed: 2432633
Change-Id: I048bdbd0c096a6d03501bdd5b1d2d4bb50d45dd6
Signed-off-by: Manoj Prabhu B <bmanoj@codeaurora.org>
2019-05-08 23:30:06 -07:00
Manoj Prabhu B
e6d0962b57 diag: dci: Validate dci response length before parsing
Prevent possible out of bound access due to missing length check
while extracting dci packet response by adding proper checks.

CRs-Fixed: 2434571
Change-Id: I7b6972bf6559bdca99333a75d989cd6d3431b801
Signed-off-by: Manoj Prabhu B <bmanoj@codeaurora.org>
2019-05-08 23:21:30 -07:00
Linux Build Service Account
a5da6cf2ab Merge "msm: adm: validate ADSP payload size before access" into kernel.lnx.4.4.r35-rel 2019-05-04 13:41:54 -07:00
Linux Build Service Account
5e0693b152 Merge "msm: vidc: do not set video state to DEINIT very early" into kernel.lnx.4.4.r35-rel 2019-05-04 13:41:43 -07:00
Dhoat Harpal
4172e2077f soc: qcom: glink: Initialize local state while fetching ctx
Initialization of channel's local state is not done at the time of
fetching context from list of channels. This leads to race condition
if remote close happens during this time. Remote close will check if
local state is not open then delete channel from list. This leads to
use after free scenerio.

Initialize local state at the time of fetching channel context from
list of channels.

CRs-Fixed: 2155992
Change-Id: If113daba129191bd67ef2460eb4e87c2d5614403
Signed-off-by: Dhoat Harpal <hdhoat@codeaurora.org>
2019-05-04 13:29:25 -07:00
Vignesh Kulothungan
6845281c4c msm: adm: validate ADSP payload size before access
Check the size of ADSP payload before accessing it.

CRs-Fixed: 2380694
Change-Id: Icdc19a85b39a397ba6d7177f42ece4626b901832
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
2019-05-04 13:29:04 -07:00
Darshan Kumsi Srinivasa
c17751e14a msm: vidc: do not set video state to DEINIT very early
If video state set to DEINIT before processing all frame done
packets in the list may create video failures as explained below,
the client communication to video hardware will fail because of
DEINIT state and client will close the session upon failure which
will happen in parallel to response thread processing the response
packets in the list. It may happen that client already free'd the
buffer references and response thread might access the same buffer
reference and results in use-after-free memory fault. So In case
of sys error from video hardware, set video state to DEINIT after
processing all packets in the list to avoid use-after-free failure

Change-Id: I688c3ec3feb2b5621d75c4da93ee9870aa0e6dfe
Signed-off-by: Darshan Kumsi Srinivasa <darssr@codeaurora.org>
Signed-off-by: Sanjay Singh <sisanj@codeaurora.org>
2019-05-04 13:28:48 -07:00
Pradosh Das
6fbccbec21 Merge commit '803b2f4ca7a08e658026815f5cd328d795ef3eeb' into HEAD
Change-Id: I1a9c35735dca0aff1da4b728e39a482d7679ff64
Signed-off-by: Pradosh Das <prados@codeaurora.org>
2019-05-05 01:44:16 +05:30
Isaac J. Manjarres
94b0437277 soc: qcom: secure_buffer: Process large SG tables in batches
Currently, if processing an SG table consumes more memory
than can fit in the pre-allocated buffer, then calls to
hyp_assign_table() will fail as if there were not enough
memory available to process the request.

Instead, for every call to hyp assign, allocate enough
memory to process the maximum batch size, and process large
SG tables in pieces, using this memory. This avoids failures
due to large SG tables. Also, since the memory for handling
these requests is now allocated per hyp_assign_table() call,
we can drop the pre-allocated buffer, as it is no longer in
use.

Change-Id: Ie9899a5e2c8de6127707609101f5fb557e3f0533
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
2019-05-02 23:04:15 -07:00
Linux Build Service Account
6e386e788f Merge "soc: qcom: glink: Initialize local state while fetching ctx" 2019-04-29 23:25:27 -07:00
Linux Build Service Account
c0bc51b839 Merge "msm: wlan: Update regulatory database" 2019-04-29 23:25:24 -07:00
Linux Build Service Account
aa5bbc972f Merge "msm: vidc: do not set video state to DEINIT very early" 2019-04-29 15:11:08 -07:00
Linux Build Service Account
803b2f4ca7 Merge "msm: vidc: ignore processing responses in invalid state" 2019-04-29 07:14:46 -07:00
Linux Build Service Account
32c139a6ef Merge "lsm: check payload size validity before using it as array index" 2019-04-29 07:14:45 -07:00
Darshan Kumsi Srinivasa
2cae403c69 msm: vidc: ignore processing responses in invalid state
No need to process response messages from video hardware
after device went into invalid state. Processing responses
may result in use-after-free memory fault because client
might free all the resources after error.

Change-Id: I3bfb26e5aa52aba33b7b62cda7820dcbc5fe033f
Signed-off-by: Darshan Kumsi Srinivasa <darssr@codeaurora.org>
2019-04-29 04:08:42 -07:00
Darshan Kumsi Srinivasa
215ee16770 msm: vidc: do not set video state to DEINIT very early
If video state set to DEINIT before processing all frame done
packets in the list may create video failures as explained below,
the client communication to video hardware will fail because of
DEINIT state and client will close the session upon failure which
will happen in parallel to response thread processing the response
packets in the list. It may happen that client already free'd the
buffer references and response thread might access the same buffer
reference and results in use-after-free memory fault. So In case
of sys error from video hardware, set video state to DEINIT after
processing all packets in the list to avoid use-after-free failure

Change-Id: I688c3ec3feb2b5621d75c4da93ee9870aa0e6dfe
Signed-off-by: Darshan Kumsi Srinivasa <darssr@codeaurora.org>
Signed-off-by: Sanjay Singh <sisanj@codeaurora.org>
2019-04-29 16:08:11 +05:30
kunleiz
15c87d11b5 lsm: check payload size validity before using it as array index
Payload size validity is not checked before using it in array index.
Check payload size to avoid out-of-boundary memory.

Change-Id: Ic0b06bb331fc1753ff7543bb218ab12d6a4a3ca8
Signed-off-by: kunleiz <kunleiz@codeaurora.org>
2019-04-29 02:14:22 -07:00
Rajeev Kumar Sirasanagandla
1a649e08b2 msm: wlan: Update regulatory rules for JM
As per regulatory master sheet, JM maps to FCC13 for 5GHz. For FCC13,
there is no radar detect pattern. Therefore, Remove DFS flag for JM.

CRs-Fixed: 2177739
Change-Id: I2dee046369ea4c3bd8feffbf97dbf40bea2137b6
Signed-off-by: Rajeev Kumar Sirasanagandla <rsirasan@codeaurora.org>
2019-04-26 23:46:13 +05:30
gaolez
189c079da2 msm: wlan: Update regulatory database
Enable DFS flag for TT.

Change-Id: I291dd2927ff0c92b243ee9c009b1549fb203165b
CRs-Fixed: 2287335
Signed-off-by: Gaole Zhang <gaolez@codeaurora.org>
2019-04-26 02:49:13 -07:00
Dhoat Harpal
bc0ac2b798 soc: qcom: glink: Initialize local state while fetching ctx
Initialization of channel's local state is not done at the time of
fetching context from list of channels. This leads to race condition
if remote close happens during this time. Remote close will check if
local state is not open then delete channel from list. This leads to
use after free scenerio.

Initialize local state at the time of fetching channel context from
list of channels.

CRs-Fixed: 2155992
Change-Id: If113daba129191bd67ef2460eb4e87c2d5614403
Signed-off-by: Dhoat Harpal <hdhoat@codeaurora.org>
2019-04-25 03:32:56 -07:00
Trishansh Bhardwaj
20beccf7d4 msm: camera: Fix out-of-bounds read in string class name.
jpeg driver is calling class_create with stack variable, which
can be overwritten by other stack variables.

Bug: 114041685
Change-Id: I3c22a5b3375b970ff6b1c6de983dd5833f4e11d0
Signed-off-by: Trishansh Bhardwaj <tbhardwa@codeaurora.org>
Signed-off-by: VijayaKumar T M <vtmuni@codeaurora.org>
2019-04-19 09:25:09 +02:00
Jean-Baptiste Theou
d02272f418 remove faulty trace_printk
For production, we shouldn't have any trace_printk entries

Change-Id: I48e9fabdbbb8da595db350630463bb065a8a6ff7
(cherry picked from commit 99bb9adb91b350bd7ec09c9018eb0901687d85a4)
Signed-off-by: celtare21 <celtare21@gmail.com>
2019-04-19 09:24:48 +02:00
David Lin
1a1a9957df msm_cci: fix inconsistent mutex_lock
drivers/media/platform/msm/camera_v2/sensor/cci/msm_cci.c:939
msm_cci_i2c_read() warn: inconsistent returns
'mutex:&cci_dev->cci_master_info[master].mutex_q[queue]'

Change-Id: Ied241d3ff2fd00d4ce892e250a6236fccf16fac9
Signed-off-by: David Lin <dtwlin@google.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
2019-04-19 09:24:31 +02:00
idkwhoiam322
3d23626712 Revert "msm: camera: isp: Handle frame drop due to delay "
Breaks GCAM This reverts commit 5bf83ce8c3.

Change-Id: I632497550243e9fc4b69ba4a0199d8a3e939fd36
2019-04-19 09:17:53 +02:00
Xiaojun Sang
1b75396524 dsp: asm: validate payload size before access
Payload size is not checked before payload access. Check it
to avoid out-of-boundary memory access.

Change-Id: Iaa39ee4ea5489bb5579e7b7d5dfada12d88c5809
Signed-off-by: Xiaojun Sang <xsang@codeaurora.org>
2019-04-10 15:36:09 +08:00
Deepak Kumar Singh
4fedfe5c4d soc: qcom: qmi_encdec: Restrict string length in decode
The QMI TLV value for strings in a lot of qmi element info structures
account for null terminated strings with MAX_LEN + 1. If a string is
actually MAX_LEN + 1 length, this will cause an out of bounds access
when the NULL character is appended in decoding.

CR-Fixed: 2359244
Change-Id: I4d789bc6017ff58458f77fe875ca4e175a4f1357
Signed-off-by: Chris Lew <clew@codeaurora.org>
Signed-off-by: Deepak Kumar Singh <deesin@codeaurora.org>
2019-04-09 01:59:13 -07:00
Linux Build Service Account
995aca0cb0 Merge "dsp: validate token before usage as array index" into kernel.lnx.4.4.r35-rel 2019-04-09 01:53:45 -07:00
Vignesh Kulothungan
877ffd6d9d msm: asm: validate ADSP data before access
Validate buffer index obtained from ADSP token before using it.

CRs-Fixed: 2372302
Change-Id: I5c3b1634bd08b516844638dd67f726a882edfc17
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
2019-04-09 01:44:52 -07:00
Xiaojun Sang
48272dd0ff dsp: validate token before usage as array index
Token from DSP might be invalid for array index. Validate the
token before being used as array index.

Change-Id: I9f47e1328d75d9f9acf7e85ddb452019b6eced0a
Signed-off-by: Xiaojun Sang <xsang@codeaurora.org>
2019-04-09 14:08:05 +05:30
Linux Build Service Account
c2c52e8d2b Merge "msm: ice: check for crypto engine availability" into kernel.lnx.4.4.r35-rel 2019-04-08 12:30:15 -07:00
Neeraj Soni
07c5f7c8c9 msm: ice: check for crypto engine availability
There can be many ice instances present in dtsi file but
not all of them will be initialized by storage driver.
Check if crypto instance is initialized before setting
it up for data encryption/decryption usage.

Change-Id: I7c9227007474052513b277dec5963a973781c524
Signed-off-by: Neeraj Soni <neersoni@codeaurora.org>
2019-04-08 12:15:48 -07:00
Xiaojun Sang
e8909e3e1a dsp: asm: validate payload size before access
Payload size is not checked before payload access. Check size
to avoid out-of-boundary memory access.

Change-Id: Iaa39ee4ea5489bb5579e7b7d5dfada12d88c5809
Signed-off-by: Xiaojun Sang <xsang@codeaurora.org>
2019-04-08 12:10:28 -07:00
Rajesh Kemisetti
a1b80321ae msm: kgsl: Limit log frequency in case of context count maxed out
kgsl_context_init() prints error message continuously if a process
tries to create more number of contexts that KGSL supports.

This hogs CPU and might lead to watchdog timeout.

Reduce this log frequency by using KGSL_DRV_ERR_RATELIMIT().

Change-Id: I7e3a5d3db41ab0c60d1b6b620cbcdef96d5c21a9
Signed-off-by: Rajesh Kemisetti <rajeshk@codeaurora.org>
2019-04-08 03:16:25 -07:00
Vatsal Bucha
279b0b023c qdsp6v2: q6usm: Check size of payload before access
Check size of payload before access in q6usm_mmapcallback.

Change-Id: Iff0672532c2ea40e7129237a92d8365d6b554cf2
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2019-04-04 23:47:19 -07:00
Linux Build Service Account
6dfb4b756b Merge "qdsp6v2: q6usm: Check size of payload before access" 2019-04-03 09:11:35 -07:00
Linux Build Service Account
281de5809e Merge "perf: Cancel the mux hrtimer during CPU hotplug to avoid migration" 2019-04-03 00:25:13 -07:00
Linux Build Service Account
dd45e2fcea Merge "msm: asm: validate ADSP data before access" 2019-04-02 14:00:26 -07:00
Linux Build Service Account
5d45bd7a1e Merge "drivers: soc: qcom: Added check to avoid opening multiple instance" 2019-04-02 14:00:24 -07:00