Commit graph

602786 commits

Author SHA1 Message Date
Meera Gande
cc4d1a6cb1 msm: camera: isp: Fix frame drop pattern
In few scenarios, the request frame may get
delayed and current and request frame id may
become same. While user space is informed to
delay a frame in such scenarios, the pattern
shouldn't get reset.

Change-Id: I63f1301fbbe7cba024a686cbd783af25232f1293
Signed-off-by: Meera Gande <mgande@codeaurora.org>
2019-06-03 15:43:52 +05:30
Linux Build Service Account
10a5c5b618 Merge 96eca37071 on remote branch
Change-Id: Ib1b8db2b2d165effaca8114bd41c8afbec79f437
2019-06-01 22:21:22 -07:00
Manoj Prabhu B
96eca37071 diag: Check command size against the minimum before parsing
Add check for minimum length before typecasting to build mask
structure to prevent out of bound access while processing
get msg mask command.

CRs-Fixed: 2431047
Change-Id: I5b8341f278b0b46359800e43c604c5671261c728
Signed-off-by: Manoj Prabhu B <bmanoj@codeaurora.org>
2019-05-30 02:04:29 -07:00
Narender Ankam
ad283e50ec msm: mdss: hdmi: parse extended EDID block map
As part of EDID parser, add support to parse extended EDID
Block Map (0xf0) block and parse all subsequent CEA (0x02)
extended EDID Blocks.

Change-Id: I581efae59dde3abf6f297d5a2519ac0088554b64
Signed-off-by: Narender Ankam <nankam@codeaurora.org>
2019-05-29 13:38:49 +05:30
Narender Ankam
639259bb32 msm: mdss: hdmi: fix 4 block EDID read failure
Only Block0 and Block1 of EDID are being read successfully.
Fix EDID segment read failure for Block2 and Block3.

Change-Id: I2d501878c6089b275e77587f3f41416aec2ef389
Signed-off-by: Narender Ankam <nankam@codeaurora.org>
2019-05-29 00:59:36 -07:00
Linux Build Service Account
10da01940d Merge "msm: adm: validate ADSP payload size before access" 2019-05-24 10:20:00 -07:00
Narender Ankam
526404d09d msm: mdss: assign block_id for INTF_3
As part of destination scalar on HDMI, INTF3 will be
configured as dual LM single display for higher video
timings. Assign block_id for HDMI INTF.

Change-Id: I09f5eb4136c4a8248f3dc9a36e2d94110419112d
Signed-off-by: Narender Ankam <nankam@codeaurora.org>
2019-05-24 00:41:02 -07:00
Vignesh Kulothungan
a935cbe437 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-22 12:18:41 -07:00
E V Ravi
dabba2bc7b msm: ais : Lock Implementation for avoid race condition
Lock Implementation for avoid race condition leading
to out-of-bound write in "msm_vb2_queue_setup

Change-Id: I386f1709bdf3328ae0c1db44980db8453849babf
Signed-off-by: E V Ravi <evenka@codeaurora.org>
2019-05-22 02:29:29 -07:00
Linux Build Service Account
44d964e1d2 Merge "dsp: afe: check for minimum size before payload access" 2019-05-21 18:16:58 -07:00
Karthikeyan Mani
a919f50d96 dsp: afe: check for minimum size before payload access
Check if payload data is atleast the minimum expected size
before accessing the data in it.

Change-Id: Ia1295ca5ad5d002122e416fae53588681da687ea
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
2019-05-21 10:37:29 -07:00
Linux Build Service Account
403885b338 Merge "msm: qdsp6v2: Check size of payload before access" 2019-05-21 10:20:09 -07:00
Vatsal Bucha
f455966ef0 msm: qdsp6v2: Check size of payload before access
Check size of payload array before access in qdsp_mvm_callback.

Change-Id: I81d945f963cfb4a3cb26155700b82880d891ec5e
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2019-05-21 05:43:31 -07:00
Linux Build Service Account
5bfaf959ac Merge "msm: mdss: hdmi: reset sink_caps before parsing EDID" 2019-05-21 02:24:45 -07:00
Narender Ankam
ee8a9362ca msm: mdss: hdmi: reset sink_caps before parsing EDID
Within EDID parser's data structure, sink_caps of previous
EDID are being retained. Reset sink_caps before parsing new
EDID.

Change-Id: I7927161256ec87ab77b26a9d7bc5e0cd1df5583b
Signed-off-by: Narender Ankam <nankam@codeaurora.org>
2019-05-21 00:41:10 -07:00
Narender Ankam
2cbfe924cf msm: mdss: mdp: mixer allocation for pluggable primary display
Try to allocate mixers LM0 and LM1 to an external pluggable
display if it is configured as primary display.

Change-Id: I81672132a6452535dcd7c2977e76f88a5f3aecf9
Signed-off-by: Narender Ankam <nankam@codeaurora.org>
2019-05-21 00:35:22 -07:00
Linux Build Service Account
eddc389f5a Merge "net: sockev: avoid races between sockev and socket_close" 2019-05-20 09:12:57 -07:00
Sharath Chandra Vurukala
4d2f6ab9a8 net: sockev: avoid races between sockev and socket_close
Use-after-free is seen when sending a sockev netlink message
since socket is not held which can race with sk_free.

KASAN: use-after-free in sockev_client_cb+0x41c/0x4b8
	in net/core/sockev_nlmcast.c:104
Read of size 2 at addr ffffffc08420c550
Call trace:
dump_backtrace+0x0/0x388 arch/arm64/kernel/time.c:55
show_stack+0x24/0x30 arch/arm64/kernel/traps.c:152
__dump_stack+0x24/0x2c lib/dump_stack.c:17
dump_stack+0x8c/0xd0 lib/dump_stack.c:53
print_address_description+0x74/0x234 mm/kasan/report.c:256
kasan_report_error mm/kasan/report.c:354 [inline]
kasan_report+0x240/0x264 mm/kasan/report.c:412
__asan_report_load2_noabort+0x2c/0x38 mm/kasan/report.c:431
sockev_client_cb+0x41c/0x4b8 net/core/sockev_nlmcast.c:104
notifier_call_chain+0x104/0x158 kernel/notifier.c:93
__blocking_notifier_call_chain+0x80/0xb0 kernel/notifier.c:317
blocking_notifier_call_chain+0x3c/0x4c kernel/notifier.c:328
sockev_notify+0x30/0x3c net/socket.c:181
SYSC_bind net/socket.c:1509 [inline]
SyS_bind+0x1ec/0x30c net/socket.c:1489
el0_svc_naked+0x34/0x38
Freed by task 19460:
save_stack mm/kasan/kasan.c:447 [inline]
set_track mm/kasan/kasan.c:459 [inline]
__kasan_slab_free+0x134/0x20c mm/kasan/kasan.c:520
kasan_slab_free+0x10/0x1c mm/kasan/kasan.c:527
slab_free_hook mm/slub.c:1401 [inline]
slab_free_freelist_hook mm/slub.c:1422 [inline]
slab_free mm/slub.c:2979 [inline]
kmem_cache_free+0x114/0x664 mm/slub.c:3001
sk_prot_free net/core/sock.c:1504 [inline]
__sk_destruct+0x324/0x3c0 net/core/sock.c:1585
__sk_free+0x180/0x200 net/core/sock.c:1601
sk_free+0x44/0x50 net/core/sock.c:1612
sock_put include/net/sock.h:1643 [inline]
sk_common_release+0x198/0x20c net/core/sock.c:3014
raw_close+0x38/0x44 net/ipv4/raw.c:703
inet_release+0x128/0x15c net/ipv4/af_inet.c:446
__sock_release+0xb8/0x258 net/socket.c:614
sock_close+0x24/0x34 net/socket.c:1150
__fput+0x1f4/0x4e4 fs/file_table.c:345
____fput+0x20/0x2c fs/file_table.c:380
task_work_run+0x9c/0x174 kernel/task_work.c:113

Change-Id: Idb4335889b6e4228f36d76ca5b6156cc5e5838da
Signed-off-by: Sharath Chandra Vurukala <sharathv@codeaurora.org>
2019-05-20 15:51:25 +05:30
Karthikeyan Mani
26ac9f568e dsp: afe: check for payload size before payload access
Check if payload data is big enough before accessing
the data in it.

Change-Id: I939f205a8cebf6ef4859f81fae5429bca013d540
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
2019-05-20 00:39:09 -07:00
Rajesh Kemisetti
51f1f59a3f msm: kgsl: Fix race condition while making page as dirty
set_page_dirty() is racy if the caller has no
reference against page->mapping->host, and if
the page is unlocked. This is because another
CPU could truncate the page off the mapping and
then free the mapping.

Use set_page_dirty_lock() to avoid this race condition.

Change-Id: I517fb9aee66560618c7676b311368f7a7498011f
Signed-off-by: Rajesh Kemisetti <rajeshk@codeaurora.org>
Signed-off-by: Archana Sriram <apsrir@codeaurora.org>
2019-05-15 22:10:58 -07:00
Linux Build Service Account
b1d5c60aa5 Merge "msm: camera : Lock Implementation for avoid race condition" 2019-05-15 11:46:08 -07:00
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